- op (6 bits) = operation code
- rs (5 bits) = source register
- rt (5 bits) = other source register
- rd (5 bits) = destination register
000000 00000 00000 00000 00000 0000000
op rs rt rd shamt funct
- shamt (5 bits) = shift amount (usato dalle istr di shift)
- funct (6 bits) = additional opcode (per differ. le istr. sull'ALU [add, sll, ..] che hanno lo stesso opcode)
000000 00000 00000 0000000000000000
op rs rt offset/immediate
- off/imm (16 bits) = immediate value / address offset
000000 0000000000000000000000000
op jump address
- jmp addr (26 bits)
lui $t0, 1010101010101010
ori $t0, $t0, 1010101010101010
-
Register addressing
operando = registro
-
Base addressing
operando = cost($reg)
-
Immediate addressing
operando = costante
-
PC relative addressing
operando = PC + cost
-
Pseudodirect addressing
operando = 4 bit PC + 26 istr.
-
EXOR ⊕
!x · y + x · !y
-
NOR
!(x + y)
0 00000000 0000000000000000000000
segno exp(8 bits) mantissa (23 bits)
decimale = segno * 2^(exp - 127) * mantissa
mantissa = (1 + bit[22] * 1/2 + bit[21] * 1/4 + ... + bit[0] * 1/8388608)
ALU control lines function
000 and
001 or
010 add
110 subtract
111 set-on-less-than
- 00: addition (load & store word)
- 01: subtraction (branch on equal)
- 10: operazioni a seconda del valore nel campo funct (istruzioni di tipo R)
-
RegDest
Sorgente del registro di dest. per l'operazioni
-
RegWrite
Abilita la scrittura di un registro
-
ALUsrc
Sorgente del secondo operatore nell'ALU, può essere un registro o parte dell'istruzione (tipo una costante)
-
PCsrc
Sorgente del PC (se è un incremento normale o è risultato di un jump/branch)
-
MemRead/MemWrite
Lettura/Scrittura dalla memoria
-
MemtoReg
Sorgente dei contenuti da scrivere nel registro
- OP: 2
- I 2 bit meno significativi sono sempre 0
- Immediate field: bits 2-27
- Current PC: bits 28-31