You are on page 1of 11

LABORATORY EXERCISE 4

Implementing Binary
Adder and Subtractor
Circuits
Brief Description: Binary adder and subtractor circuits are common examples of
combinational circuits which can be easily designed and implemented.
COMPETENCIES

LABORATORY EXERCISE 4
Implementing Binary Adder and Subtractor Circuits

At the end of this laboratory exercise, you shall be able to:

• build and test half-adder circuit and full-adder circuit;

• build and test half-subtractor circuit and full-subtractor circuit;

• build, test and generate the truth tables for the half-adder, full-adder, half-
subtractor, and full-subtractor circuits.
LABORATORY EXERCISE 4
Implementing Binary Adder and Subtractor Circuits

I - EQUIPMENT AND MATERIALS NEEDED:

1 Solderless breadboard
1 IC 7486 or 74LS86 (Quad Two-Input XOR gate)
1 IC 7404 or 74LS04 (Hex Inverter/Not gate)
1 IC 7408 or 74LS08 (Quad Two-Input AND gate)
1 IC 7432 or 74LS32 (Quad Two-Input OR gate)
1 DC power supply with +5V
1 set of connecting wires
1 wire stripper / cutter
1 DIP Switch
2 47ohms resistor, ¼ watt
2 LEDs

II - PRE-LABORATORY / RELATED THEORY

Binary adders and subtractors are combinational circuits that can perform the
operations of addition and subtraction of binary numbers, respectively. In this lab, we
will study and construct various adder and subtractor circuits.

Half Adder (HA) Circuit

The combinational circuit that adds only two bits is called half adder.

x Half Adder C
(HA)
y S

Full Adder (FA) Circuit

Full Adder (FA) is a combinational circuit that adds three bits. It generates two
outputs: Sum (S) and carry (C). Full adders allow for the addition of multi-bit numbers.
A Designer just needs to provide a way for carries to propagate between bit positions.

x Full Adder Cout


y
(FA)
z (Cin) S
Adder-Subtractor Circuit

The subtraction of two binary numbers can be done 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 (i.e., inverting all the bits) and adding 1. For
example, to perform A – B, we complement the four bits of B, add them to their
corresponding four bits of A, and add 1. The simplest way to add a binary 1 is to insert
it through the input carry.

An XOR gate could be used as an inverter if we place logic 1 at one of the


inputs. This helps in getting the 1’s complement of the subtrahend. Then, we add 1 to
get the 2’s complement. The 2's complement is finally added to the minuend to get the
final result of the subtraction.

The following figure shows the adder-subtractor circuit. The mode input M
controls the operation. When M=0, the circuit is an adder. Whereas, when M=1, the
circuit becomes a subtractor. Although the figure is for only four bits, this circuit can
be cascaded for any number of inputs.

Note: During subtraction, if A ≥ B, the result is a positive number and the output
carry is equal to 1. If A < B, the subtraction gives a negative difference represented in
the 2’s complement format and the output carry is equal to 0. Therefore, during
subtraction, the carry actually represents the inversion of the borrow.
III - PROCEDURES

Implementing Half-Adder Circuit

1. Build the half adder circuit with LED output indicator for the sum and carry
outputs as shown in the figure below. Use as guide the datasheets in the
appendices for proper pin assignment of the ICs to be used. Double-check your
wiring against the given circuit diagram. Ensure that all the needed pins of the
ICs are properly connected.

2. Test the circuit by applying power to the circuit with +5V. Vary the inputs A and
B using the DIP switch. Observe the output in the LED indicator for sum and
carry. If the LED emits light or in the ON state, the gate output is high or ‘1’ and
if the LED did not emit light or in the OFF state, the gate output is low or ‘0’.
Record this output in Table 1 in Section IV.

3. Determine the Boolean expression of the circuit by writing the sum and carry
functions in the last row of Table 1.

Implementing Full-Adder Circuit

1. Build the full-adder circuit with LED output indicator for the sum and carry
outputs as shown in the figure below. Use as guide the datasheets in the
appendices for proper pin assignment of the ICs to be used. Double-check your
wiring against the given circuit diagram. Ensure that all the needed pins of the
ICs are properly connected.
2. Test the circuit by applying power to the circuit with +5V. Vary the inputs A, B
and C using the DIP switch. Observe the output in the LED indicator for sum
and carry. If the LED emits light or in the ON state, the gate output is high or ‘1’
and if the LED did not emit light or in the OFF state, the gate output is low or
‘0’. Record this output in Table 2 in Section IV.

