| operation | R-format | I-format | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| add | add| addi | subtract | sub | subi | AND | and | andi | andhi
| OR | or | ori | orhi
| XOR | xor | xori | xorhi
| NOR | nor | | ||||
| pseudo-instruction |
addi rB ← rA + se(immed)
Immediate logic operations use zero extension, not sign extension for the immediate operand.
| control | operation |
|---|---|
| 000 | add, signed |
| 001 | subtract, signed |
| 010 | add, unsigned |
| 011 | subtract, unsigned |
| 100 | AND |
| 101 | OR |
| 110 | XOR |
| 111 | NOR |
| mux | operation | ||
|---|---|---|---|
| 00 | db (from register file) | ||
| 01 | immedse (sign-extended) | ||
| 10 | {zero,immedse[15:0]}
| 11 | {immedse[15:0],zero}
| |
wire [1:0] muxi_control = (iflag? muxc: 2'b00); wire [2:0] alu_control = (iflag? icontrol: rcontrol);
I-Format |
R-Format | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Maintained by John Loomis, last updated 22 October 2008