Followers

MIPS - Addressing mode and instruction format


REPOST





ABDUL WAFIY BIN SUZLY
B031210108
930408-01-5427

Thanks for reading, please leave your comment here.

Memory


Memory

      Memory is a solid state digital device where it provides storage for data values. It’s also known as memory cell which exhibit two stable states represented by binary digit 1’s and 0’s.

      So what we the ‘users’ usually want in a memory is that it has a huge storage capacity and fast so that everything is kept within instant access whenever we want it. Well fortunately we can achieve that now by using a method known as “Memory Hierarchy”.




Reading Ahead

        The concept is to reduce the data access time so that we can obtain data needed very very fast. To do that we use a technique called “ reading ahead ”.

        We can imagine the concept of “ reading ahead ”through the flow of a simple diagram. Below is an example of such diagram and its explanation.




Step 1: The CPU will go to cache and check if it can retrieve data from there.

Step 2: When there is no data at the cache, the CPU will go to RAM next and retrieve one part of
             the data from there.

Step 3: The cache control works by retrieving other parts of the data needed by the CPU and
             moving them to the cache.

Step 4: The data is passed to the cache.

Step 5: Now the CPU will once again go to cache and try to retrieve data from there.

Step 6: The other parts of the data needed by the CPU is retrieve from cache without needing to
             go to RAM and thus, shortening the data access time.


Virtual Memory

        Virtual memories are fake memories where the computer uses a process called “swap space” to make as if the memory appears to have a larger capacity. Swap space works through the concept of when there is no more memory space left in your RAM, it will swap some memory space with the secondary memory.


There are 2 types of memory which are:

(a) Volatile memory (RAM)

(b) Non-volatile memory (Flash Memory, Optical Disk, Magnetic Disk)





Thanks for reading, please leave your comment here.

MIMD

Multiple Instruction, Multiple Data Stream- MIMD

->Set of processors
->Simultaneously execute different 
     instruction sequences
->Different sets of data
->SMPs, clusters and NUMA systems

Hardware and Software

->Hardware

Serial: e.g., Pentium 4

Parallel: e.g., quad-core Xeon e5345

->Software

Sequential: e.g., matrix 
  multiplication

Concurrent: e.g., operating system

->Sequential/concurrent software 
     can run on serial/parallel  
     hardware

Challenge: making effective use of 
  parallel hardware



Multiprocessor
Architectures: Shared 

Memory



Shared memory multiprocessor
Hardware provides single physical
address space for all processors
Synchronize shared variables using locks
Memory access time
SMP/UMA (uniform) vs. NUMA (nonuniform)


-Muhammad izzuddin bin abdul alim
-B031210175



Thanks for reading, please leave your comment here.

Load and Store word

Load and Store Operation

:) Memory Access

-> To transfer a word of data, we need to specify two things:
     
     1.Register : Specify the register by number or symbolic name.
     2.Memory Address : Specify the address by supplying a pointer to a memory address. A memory can be
                                      visualized as a single-dimensional array. The value of the memory address can be
                                      icremented using offset value.

-> In MIPS, data transfer take place between:

     1. Memory -> Register
     2. Register -> Memory

-> The only instruction that access memory are loads and stores. MIPS does this by using pointers to 
     locations in memory where data is stored. When we store a value we must specify the location.

->The value of an address tells where our values are in bytes (8 bit increments), however in MIPS, the 
     memory address must be word aligned.

:) Data Transfer: Memory to register

->To specify a memory address to copy from, we need to specify two things:
    * A register containing pointer to a memory
    * A numerical offset (in bytes)

-> The effective memory address is the sum of these two values.

-> lw is Load Word, where 32 bits or one word are loaded at a time.

-Muhammad Izzuddin Bin Abdul Alim
-B031210175

Thanks for reading, please leave your comment here.

Type of external memory


Type Of External Memory

                Hi there, there are 3 type of external memory :
J Magnetic Disk
                e.g.:RAID
J Optical Disk
                e.g.:-CD-ROM
                        -CD-R
                        -CD-RW
                        -DVD
J Magnetic Tape
               
                What Is the different between CD-R and CD-RW?
J CD-R : Files only can be save once and after that it only can be read
JCD-RW: Can be use as flash disk . Which mean files and data can be save and edit.

Access Method
                There are 4 type of access method:
J Sequential
-Start at the beginning and read through in order and access time depends location and previous location
-eg:Tape
J Direct
-Individual block as unit address and access is by jumping to vicinity and access time depends on location and previous location
-eg:Disk
J Random
-Individual address identify location exactly and access time is independent of location and previous location
-eg:RAM
J Associative
-Data is located by a comparison with contest of a portion of the store and access tie is independent of location and previous location
-eg:cache

