SRISC3 CPU

ALU Instructions

operationR-formatI-format
addaddaddi
subtractsubsubi
ANDandandiandhi
ORororiorhi
XORxorxorixorhi
NORnor

pseudo-instruction

addi  rB ← rA + se(immed)

Immediate logic operations use zero extension, not sign extension for the immediate operand.

Datapath

ALU Operations

controloperation
000add, signed
001subtract, signed
010add, unsigned
011subtract, unsigned
100AND
101OR
110XOR
111NOR

Input Multiplexer

muxoperation
00db (from register file)
01immedse (sign-extended)
10{zero,immedse[15:0]}
11{immedse[15:0],zero}

Opcode Decoding Maps


wire [1:0] muxi_control = (iflag? muxc: 2'b00);
wire [2:0] alu_control = (iflag? icontrol: rcontrol); 

I-Format


R-Format

typeopmuxictl
addi0x0401000
andi0x0c10100
ori0x1410101
xori0x1c10110
andhi0x2e11100
orhi0x3411101
xorhi0x3c11110

typeopxrctl
nor0x06111
and0x0e100
or0x16101
xor0x1e110
add0x31000
sub0x39001


Maintained by John Loomis, last updated 22 October 2008