The MIPS lw instruction uses the I-format: a destinationregister is placed in the rt field, and a base register in the rsfield and a 16-bit immediate address are used to calculate thememory address to be read.
(Since answers are already given, please explain)
I-format:
Referring to Figure, answer the following questions regardingpipeline execution of the lw instruction.
(1) Which should be the second input to the ALU?
A. Read register 2 ・ Sign-extended immediate
(2) Which should be the write register number?
A. Instruction (bits 20-16) ・ Instruction (bits 15-11)
(3) Where should the write data input come from?
A. ALU result ・ Read data from Data memory
(4) Referring to Figure 4.48 (p.360), answer the control valuesto be stored in ID/EX pipeline register when executing the lwinstruction.
PC 4 Address Add Instruction memory IF/ID Instruction Read register 1 Read register 2 Registers Write register Wate data Instruction (15-0) Instruction (20-16) RegWrite Instruction (15-11) 16 Road data 1 Read data 2 Sign- extend 32 ID/EX Shift left 2 ALUSIC SER 6 M AdgAdd result RegDst ALU control ALUOP Zero Add ALU resull EX/MEM Branch Address Wate data PCSrc MemWrite Data memory MemRoad Read data MEM/WB MomtoReg
A. Signal name RegDst ALUSrc: RegDst RegWrite ALUSrc 1 Effect when 0. Write register = rt field (bits 20:16) second ALU operand= register2 Write data = ALU result MemtoReg: RegWrite: None MemRead: None MemWrite: None MemRead MemWrite Memto Reg Effect when 1 Write register =rd field (bits 15:11) second ALU operand = immediate Write data comes from Data memory Write register is written. Data is read from Data memory. Data is written to Data memory.
The MIPS lw instruction uses the I-format: a destination register is placed in the rt field, and a base register in the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am