Performance
                3 component in performance:
J Access Time
J Memory-Cycle time
J Transfer Rate

-Muhammad Izzuddin bin Abdul Alim
-B031210175

Thanks for reading, please leave your comment here.

MISD

MISD

     MISD is the acronym for Multiple Instruction, Single Data stream which is a type of parallel computing architecture. The concept is that several processors performs different operations on a sequence of data. This type of parallel computing belong to the pipeline architecture. There aren't many examples that uses this type of parallel computing but one such example are the space shuttle flight control computers.




Thanks for reading, please leave your comment here.

MIPS logic operation

Arithmetic and Logic Operations

Intro

    All arithmetic operation in MIPS uses R-Type instruction format where all 3 operands are registers which consists of the destination (rd), source (rs) and target (rt). In arithmetic and logic operations, small constants are used frequently and made up 50% of operands. For example, ' a = a +5 ' or ' a > 5'.

    There are 3 ways of specifying constant in MIPS:

  •  Store in memory and load them.
  •  Using register $0 that load constant zero.
  •  Using immediate values. 

Logic Operation

1. Addition

     As stated it uses the the R-type instruction format which consists of the opcode and the operands. It has several opcodes such as :

(a) add = addition (R-Type)
(b) addi = add immediate (I-Type)
(c) addiu = add immediate unsigned number (I-Type)
(d) addu = add unsigned number (R-Type)

    For addi and addiu, it doesn't use the R-Type format but instead uses the I-Type format where we use a constant replacing the target(rt) register in R-Type.

Extra Note: 
  • Signed arithmetic are real numbers where  (+)ve and (-)ve counts represented in a 32-bit 2's complement binary digit. They may generate an overflow.
  • Unsigned arithmetic are numbers that are always (+)ve and will never generate an overflow.

2. Subtraction

     Just like addition we also uses the R-Type and the I-type format in subtraction. Examples of instructions are :

(a) sub = subtraction (R-Type)
(b) subi = sub immediate (I-Type)
(c) subu = sub unsigned (R-Type)


3. Multiplication & Division

   For Multiplication and division logic operation, the results obtained may be larger than 32-bits. Thus, we use 2 special 32-bits registers designed specifically for multiplication and division operations. These are called (hi = holds the upper 32-bits number) and (lo = holds the lower 32-bits number).

  Example of MIPS instruction are: 

  (a) mult, $s1, $s2 (multiply register s1 and s2)
  (b) div, $t1, $t2 (divide register t1 by t2)

  To use the hi and lo we uses the instruction code " mflo " or " mfhi ". Examples are:

  (a)  mult, $s1, $s2   # This is the operation 
        mfhi $s3            # Moves the upper 32-bits number of the product into register s3
        mflo $s4            # Moves the lower 32-bits number of the product into register s4

   This is the same for division except for " lo " in division it gets the quotient and for " hi " in divison it gets the remainder. 

  (b)  div, $t1, $t2       # This is the operation
         mflo $t3             # Puts the quotient of the product into register t3
         mfhi $t4             # Puts the remainder of the product into register t4    


