S-type
Last updated
Last updated
S-type instructions are used for store.
Mem[Reg[rs1] + offset] <- Reg[rs2]
Immediate in two parts
Can't have both rs2 and immediate in same place as other instructions
RISC-V design decision is move low 5 bits of immediate to where rd field was in other instructions - keep rs1/rs2 fields in same place
register names more critical than immediate bits in hardware design
Just need a 5-bit mux between two positions where low five bits of immediate can reside in instruction
Other bits in immediate are wired to fixed positions in instruction
sw
to datapathHow to control the amount of bytes to write to memory?