ALU Design

Functional Specification of the ALU

ALU Control Lines (ALUop) Function

A One Bit ALU

This 1-bit ALU will perform AND, OR, and ADD

 

A One-bit Full Adder

 

 

 

 
 

A 4-bit ALU

 

What About Subtraction?

(A - B) is the same as: A + (-B)
2's Complement: Take the inverse of every bit and add 1
Bit-wise inverse of B is !B:
A + !B + 1 = A + (!B + 1) = A + (-B) = A - B

Overflow and Carry


 

Zero Detection

Zero Detection Logic is just a one big NOR gate
Any non-zero input to the NOR gate will cause the output to be zero

The Disadvantage of Ripple Carry

This adder is called a "Ripple Carry Adder"
The carry bit may have to propagate from LSB to MSB
Worst case delay for a N-bit adder: 2N-gate delay

Carry Lookahead

Theory therefore: Substituting Cin1 into Cin2: Now define two new terms: We can rewrite:

A Partial Carry Lookahead Adder