Wednesday, December 4, 2013

Building A Datapath

BUILDING A DATAPATH


DATAPATH COMPONENTS


---> Common to all instructions:
          – Instruction memory
          – PC and its update

---> Datapath of R-R type instructions (e.g. ADD $t1, $t2, $t3)
          – ALU
          – Register set

---> Datapath of memory-reference instructions (e.g. lw $t1, offset($2) )
          – ALU (for address calculation)
          – Register set
          – Sign extension unit
          – data memory

 ---> Datapath for a branch inst. (e.g. beq $1, $2, offset)
          – Sign extension + 2bit shifter
          – Reg
          – Adder
          – ALU (zero output)




INSTRUCTION MEMORY AND PC UPDATE






Two state elements are needed to store and access instructions and an adder is needed to compute the next instruction address.




PC Datapath and Instruction Fetch

  • NextPC = PC + 4

To execute any instruction, we must start by fetching the instruction from Instruction Memory.

•PC feeds address of current instruction to Instruction Memory.

•Instruction memory read the address and fetch the instruction stored in the memory.

•PC add 4 to hold the next instruction address.



BY AINI KHAIRANI BT AZMI

No comments:

Post a Comment