4. Shift operation

   There are 3 basic shift operations which are:

   (a) sll ( Shift Left Logical = shifts the 32-bits number to the left and fill up the empty spaces with 0's )
   
     Example:
     Shift left by 4-bits

      1001 0001 1011 1100 0000 1010 0000 1111
                                becomes
      0001 1011 1100 0000 1010 0000 1111 0000

      * The 4-bits number (1001) vanish as we shifted to the left by 4-bits and we add four 0's the fill up the      
         empty space left in the 32-bits number. 

  (b) srl ( Shift Right Logical = shifts the 32-bits number to the right and fill up the empty spaces with 0's)
      
       Example:
       Shift right by 4-bits

         1111 0000 1010 1001 1001 1010 0000 1111
                                      becomes
         0000 1111 0000 1010 1001 1001 1010 0000

       *  This time the 4-bits to the right(1111) vanished as we shifted the number to the right. The empty   
           space is fill with 0's as usual.

  (c) sra (Shift Right Arithmetic = shifts right nad fills empty space with sign extending)

       Example: 
       Shift right arithmetic by 4-bits (sign +)

          1010 0101 1001 1111 1010 0101 0110 1010
                                       becomes
          0000 1010 0101 1001 1111 1010 0101 0110

       * The sign (+) extend means the empty spaces is filled with 0's.

        Example:
        Shift right arithmetic by 4-bits (sign -)
 
           1010 0101 1001 1111 1000 0101 0110 0000
                                         becomes 
           1111 1010 0101 1001 1111 1000 0101 0110 

        * The sign(-) extend means the empty spaces is filled with 1's.


5. logical operation 

    There are 2 types of basic MIPS shift instruction:

    (a) AND = outputs is 1 if and only if both inputs are 1.
    (b) OR = outputs is 1 if at least one of the inputs is 1.
 


 (a) AND 
      
      For AND logical operators we can assume that the 2 numbers in each register multiply each other to get    
      the product. Example:

      and, $s0, $s1, $s2     # Multiply register s1 and s2 and put the results in in s0.

      Let $s1 = 0000 0000 0000 0000 1111 1111 1111 1111
      Let $s2 = 1111 1111 1111 1111 0000 0000 0000 1000

     Thus, the result in $s0 will be = 0000 0000 0000 0000 0000 0000 0000 1000


Extra Note:
  • AND logical operators also uses the R-Type and the I-Type instruction format such as:
          (1) and (R-Type)
          (2) andi (I-Type)



(b) OR

      For OR logical operators we can assume that the 2 numbers in each register add each other to get the   
      product. Example:

      or, $t0, $t1, $t2   # Add register t1 and t2 and put the result in t0

      Let t1 = 0000 0000 0000 0000 0000 0000 0000 1010
      Let t2 = 1111 1010 0110 1111 0001 0000 1100 1010

      Thus, the result in $t0 will be = 1111 1010 0110 1111 0001 0000 1101 0100


Extra Note:
  •  OR logical operators uses the R-Type and I-type instruction formats just like AND.




 


 
      

Thanks for reading, please leave your comment here.

RAID

What is RAID? RAID is a technology that is used to increase the performance and/or reliability of data storage. The abbreviation stands for Redundant Array of Inexpensive Disks. A RAID system consists of two or more disks working in parallel. These disks can be hard discs but there is a trend to also use the technology for solid state drives. There are different RAID levels, each optimized for a specific situation.

Today, i want to share some video that i find interesting and give well understanding about RAID. Enjoy the video!







What about RAID levels 2, 4, 6?

These levels do exist but are not that common, at least not in prepress environments. This is just a simple introduction to RAID-system. You can find more in-depth information on the pages of wikipedia or ACNC

I prefer you to read ACNC website. Try it!

By:

ABDUL WAFIY BIN SUZLY
B031210108
930408-01-5427

Thanks for reading, please leave your comment here.

SISD

Salam and good morning everyone! This is my simple note about multiple processor. But, i only upload until SISD. What is SISD? You better read it yourself start from here. :) It is pretty simple!







By:


ABDUL WAFIY BIN SUZLY
B031210108
930408-01-5427

Thanks for reading, please leave your comment here.

SIMD



SIMD

- Single Instruction, Multiple Data
- class of parallel computers in Flynn's taxonomy
- describe computers with multiple processing elements that perform same operation
  on multiple data simultaneously
- applicable on common task
      > adjust pictures
      > adjust volume
- improve performance of multimedia use
- type of processor is vector processor / array processor

1.0 Vector Processor

- a central processing unit (CPU) that implements an instruction set
      > operate on one-dimensional array of data
- greatly improve performance on a certain workload
      > numerical simulation and similar task

2.0 Advantages

- process multiple data elements in a single instruction
      > improve performance
- conduct mathematical operation very quickly

3.0 Disadvantages

- not all algorithm can be vectorized
- large register file
      > power consumption increase
      > chip area increase
- compiler don't generate SIMD instruction from typical C program
      > requires human labor 

Thanks for reading, please leave your comment here.

MIPS - Format & Addressing Mode (Wafiy)



now...we introduce you all with a video from one of our admin....comorach/wafiy suzly....
he cannot upload due to some technical problem...






ABDUL WAFIY BIN SUZLY
B031210108
930408-01-5427

Thanks for reading, please leave your comment here.

MIPS - Intro

sorry for the long wait all our followers...
we have been busy with other projects...
and now we are back with some interesting notes...
hope you all will like it... =)
MIPS

- its acronym is Microprocessor without Interlocked Pipeline Stages
- reduced instruction set computer (RISC) instruction set computer (ISA) 
- it has 32-bit general purpose registers

1.0 Memory Allocation

