Title: ARITHMETIC AND LOGIC UNIT DESIGN (ALU)
1ARITHMETIC AND LOGIC UNIT DESIGN (ALU)
2ALU Design
- 1-bit Full Adder
- 4-bit Arithmetic circuits
- Add/Subtract/Increament/Decrement Circuit
- Arithmetic and Logic Unit
- Flags
- Carry-Out, Sign, Zero, Overflow
- Shift and Rotate Operations
3Arithmetic and Logic Unit Design (ALU)
- The Arithmetic and Logic Unit (ALU) is a
combinational digital circuit, within the CPU,
responsible for performing all arithmetic and
logic operations. - The operation of the arithmetic unit of the ALU
is based on the Full Adder, a circuit that adds
two bits (A and B) and the carry out generated by
the addition of the two bits in the previous
column. - To design an ALU, for an N-bit processor, we
first design the ALU for 1 bit, and then we
cascade N 1-bit ALUs to obtain the N-bit ALU.
41-bit Full Adder
54-bit Arithmetic Circuit - Four signals (F3, F2,
F1, F0)
- full adders and multiplexers, a 4-bit arithmetic
unit . - Four signals (F3, F2, F1, F0) are used to specify
the function to be performed.
64-bit Arithmetic Circuit - Four signals (F3, F2,
F1, F0) (cont)
- Truth table for the inputs
of the full adders
Control Inputs Control Inputs Control Inputs Control Inputs Output Output
F3 F2 F1 F0 Output Output
0 0 0 0 A B Addition
0 0 0 1 A 1 Increment
0 0 1 0 A 1 Decrement
0 0 1 1 A B Subtraction
0 1 0 0 B A Subtraction
0 1 0 1 B 1 Decrement
0 1 1 0 B 1 Increment
0 1 1 1 - A Negate (Minus)
1 X 0 0 A Complement (Not)
1 X 0 1 A and B And
1 X 1 0 A or B Or
1 X 1 1 A ex-or B Exclusive Or
Control Inputs Control Inputs Control Inputs Control Inputs Output Full Adder Inputs Full Adder Inputs Full Adder Inputs
F3 F2 F1 F0 Output A B Cin
0 0 0 0 A B A B 0
0 0 0 1 A 1 A 0 1
0 0 1 0 A 1 A 1 0
0 0 1 1 A B A B 1
0 1 0 0 B A A B 1
0 1 0 1 B 1 1 B 0
0 1 1 0 B 1 0 B 1
0 1 1 1 - A A 0 1
74-bit Arithmetic Circuit - Two signals - inputs
(F1, F0) 4-bit arithmetic unit, including the
Sign, Zero, and Carry Out flags.
- Full adders and multiplexers, a 4-bit arithmetic
unit . - Two signals (F1, F0) are used to specify the
function to be performed.