















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















ECE 371: Microprocessor Systems Department of Electrical and Computer EngineeringSchool of Engineering, Mathematics, and Science
Purdue University – Calumet
Arithmetic Logic Unit (ALU) • digital system that performs arithmetic, logical, and shiftoperations on two operands.• contains a set of control signals that choose whichoperation to perform• produces certain flag bits required by a microprocessor.^ – Zero (Z) flag^ •^
The pMIPS ALU Operation Codes OperationType
ALUOp[3]
ALUOp[2]
ALUOp[1]
ALUOp[0]
The pMIPS ALU Organization • Decomposed into four sub-components – Boolean Logic Unit (BLU)^ • Performs
AND ,^
OR ,^ XOR
,^ NOR
Performs
SLL ,^
SRL , and
SRA
-^ Performs
SLL ,^
SRL , and
SRA
ADD ,^
ADDU ,
SUB ,^
SUBU
SLT ,^
SLTU
32-bit Boolean Logic Unit OperationType
ALU Operation Code
Description
ALUOp[3]
ALUOp[2]
ALUOp[1]
ALUOp[0]
Bitwise Logical AND (
Bitwise Logical OR (
Bitwise Logical XOR (
Bitwise Logical NOR(
-^ MIPS indicates that signed overflow is never reported (de-asserted)unless performing signed arithmetic.•^ MIPS indicates that carry-out is never reported (de-asserted) unlessperforming any arithmetic operation.•^ New logic for overflow and carry-out:
Overflow Carry Unit (OCU)
OperationType
ALU Operation Code
ModifiedOverflow
ModifiedCarry-Out
ALUOp[3]
ALUOp[2]
ALUOp[1]
ALUOp[0]
Overflow
Cout
Logical^
Comparison
Shift^
Arithmetic
CLACout
ODUOutput
CLACout
CLACout
ODUOutput
CLACout
OperationType
ALU Operation Code
Description
ALUOp[3]
ALUOp[2]
ALUOp[1]
ALUOp[0]
Arithmetic
Unsigned Addition (
2’s Complement Addition (
Unsigned Subtraction (
2’s Complement Subtraction (
ALU Operation Code
Description
ALUOp[3]
ALUOp[2]
ALUOp[1]
ALUOp[0]
Shift Left Logical (
Shift Right Logical (
Shift Right Arithmetic (
-^ After the ASU subtracts, the additional logic requires these signals:•^
Cout:
carry-out from the 32-bit ASU,
-^ SumSign:
sign bit from the 32-bit ASU result
-^ ASign
&^ Bsign
: sign-bits from two input operands
-^ ALUOp[1:0]
: the lower two-bits from the ALU operation code.
-^ When the
ALUOp[1:0] = 00
or^ ALUOp[1:0] = 01
, the ASU is
performing addition, so the output of the CLU should be FALSE. ComparisonType
ALUOp[1:0]
ASign
BSign
SumSign
Cout^
CompareOut[31:0]
x^
x^
x^
x^ 0x
x^
x^
x^
x^ 0x
-^ Focus on Set-On-Less Than (SLT)•^
Must perform signed subtraction (
ALUOp[1:0] = 11
)
-^ Four combinations of operands:^ •^
-^ A >0,
-^ A >0,
-^ A >0,
-^ A <0,
ComparisonType^
ALUOp[1:0]
ASign
BSign
SumSign
Cout
CompareOut[31:0]
Set OnLess Than( SLT )
x^
0x
x^
0x
x^
0x
x^
0x
x^
x^
0x
x^
x^
0x