-MIPS processor typically divided its memory by 3 parts.....
     i) text segment : hold machine language code for instructions in 
                                    the source file (user program)
    ii) data segment : holds  the data that the program operates on. 
                                   : divided with 2 parts 
           > static data : the size data that allocated is not changes 
                                     when a program access them
           > dynamic data : the data is allocated and deallocated 
                                           by the program executes
   iii) stack segment : resides at the top of user address space

2.0 Register

- 32-bit general purpose registers (0 - 31)
$0 always has zero value
- $at ($1), $k0 ($26) and $k1 ($27) are reserved 
      > for assembler and operating system 
      > not be used by the user programs and compiler
- $a0 - $a3 ($4 - $7) used to pass 1st 4 arguments to routines
- $v0 & $v1 ($2 - $3) used to return values from functions
- $t0 - $t9 ($8 - $15, $24, $25) are caller-saved registers 
      > hold temp values 
- $s0 - $s7 ($16 - $23) called as callee-saved registers
      > hold long-lived values that should be preserved across calls function
- $gp ($28) a global pointer 
      > point to the middle of 64k block of memory in static data segment
- $sp ($29) stack pointer
      > point last location of stack
-$fp ($30) is a frame pointer
- $ra ($31) has return address written jal instruction

3.0 System Call

how a program requests a service from an operating system's kernel  
- include :- 
      > hardware related services (e.g. accessing the hard disk)
      > creating and executing new processes 
      > communicating with integral kernel services (like scheduling)
- provide an essential interface between a process and the operating system

System call function
      
Service
System call code
Arguments
Result
print_int
1
$a0 = integer

print_float
2
$f12 = float

print_double
3
$f12 = double

print_string
4
$a0 = string

read_int
5

$v0 = integer
read_float
6

$f0 = float
read_double
7

$f0 = double
read_string
8
$a0 = buffer
$a1 = length

sbrk (allocate memory)
9
$a0 = amount
$v0 = address
exit
10


print_char
11
$a0 = char

read_char
12

$v0 = char

4.0 Assembly Language 

- made up of plain text file 
- made up of 2 type statements 
     i) assembler directive
          > tell assembler how to translate a program 
          > cannot be translated into machine code 
     ii) executable instruction 
          > a program will be translated into machine code 
          > sometimes called as program code
- contain 4 columns

Column 1
Column 2
Column 3
Column 4
              
1) Column 1 : Label (Optional)

- mark specific point in a program code

2) Column 2 : Opcode (Operation Code)

- basic operation and format of an instruction

3) Column 3 : Operand 

- contain 
     i) registers 
     ii) shift amount
     iii) label to jump into 
     iv) constant
     v) address

4) Column 4 : Comment 

- have ' ' on a line 
- MIPS simulator will skip this comment

Thanks for reading, please leave your comment here.

ASSIGNMENT2 Memory - Internal & External




Assalamualaikum and hello to all viewers....
Today we have upload a video on memory in CPU...
hope you all will enjoy it.....




p/s:sorry for the quality....
      *don't forget to follow our blog.......my mistake there -,-"


Thanks for reading, please leave your comment here.

Boolean Algebra

Assalamualaikum. Hey there! Today in this entry, i will talk about Boolean Algebra. What is boolean? Boolean Algebra is actually founded by George Boole, an english mathematician in 1840s. So, enough with that historical story. COA is actually more harder and stressful to handle rather than history.

But if we study hard and we know the ’trick’, it will be quite easy. So, that is it, some introduction about boolean. J

In Boolean world, there are no such thing as ‘ ½’, ‘2/3’, ‘-1’ and so on. But it is come with True or False, or usually we use ‘0’and ‘1’. Let us start with Boolean identities first.




Another approach to express the logic function with logic equations:


  • OR operator is written as +, as in A + B
  • 0 +1 = 1 ------- 1 + 0 = 1
  • AND operator is written as & , as in A & B
  • 0 & 1 = 0 -------1 & 0 = 0
  • NOT (inversion) operator is written as – or  , as in A’ 
  • 0’=1 ------ 1’= 0

Still get confused? Ok, i hope that u just do not feel boring.. 



Do not worry because..



Let me introduced you some video that might help you a lot about this topic. I have checked all of this video and it is easy to understand and fast to learn. :)

Actually, I want to make my own video about boolean, but my english is quite not good -_-. 

Boolean Algebra AND/OR/NOT




Boolean Algebra: Basic Law and Rules


Boolean Algebra: Basic Problem




Basic Problem Continued..


That is all for this post. Do not forget to comment. Bye!

by:

ABDUL WAFIY BIN SUZLY
B031210108
930408-01-5427

Thanks for reading, please leave your comment here.

Copyright of Comorarch group.