Sunday, 16 December 2012

Topic 5 subtitle 2 : Data transfer: Memory to register

Data Transfer:Memory to Register

Memory or RAM is located external within the Central Processing Unit(CPU).Data has to be loaded into a CPU register from memory before the CPU can process it. RAM is much slower than registers.
Registers are memories located within the Central Processing Unit(CPU).They are few in number (there are rarely more than 64 registers) and also small in size,typically a register is less than 64 bits in size.
  • To definite a memory address to copy form , we need to specify two things:
            - A Register consist of a pointer to a memory.
            - A Numerical offset in bytes. 
  •  An able memory address is the sum of these two values.
  •  For Example:-
                   4($t0) ;
               where $t0 =  1000
   ->The memory address pointed to by the value in $t0 , then need to add 
         8 BYTES.Therefore,the effective address is 1004. (1000+4)

  • lw is Load Word , meaning that values are loaded from memory address into registers and stored from registers to memory address.Where 32 bits or one word are loaded at a time.

  • Load instruction syntax is as follow:-Examples:
                                              lw $t1 , 4 ( $t2 )
-> Load $t1 with the word at memory address 4 + address value stored in register $t2.
-> $t2 is called the base register , while 4 is called offset.



LIM ZHEW SHENG
B031210379









1 comment: