Arithmetic: - Performance (Seconds, Cycles, Instructions) - Abstractions
Arithmetic: - Performance (Seconds, Cycles, Instructions) - Abstractions
Arithmetic: - Performance (Seconds, Cycles, Instructions) - Abstractions
operation
a
32 ALU
result
32
b
32
Numbers
MIPS
Effects of Overflow
operation op a b res
a result
b
Different Implementations
a
cout = a b + a cin + b cin
Sum
sum = a xor b xor cin
b
CarryOut
• How could we build a 1-bit ALU for add, and, and or?
• How could we build a 32-bit ALU?
CarryIn Operation
a0 CarryIn
Result0
ALU0
b0
CarryOut
Operation
CarryIn
a1 CarryIn
a Result1
0 ALU1
b1
CarryOut
1
Result
a2 CarryIn
Result2
2 ALU2
b2
b
CarryOut
CarryOut
a31 CarryIn
Result31
ALU31
b31
Binvert Operation
CarryIn
a
0
1
Result
b 0 2
CarryOut