overview
Instruction
The Jump Register instruction causes the PC to jump to the contents of the first source register.
syntax
1 | JR $first source register's address |
take a sample: JR $13
binary expression
1 | |000000|01101|00000|00000|00000|001000| |
length
- Opcode: 6
- rs: 5
- rt: 5
- rd: 5
- shamt: 5
- funct: 6
length_all = 6+5+5+5+5+6 = 32
if we make $13
register’s value equals to 789 in decmical, so we can find some information on $13
Register’s Address | Register’s Address (Binary) | Register’s Value | Register’s Value (Hexadecimal) |
---|---|---|---|
$13 | 01101 | 789 | 00000315 |
procedure
- This simple datapath is of a single-cycle nature. The instruction begins with the PC. PC value set to 00000114H
- The PC’s value, as well as a fixed value necessary to increase the PC by one cycle are passed into the ALU. The address of the instruction to be executed is passed to the IM.
- The Adder performs an arithmetic add operation to determine the next PC value. On the other hand, the instruction is decoded by the IM.
- IM: Fetching instruction from 00000114H:
000000 01101 00000 00000 00000 001000B
- Adder: Add 00000004H to 00000114H.
- The decoded instruction is split into different corresponding segments and sent to the RF. The function bits are sent to the ALU Control, and the opcode is sent to the Control Unit.
- The RF retrieves the data from the register required by the instruction. The CU identifies the type of instruction it is via the opcode.
- Control Unit: Opcode 000000B, Instruction: R type
- Read $13(01101B)’s value of 000001CDH
- The Adder sends the new PC value to the MUX. The RF sends the read data to the ALU and the MUX.
- new PC: 00000118H=00000004H+00000114H
- JRsel = 1B
- From the JRsel signal sent by the CU, the MUX selects the input from the RF to be the next PC value.
- The MUX sends the new PC value to the PC.
source netdoor
https://www3.ntu.edu.sg/home/smitha/fyp_gerald/jrInstruction.html
This source is very nice and interest. It make the abstract knowledge animated.