Major Component
Instruction Memory , Program Counter
|
Component For Arithmatic & Logic Function
we use all instruction read
two registers, perform an ALU operation and write back the result.Arithmetic logical instructions are called R-type instructions. This instruction class considers add,
sub, slt, and and or . The
32 registers are stored in Register File. To read a data word two inputs and outputs are needed. The inputs are 5 bits wide and specify the register number to be read, the
outputs are 32 bits wide and carry value of the register.To write the result back
two inputs are needed: one to specify the register num-ber and one to supply
the data to be written.Registered ALU And Datapath R-type Instruction |
Load Word(lw) And Store Word(sw)
Two
elements are needed to implement the sw- and lw-instructions:
i.Data Memory
ii.Sign Extension Unit
sw and lw instruction compute a memory address by adding a register value for 16bit signed offset field.The instruction offset field must signed extended from 16 to 32 bits simply by concatenating the sign bit 16 times to the original value
Branch on equal instruction
Instruction
has 3 operands, 2 registers that are compared for equality, and a 16-bit
offset are used to compute the branch target address relativeto the branch
instruction address.
This datapath must do 2 operations:
i.compare the register
contents
ii.and compute the branch target
2 things must be done:
i.The address field of the branch instruction must be sign extended from 16 bits to 32 bits.
ii.must be shifted left 2 bits so that it is a word offset.
Jump Instruction
Jump instruction is similar
to the branch instruction, but computes the target PC differently.The
destination address for a jump is formed by concatenating the upper 4 bitsof the current PC + 4 to the 26-bit address
field in the jump instruction
By muhammad Yusuf Bin Ahmad Shah Ruddeen
No comments:
Post a Comment