3. Determine the Boolean expressions of the circuit by writing the sum and carry
functions in the last row of Table 2.

Implementing Half-Subtractor Circuit

1. Making use of what you have learned in Boolean Algebra, formulate the truth
table for a half-subtractor circuit that subtracts 2-bits. Fill-out the truth table 3
in Section IV.

2. Determine the simplified Boolean equation for the half-subtractor circuit by


applying Boolean identities. Show your solution in the last row of table 3.

3. Draw the logic diagram of the simplified Boolean equation of the half-subtractor
circuit. Implement the circuit in the breadboard and verify the results to your
formulated truth table.

Implementing Full-Subtractor Circuit

1. Making use of what you have learned in Boolean Algebra, formulate the truth
table for a full-subtractor circuit that subtracts 3-bits. Fill-out the truth table 4 in
Section IV.

2. Determine the simplified Boolean equation for the full-subtractor circuit by


applying Boolean identities. Show your solution in the last row of table 4.

3. Draw the logic diagram of the simplified Boolean equation of the full-subtractor
circuit. Implement the circuit in the breadboard and verify the results to your
formulated truth table.
IV - RESULTS/ VERIFICATION:

Record your observations to the corresponding truth table below.

Table 1 (Half-Adder)
Inputs Output
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Boolean Functions:

Sum = A'B + AB' = A ⊕ B

Carry = A × B = AB

Truth Table 2 (Full-Adder)


Inputs Output
A B C Sum Carry
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
Boolean Functions:

Sum = AB'C' + ABC + A'B'C + A'BC' = A ⊕ B ⊕ C

Carry = AB + A'BC+ AB'C = AB + C(A ⊕ B)


Table 3 (Half-Subtractor)
Inputs Output
A B Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Boolean Functions:

Difference = A'B + AB' = A ⊕ B

Borrow = A' × B = A'B

Half-Subtractor Circuit Diagram


Truth Table 4 (Full-Subtractor)
Inputs Output
A B C Difference Borrow
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
Boolean Functions:

Difference = A'B'C + A'BC' + AB'C' + ABC = A ⊕ B ⊕ C

Borrow = A'C + A'B + BC

Full-Subtractor Circuit Diagram


V - CONCLUSIONS:
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________________
___________________________________________________________

VI - POST-LABORATORY ASSESSMENT:

Design a 4-bit binary decrementer circuit using four half adders. Simulate the circuit
using Logisim or Proteus.

1. Develop truth table, if necessary


2. Generate the Boolean functions and simplify
3. Simulate design in any available software tools
Rubric for Laboratory Report in Logic Circuits and Switching Theory

Name of Student: ___________________________________________ Score: ________

Exemplary Proficient Fair Poor


Criteria
The diagrams The diagrams The diagrams The diagrams
Analysis and and truth tables and truth are and truth tables and truth tables
Design (All are 95- 100% 75 - 94% are 40 to are < 40 %
circuit diagrams correct and/or 74% correct and are
accurate, and
& truth tables.) is sub- correct and/or poor in
are very neatly
(35pts) exemplary in is poor in designing &
designed &
drawn designing & designing & drawing quality.
drawing drawing quality. Does not know
(30 -35 pts)
quality. how to design
(15 -25 pts)
(25 -30 pts) (0-15 pts)
Conduct of 80-100% of the 79 -60 % of the 59-40% design Less than 40%
Experiment required design design elements design elements
elements elements ar are obtained
(25 pts)
ar ar e obtained properly
e obtained e obtained properly. (0-10 pts)
properly. properly
(10 -20 pts)
(20-25) pts) (15 -20 pts).
Completed all 75%- 40-74%
parts of the 90-100% <40% completed
89%completed, completed or not done
laboratory (20 Complete without any , with help (0-10 pts)
pts) d (18-20 help (10-15
pts) (15- 20 pts) pts)
The results are The results are
interpreted interpreted
correctly and correctly not in The results are Does not know
Interpretation with a complete not interpreted about the
demonstrated manner with a correctly.
(10 pts) material.
understanding little
understanding (4-6 pts) (0-3pts)
of the design.
(9-10 pts) of the design.
(6-8 pts)
Safety Safety
Safety instructions instructions Safety
Safety (10 instructions were carried were carried instructions were
pts) were carried after instruction after many not carried;
completely; from faculty; instructions (0-3 pts)
(10 pts) (7-9pts) from faculty;
(4-7 pts)

You might also like