Professional Documents
Culture Documents
Instructions to student: Please make sure you fill in the form completely.
Instructions to lecturer: Kindly record the numerical marks in the rubric assessment
form, not here.
PARTICULARS
Group: W17
Abstract
In this experiment, we aimed to learn about adder and flip-flop circuits. In Part 1 of
this experiment, we explored the process of addition of binary numbers through constructing
half adder and full adder circuit. We used only NAND gates and NOR gates to construct 2
separate half adders. To construct full adder, we used XOR, AND and OR gates as the
components of the circuit. Table 3, 4 and 5 were built to record the outcomes of the circuit
given certain inputs, the outcomes match that of theoretical result. Part 2 of this experiment,
we constructed R-S latch and R-S flip-flop and their functions and operations were
investigated. The R-S latch is built using 2 coupled NOR gates, while two R-S flip-flops were
built, first using only NAND gate and second one using the combination of AND and NOR
gates. Truth tables of the circuits were also built and compared to the theoretical result, the
experimental outcomes match that of theoretical result.
Theory
Adder circuit
An adder is a digital circuit that performs basic arithmetic of numbers. Adders are used
in arithmetic logic units (ALU) of most of the computers and processors. They are also used in
other parts of the processor, where they are used to calculate addresses, table indices,
increment and decrement operators and similar operations. By constructing suitable type
adders, it can perform arithmetic on different types of number representations. The most
common adders operate on binary numbers. An ALU circuit is basically a combination of many
full adders.
An adder that adds two single-bit binary digits A and B is known as half adder. It has
two outputs, sum(S) and carry (C). The carry signal represents an overflow into the next digit
of a multi-digit addition. As there are two single-bit binary digits, we have 4 different outputs,
which is shown in the truth table below.
Input Output
A B Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
The simplest half-adder design, pictured on the right, incorporates an XOR gate for S and an
AND gate for C. The Boolean logic for the sum (in this case S) will be A′B + AB′ whereas for the
carry (C) will be AB.
Figure 1: Half adder logic diagram.
By further modifying the half adder, we can combine two half adders to make a full adder. A
full adder is capable of adding three single-bit binary. The Boolean logic for the
implementation of full adder is S = A ⊕ B ⊕ Cin and Cout = (A ⋅ B) + (Cin ⋅ (A ⊕ B)). There are a
few types of full adder, one of example is shown below.
By using 2 full adder, we can perform addition of two 2-bit binary numbers A1A2 and
B1B2, as illustrated below. For example, with this configuration we can add two strings of 10
and 11, which corresponds to A1A2 and B1B2 respectively, the result is a 3-bit binary numbers.
Figure 3: Operation of 2 full adders.
Similarly, by increasing the number of full adders we can add longer string of binary number.
A clocked R-S flip-flop can be made by adding a second level NAND gates to the inverted R-S
latch. The extra NAND gates further invert the inputs so SR latch becomes a gated SR latch.
The enable, E input makes the latch to be transparent or opaque, by toggling the E input high,
changes on the R and S input will take effect, if E input is low, no changes will occur despite
input on R and S has been changed. When the enable signal input is a clock signal, the latch is
said to be clocked as discussed earlier.
En S R Q Q'
0 0 0 0
0 1 0 0
0
1 0 0 0
1 1 0 0
0 0 Memory Memory
0 1 0 1
1
1 0 1 0
1 1 Invalid Invalid
Objective
The purpose of this experiment is to help us to understand the process of addition of binary
numbers through the functions of half adder and full adder circuits. Secondly, this experiment
involves constructing the R-S latch and R-S flip-flop using either NAND or NOR gates, which
allows us to study the functions and operations of the R-S latch and R-S flip flops from the
circuits constructed.
Methodology
For first part of this experiment, a half adder circuit is constructed by using only NAND
gates, as shown in figure 8. The truth table is then verified and completed as shown in Table
1.
For the second part of this experiment, a R-S latch circuit is first constructed using
NOR gates (7402). The power supply is turned on, then Q and Q’ is connected to LED 1 and
LED 2 respectively. Logic 0 is set on inputs R and S, the corresponding result is recorded by
observing any changes on the LED. The results are recorded in table 6. Logic 0 and 1 is then
applied at inputs R and S respectively, the output is observed and compared with the table 3.
Truth table 6 is built and comparison is made with the table 3.
R-S flip-flop is then constructed using NAND gates as shown in Figure 6. Inputs S and
R is connected to the switches and Q and Q’ to the LEDs. The power supply is turned on and
the output is set, so that Q = 1 and Q’ = 0 and the inputs is set as S = 0 and R= 0. The clocked
is then switched on and the output is recorded into the truth table 7. By maintaining the
circuit, the output is kept such that Q = 0 and Q’ = 0, step 2 is repeated by setting the inputs
S-R set to logic 0-1, 1-0 and 1-1. Then the output is set such that Q = 0 and Q’ = 1 and the
previous combinations of input is used to obtain the rest of the results.
Then another R-S flip-flop is constructed using AND(7408) and NOR(7402) gates as
shown in Figure 7. Same procedures as that of NAND gate R-S flip-flop are carried out. From
the observations, truth table 8 is built.
Results and Analysis
Part 1
1) Nand gate half adder
The switch controls the input to be 1 or 0, by toggling the switch to connect the common to
the ground (black wire), an input of 0 is feed into the chip. Conversely, by toggling the switch
to connect the common of the switch to positive terminal (red), an input of 1 is feed into the
IC.
Input Output
A B Carry, Cout Voltage, v Sum Voltage, v
0 0 0 0.00 0 0.00
0 1 0 0.00 1 5.00
1 0 0 0.00 1 5.00
1 1 1 5.00 0 0.00
Table 3: Truth table of a Nand gate half adder circuit.
The reading on the multimeter indicates the state of the output, that is, reading of 0V
implies an output of 0, while reading of 5.00V implies an output of 1.
2) NOR gate half adder
To design a half adder, there are two conditions needs to be fulfilled. First, the sum of
the binary digit, S must be 1(high) if both of the inputs are different, while S must be
0(low) if the both of the inputs are the same. Second, the carry out, C must be 1 if both
of the inputs are 1, otherwise C is 0.
These conditions can be expressed using 2 equations using Boolean algebra and De
Morgan’s Theorem.
𝑆𝑆 = 𝐴𝐴 ⊕ 𝐵𝐵
= (𝐴𝐴 ⋅ 𝐵𝐵)′ (𝐴𝐴 + 𝐵𝐵)
= (𝐴𝐴′ 𝐵𝐵 ′ )′ ⋅ (𝐴𝐴𝐴𝐴)′
= (𝐴𝐴′ 𝐵𝐵 ′ + 𝐴𝐴𝐴𝐴)′ (1)
𝐶𝐶 = 𝐴𝐴 ⋅ 𝐵𝐵
= (𝐴𝐴′ + 𝐵𝐵 ′ ) (2)
where ⊕ is XOR.
Notice that NOR gate is the complement of OR gate, thus its function can be
expressed as (A + B)’ = A′ 𝐵𝐵′
Input Output
A B Cin Carry, Cout Voltage, v Sum Voltage, v
0 0 0 0 0 0 0
0 0 1 0 0 1 5.0
0 1 0 0 0 1 5.0
0 1 1 1 5.0 0 0
1 0 0 0 0 1 5.0
1 0 1 1 5.0 0 0
1 1 0 1 5.0 0 0
1 1 1 1 5.0 1 5.0
Table 5: Truth table of a Full Adder Circuit
Part 2
1) R-S latch
0 0 0 0
0 1 0 0
0
1 0 0 0
1 1 0 0
0 0 Memory Memory
0 1 0 1
1
1 0 1 0
1 1 Invalid Invalid
Reference
1) Ong.L.H (2012), Adder and flip-flop Practical II 2EL11 USM Lab manual
2) Wikipedia Flip-flop and latch, retrieved from https://en.wikipedia.org/wiki/Flip-
flop_(electronics) on 12 Nov 2021.
3) Electronic coach (2017), Half adder, retrieved from
https://electronicscoach.com/half-adder.htm on 12 Nov 2021.
Appendix
74HC (HCMOS family)
De Morgan’s Theorem