Microlecture 8
Microlecture 8
Edition
The Hardware/Software Interface
Chapter 4
The Processor
A
Y
B
◼ Arithmetic/Logic Unit
◼ Multiplexer ◼ Y = F(A, B)
◼ Y = S ? I1 : I0
A
I0 M
u Y ALU Y
I1 x
B
S F
Clk
D Q
D
Clk
Q
Clk
D Q Write
Write D
Clk
Q
Increment by
4 for next
64-bit instruction
register
◼ Instruction fields
◼ opcode: operation code
◼ Rm: the second register source operand
◼ shamt: shift amount (00000 for now) used in
shift instructions
◼ Rn: the first register source operand
◼ Rd: the register destination
◼ Load/store instructions
◼ Can not use R-Type instruction format as the 5-bit field is too
small to be used for the address as the largest constant would
be 31
◼ Rn: base register
◼ address: constant offset from contents of the base register (+/-
32 doublewords)
◼ Rt: destination (load) or source (store) register number
◼ Design Principle 3: Good design demands good
compromises
◼ Different formats complicate decoding but allow 32-bit
instructions uniformly
◼ Keep formats as similar as possible
Chapter 2 — Instructions: Language of the Computer — 11
Load/Store Instructions
◼ Read register operands
◼ Calculate address using 9-bit offset
◼ Use ALU, but sign-extend offset to 64-bit sign-extend. Sign-extend is to increase
the size of a data item by replicating the high-order sign bit of the original data
item in the high order bits of the larger, destination data item.
5 10000ten
6 bits 26 bits
◼ CB-type
◼ CBNZ X19, Exit // go to Exit if X19 != 0
181 Exit 19
8 bits 19 bits 5 bits
Sign-bit wire
replicated