Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1Learning Outcomes

2Tracing the addi Datapath

Data inst[24:20] still feeds into Reg[], which still outputs R[rs2]. However, control Bsel=1 means R[rs2] data line is ignored.

3Immediate Generator Block

Immediate Generator Block

Figure 1:Immediate Generator Block

3.1I-Type

Immediate Generator Block: I-Type

Figure 2:Immediate Generator Block: I-Type

3.2Multiple instruction formats (e.g., I-Type, S-Type)

Coming soon. We recommend revisiting this section after you have traced through stores in our datapath.

3.3Course Project Details

Table 1:Signals for Immediate Generator. Course project signal names, if different, are in parentheses.

NameDirectionBit WidthDescription
Inputinst (Instruction)32The instruction being executed
InputImmSel3Value determining how to reconstruct the immediate
Outputimm (Immediate)32Value of the immediate in the instruction

Recall that the bits of the immediate are stored in different bits of the instruction, depending on the type of the instruction. The ImmSel signal, which is implemented in the control logic, will determine which type of immediate this subcircuit should generate.

The immediate storage formats are listed below:

Table 2:Immediate Storage Formats from the RISC-V Green Card.

TypeImmSel (default)Bits 31-20Bits 19-12Bit 11Bits 10-5Bits 4-1Bit 0
I0b000inst[31:20]inst[30:20]
S0b001inst[31]inst[30:25]inst[11:7]
B0b010inst[31]inst[7]inst[30:25]inst[11:8]0
U0b011inst[31:12]0
J0b100inst[31]inst[19:12]inst[20]inst[30:21]0

Observations/reminders: