3. An Arithmetic Logic Unit (ALU) is a digital circuit that is part of every Central Processing Unit
(CPU). In this problem you will be designing a simplified 4-bit ALU. A 4-bit ALU can perform
operations on at most two 4-bit binary numbers. The functions that the ALU performs can be chosen
using two binary bits $T_1T_0$ as per the table shown below. Input X and Y are both 4-bit wide.
Likewise, output W is 4-bit wide. Hint: Use the circuits designed in questions 2, 3, and 4 above.
Note that the ALU has the following control inputs ($T_1T_0$) which decides what operation the ALU
will perform. Moreover, inputs like, X and Y represent the data to be operated on, while the outputs
are W (result of operation) and status flags ($c$ = carry, $v$ = overflow [2's complement] and $z$ = result
is zero). Clearly show all inputs and outputs (including status flags). (50 points)
Note that upper-case letters (capital letters) represent 4-bit values and lower-case letters (small
letters) represent single-bit values. Single-bit values, $c$, $v$, and $z$ represent carry, overflow and zero
status (flag) bits, respectively.
Status bits (Flag bits)
$T_1T_0$
Operation
Outputs:
affected
00
X plus Y
W = X plus Y
c, v, z
01
X minus Y
W = X minus Y
c, v, z
10
Y minus X
W = Y minus X
c, v, z
11
All zero
W = 0
z
HINT: The above ALU can be designed using three 4-bit 2x1 MUX (MUX-A, MUX-B and MUX-
C), one 4-bit adder/subtractor, and a few logic gates.