Jordan University of Science and Technology
Department : Computer Engineering
Digital Design Lab CPE 253
Section : Thursday (2.15-5.15)
Lab #4 : Adder and Subtractors
PreLab & PostLab
Prepared by :
1) Fadi Hasayen { 20042171030 }
2) Sameer Al-Duwairi { 200421710 }
LAB 4: Adders and Subtractors Preparation
Half-Adder
Q1. Design a half-adder circuit using one XOR gate and two NAND gates.
** Suppose A and B are inputs for Half-Adder and S and Cout are outputs:
Half Adder
Half Adder Sum Carry
Input
A B S Cout
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
We Find :
S = A'B + AB' = A B
Cout = AB
Full-Adder
Q2. Design a full-adder circuit using the two ICs (7486 and 7400).
** Suppose X and Y and Cin are inputs for Full-Adder and S and Cout are outputs:
Let Cin = Z
Full Adder
Full Adder Sum Carry
Input
X Y Z S C
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
** By Applying K-maps to find S Equation :
yz
00 01 11 10
x
0 0 1 0 1
1 1 0 1 0
S = x'y'z + x'yz' + xy'z' + xyz = z' ( x'y + xy' ) + z ( x'y' + xy )
= z' (x y) + z (x y)'
=x y z
** By Applying K-maps to find Cout Equation :
yz
00 01 11 10
x
0 0 0 1 0
1 0 1 1 1
Cout = xy + xz + yz = x (y+z ) + yz
** This Circuit for : S = x y z & Cout = x (y+z ) + yz ( z = Cin )
** and this Circuit for : S = x y z & Cout = (x y)z + xy ( z = Cin )
Ripple Adder
Q3. An n bit adder with carry propagation can be formed by cascading n full adders as
shown in Figure 1, which depicts a 4-bit adder. Build a 2-bit Adder using the two ICs,
7486 and 7400.
** From the previous question (Q2), we get the S0 & Cout 0 :
S0 = x y Cin ( Let Cin = z )
S0 = x y z
And
Cout 0 = (x y)Cin + xy = (x y)z + xy
** Now the equation of S1 & Cout 1 are :
S1 = a b Cout 0
And
Cout 1 = (a b)Cout 0 + ab
Parallel Adder
Q4. The IC type 7483 or 74283 is a 4-bit parallel adder. The pin assignment is shown
below. The two 4-bit binary number inputs are A1 through A4 and B1 through B4, with
C0 as the input carry. The 4-bit sum output is composed of S1 through S4, with C4 as the
output carry. Test the 4-bit binary adder 7483 or 74283 by connecting the two 4-bit inputs
to two sets of 4 toggle switches, and the input carry to a separate toggle switch. (If you
don’t have enough toggle switches on your board, you can fix some of the inputs to either
Logic-0 or Logic-1.) The five outputs are applied to the available LED’s.
Test your circuit for different combinations of inputs (A & B) and C0s.
Adder-Subtractor
Q5. The subtraction of two binary numbers can be performed by taking
the 2's complement of the subtrahend and adding it to the minuend.
The 2's complement can be obtained by taking the 1's complement
and adding 1. To perform A-B, we complement the four bits of B and
add them to the four inputs of A, and add 1 to the sum using the input
carry.
Design an adder-subtractor circuit by using IC 7483 or 74283 and XOR
gates, such that when the mode select M=1, the input carry equals to
1 and we perform the subtraction operation (AB), whereas when the
mode select M=0, the input carry is equal to 0 and we perform the
addition operation (A+B).
Show that during addition, the output carry is equal to 1 when the sum
exceeds 15. Also show that when A¡ÝB the subtraction operation gives
the correct answer, (A-B), and the output carry is equal to 1. But when
A<B, the subtraction gives the 2's complement of
(B-A) and the output carry is equal to 0.
LAB 4: Adders and Subtractors PostLab
Q1. Design a comparator circuit that compares between two 4- bit
input numbers using 4-bit full adder chip (74283)and 7404 and 7408
IC's.
Q2. A Half Adder (HA) takes 2 inputs A and B and computes the sum
bit S and carry bit Co from them. Show how a FA can be constructed
form HA’s.
Q3. Implement 1-bit full adder using 4x1 MUX’s. Use two 4x1 MUX’s
for (Ci+1, Si).
****Objectives and Conclusions****
- Objectives:
In this experiment we try to:
a. How to design Half Adder and Full Adder and Ripple Adder and Parallel Adder
and Adder Subtractors and how to use the IC’s for every one.
b. How to design Half Adder using XOR gates and NAND gates and how to design
Full Adder using MUX’s .
c. How can we implement the subtraction using XOR gate and 7483 IC.
d. How can we compare between two 4-bit input.
- Conclusions:
a. We can design Half Adder using one XOR gate and two NAND gates and we
can design Full Adder using two MUX’s.
b. We can design Adder – Subtractors using 4008 IC and use XOR gates for
subtract operation.
c. We can design Parallel Adder using 4008 IC , for adding two 4-bit binary
number.
d. We can design Ripple Adder using two ICs ( 7486 & 7400 ) which add two 2-bit
binary number with Cin.
e. We learned how to use and deal with chips like:
7400 ( 2-Input NAND Gates ).
7486 ( 2-Input XOR Gates ).
7483 or 74283 or 4008 ( Parallel Adder ).