I am now constructing a simple risc-v processor with the help of logisim. Regarding the I-type instruction:
I know that the instruction is defined as follow:
[0:6] => opcode (to determine what ALU needs to calculate)
[7:11] => rd (destination register to store the answer)
[12:14] => also part of opcode
[15:19] => rs1 (source register storing the value to be added with an external immediate value)
[20:31] => imm (the immediate value)
As the architecture is going to be in 32-bit, the 12-bit immediate value needs to undergo sign extension before being added with the content inside rs1. So the place I got confused is which end of "imm" locates the most significant bit (20th bit / 31st bit)?