Professional Documents
Culture Documents
BCS183086 - Safia Mansoor PDF
BCS183086 - Safia Mansoor PDF
BCS183086 - Safia Mansoor PDF
SYSTEM
by
Safia Mansoor
BCS183086
Faculty of Computing
Capital University of Science & Technology,
Islamabad
May, 2020
DECLARATION
It is declared that this is an original piece of my own work, except where
otherwise acknowledged in text and references. This work has not been submitted in
any form for another degree or diploma at any university or other institution for tertiary
education and shall not be submitted by me in future for obtaining any degree from this
or any other University or Institution.
Safia Mansoor
BCS183086
May, 2020
ii
ACKNOWLEDGMENT
I would like to thank first and foremost Allah Almighty for his never ending grace. I
am highly obliged to my supervisor, Mr. Ahmed Ali for giving me the opportunity to
work on this project and giving me the knowledge and advice to complete this project
with ease. We dedicate this acknowledgement to all my professors who shared their
ideas and guided me during our project making process.
iii
ABSTRACT
Digital computation lies at the basis of nearly all modern pursuits of knowledge.
This computation is performed utilizing only a single voltage, manipulating the voltage
on or off to simulate a base two number of either a one or a zero. Numerous logic
devices have sprung up to implement computations in this digital space, and most
modern computers perform their computations through the use of addition and nothing
else. The half adder, and consequently the full adder, makes everything in the Central
Processing Unit possible. Their logic may be extended through the use of a carry out
signal to another adder, all the way up to an arbitrary amount of n bits. In the interest of
minimizing complexity the four-bit binary adding machine was chosen to showcase
these fundamentals of computer processing. In order to realize binary computation, a
circuit design was first approached through the use of a Simulation Program with
Integrated Circuit Emphasis (SPICE). Once the SPICE was complete, a working circuit
was implemented with integrated circuit logic gates on a solderless breadboard.
iv
TABLE OF CONTENTS
DECLARATION ..................................................................................................... ii
ACKNOWLEDGMENT ......................................................................................... iii
ABSTRACT ........................................................................................................... iv
LIST OF FIGURES ................................................................................................ vi
Chapter 1 ................................................................................................................. 1
INTRODUCTION ................................................................................................... 1
1.1 Overview .................................................................................................................................... 1
1.2 Project Idea................................................................................................................................. 1
1.3 Purpose of the Project ................................................................................................................ 2
1.4 Project Specifications ................................................................................................................ 3
1.5 Applications of the Project ........................................................................................................ 4
1.6 Project Plan ................................................................................................................................ 4
1.7 Report Organization .................................................................................................................. 4
Chapter 2 ................................................................................................................. 5
LITERATURE REVIEW ........................................................................................ 5
2.1 Background Theory ................................................................................................................... 5
2.2 Related Technologies ................................................................................................................ 5
2.2.1 Related Technology 1 ................................................................................................ 5
2.2.2 Related Technology 2 ................................................................................................ 5
2.3 Related Projects ......................................................................................................................... 5
2.3.1 Bit Full adder: ............................................................................................................. 6
2.3.2 Four Bit Binary Adder Using Reversible Logic Gates: ........................................... 6
2.4 Related Studies/Research .......................................................................................................... 6
2.5 Problem Statement ..................................................................................................................... 7
2.6 Summary .................................................................................................................................... 7
v
Chapter 3 ................................................................................................................. 8
PROJECT DESIGN AND IMPLEMENTATION .................................................... 8
3.1 Proposed Design Methodology ................................................................................................. 8
3.2 Analysis Procedure .................................................................................................................... 8
3.3 Design of the Project Hardware ................................................................................................ 8
3.3.1 Logic probe ................................................................................................................. 9
3.3.2 AND Gate ................................................................................................................... 9
3.3.3 OR Gate ...................................................................................................................... 9
3.3.4 IC 7447............................................................................................................................ 9
3.3.5 Common Anode 7 Segment Display ............................................................................... 9
3.4 Design of the Project Software/Algorithm ............................................................................. 10
3.5 Implementation Procedure ...................................................................................................... 11
3.6 Details of Simulations / Mathematical Modeling .................................................................. 12
3.7 Details of Final Working Prototype........................................................................................ 15
3.8 Summary .................................................................................................................................. 15
Chapter 4 ............................................................................................................... 16
CONCLUSION AND FUTURE WORK ............................................................... 16
REFERENCES ...................................................................................................... 17
LIST OF FIGURES
vi
Figure 1 Truth Table for Full Adder............................................................................................................ 10
Figure 2circuit diagram for full adder ......................................................................................................... 11
Figure 3simulation figure ............................................................................................................................. 13
Figure 4Simulation diagram ........................................................................................................................ 14
vii
Chapter 1
INTRODUCTION
In daily routine, we need to perform several operations on digital computers for our
ease. So our computers make use of combinational circuits to perform required
operations. As computers do not understand the human language (high level language),
the compilers in computers translate the high level language in to low level language
i.e. binary language (0’s and 1’s). So, all the computations are performed in binary
language. Our computers can perform variety of arithmetic operations, out of which
addition is one. To carry out addition in computers, adders are used. These adders are
used for the addition of binary numbers. These adders are basically combinational
circuits that use gates like AND, XOR and OR. In further chapters, we discuss the
working of these gates and how the additions are performed using these adders.
1.1 Overview
Digital computers carry out a variety of information-processing tasks. Combinational
circuits can perform many arithmetical operations. Among these circuits, adders are of
significant importance. “A combinational circuit that performs the addition of two bits
is called a half adder; one that performs the addition of three bits (two significant bits
and a previous carry) is a full added. The names of the circuits stern from the fact that
two half adders can be employed to implement a full adder.”[1]. Combining four full
adders, a four bit full binary adder is formed. It simply performs the addition of two
binary numbers.
1
4 bit 4adders, the input is given and the output of each adder is acted as the input for
the next adder. A hierarchy design is followed to develop these circuits. The idea of this
project is to explain that how the additions in digital computers take place through
adders.
Although adders can be constructed for many number representations, such as binary-
coded decimal or excess-3, the most common adders operate on binary numbers. In
cases where two's complement or ones' complement is being used to represent
negative numbers, it is trivial to modify an adder into an added subtractor. Other signed
number representations require more logic around the basic adder.
A full adder is a combinational circuit that forms the arithmetic sum of three bits. It
consists of three inputs and two outputs. Two of the input variables, denoted by r and
y, represent the two significant bits to be added. The third input, represents the carry
from the previous lower significant position. Two outputs are necessary because the
arithmetic sum of three binary digits ranges in value from 0 to 3.and binary 2or 3 needs
two digit. The two outputs are designated by the symbols S for sum and C for carry.
The binary variable S gives the value of the least significant bit of the sum. The binary
variable C gives the output carry. So the purpose of this project is to design this four bit
full adder.
2
1.4 Project Specifications
We designed a circuit of four bit full adder. Following are the project specifications:
Specifications Explanation
Logic probe Each type of switch has its own application, even though
same operation is performed by other type of switches. But
logic probe used for circuits of that type in which we check
output again and again during running time.
Adders Four full adders are used. These adders perform the binary
additions of numbers.
3
1.5 Applications of the Project
Following are the applications of the project:
They are used in washing machines, dryers, smart thermostats, digital wrist
watches, game consoles, digital bathroom scales or network equipment such as
routers.
4
Chapter 2
LITERATURE REVIEW
5
2.3.1 Bit Full adder:
The most timing critical part of logic design usually contains one or more arithmetic
operations, in which addition is commonly involved. Addition is a fundamental
arithmetic operation and it is the base for arithmetic operations such as multiplication
and the basic adder cell can be modified to function as subtractor by adding another
XOR gate. Therefore, 1-bit Full Adder cell is the most important and basic block of an
arithmetic unit of a system. Hence in order to improve the performance of the digital
computer system one must improve the basic 1-bit full adder cell based application. In
this paper simulate the performance of 4 bit adder- subtractor, 4 bit Carry skip adder
and 4-bit multipliers are designed using 9T full adder. All the simulation results are
using TSMC-0.18μM CMOS Technology.
6
2.5 Problem Statement
A full adder adds two 1-bit numbers and also has a carry-in bit. The 3-bit addition of
the two inputs and the carry-in produces a sum output bit and a carry output bit. The
three inputs are A, B and C in, and the outputs are Sout and C out. A logic circuit is required
to add multi-bit binary numbers. A multilevel circuit that would add two 4- bit numbers
would have 9 inputs and 5 outputs. Although a multi-level SOP or POS circuit
theoretically would be very fast, it has numerous drawbacks that makes it impractical.
The design would be very complex in terms of number of logic gates. Testing would be
difficult. In addition this approach cannot be extended easily to add binary numbers
with a higher number of bits. Multiple full adders can be used instead to make
comparatively simpler multilevel implementations with far fewer logic gates and wired
connections. Each full adder is designed and tested and then these full adders are used
in the design of a larger circuit. The cost of this simplification is a longer delay between
an input level change and a valid output level. The issues that could affect the course of
research are: Financial crunch in academia.
2.6 Summary
In this chapter, the technology used to make the project is described with detail. The
related projects to four bit binary adder are discussed. The working of this project is
been described in detail. Also the hot research on related topics is been discussed. A
problem statement lets the reader know what problem he can face during research. So
he should avoid those things.
7
Chapter 3
As a 4-bit full adder is required, other three other full adders are implemented in the
same way. The bits of resultant sum are obtained from the sum bit of each full adder.
The carry bit for each full adder is used as an input for the next full adder. The sum bit
obtained from the first full adder is the least significant while the carry bit obtained
from last full adder is the most significant bit of the resultant sum.
The most significant bit of the numbers taken as input is given to the last full adder
while the least significant of the numbers is given to the first full adder. Through this
methodology, the resultant sum of the given numbers is obtained which in decimal.
8
3.3.1 Logic probe
Logic probe is used to analyzing and troubleshooting the logical states (Boolean 0 or
1) of a digital circuit. While most are powered by the circuit under test, some devices
use batteries.
3.3.3 OR Gate
The OR gate is a digital logic gate that implements logical disjunction. A HIGH output
(1) results if one or both the inputs to the gate are HIGH (1). If neither input is high, a
LOW output (0) results.
3.3.4 IC 7447
“The 7447 IC is used to drive 7 segment display. It must be used with a common anode
7-segment display. The input to the 7447 is a binary number. DCBA where D is 8s, C
is 4s, B is 2s and A is 1s. The inputs DCBA often come from a binary counter. The
display is only sensible if the binary number is between DCBA=0000 (0) and
DCBA=1001 (9); this is called Binary Coded Decimal or BCD for short. If the number
is larger than 9, we get a strange output on the display.” [7]
9
3.4 Design of the Project Software/Algorithm
“A full adder is a digital circuit that performs addition. Full adders are implemented
with logic gates in hardware. A full adder adds three one-bit binary numbers, two
operands and a carry bit. The adder outputs two numbers, a sum and a carry bit. The
term is contrasted with a half adder, which adds two binary digits.” [8]
3.4.1.2 K-maps
Now k-maps can be used to obtain the functions of sum and carry. K-Maps for Cout
and S are given below:
Cout = AB + BC + CA S= A + C + ABC +
10
3.4.1.2 Circuit Diagram
Now the next step is to design the circuit diagram for full adder that is given below:
3.5.1 Input
When the switch is open, current goes into the 4-bit full adder as Logic 1. When the
switch is close, the current goes to the ground indicating the Logic 0. The carry-bit is
taken 0 initially. Then two 4-bit binary numbers are taken as inputs in the 4-bit full
adder. The inputs are given in binary form in 4-bit full adder.
3.5.2 Sum
There are four full adders in the circuit. The first full adder activates when C in is taken
as input to the first full adder. A0, B0 and Cin are given as inputs in the first full adder.
The sum bit and carry bit is obtained. The resultant value of S 0 can be determined by
the expression S0 = A0 ⊕ B0 ⊕ Cin. The value of C0 can be determined by the expression
11
C0 = A0B0 + B0 Cin + C inA0. Then C0 is fed as input to the second full adder and A1, B1
and C0 are given as inputs. The process is repeated till fourth full adder until the values
of S3 and C3 is obtained.
The sum bit produced by each full adder is used to determine the output along with the
carry-bit produced by the last full adder. The sum is then displayed in decimal
numbering system.
0 0 1 0 0 1 0 0
A3 A2 A1 A0 B3 B2 B1 B0
The decimal sum of A and B is 2 + 4 = 6. The binary addition of A and B is given as:
0 0 1 0
+ 0 1 0 0
0 1 1 0
C4 S3 S2 S1 S0
12
The result obtained is i.e. (0110)2 which when converted to decimal gives (6) 10. The 7
segment used to display the digit on tens place displays 0 while the 7 segment used to
display the digit on units place displays 6.
The results from running simulation of this example on Proteus are given below:
Example 2: A = 3, B = 5 and C in = 0
The given example states the, A = 3 and B = 5 in decimal numbering system. In binary
these numbers become 0011 and 0101 respectively.
0 0 1 1 0 1 1 1
A3 A2 A1 A0 B3 B2 B1 B0
The decimal sum of A and B is 3 + 7 = 10. The binary addition of A and B is given as:
0 0 1 1
+ 0 1 1 1
1 0 1 0
C4 S3 S2 S1 S0
13
The result obtained is i.e. (1010)2 which when converted to decimal gives (10)10. The 7
segment used to display the digit on tens place displays 1 while the 7 segment used to
display the digit on units place displays 0.
The results from running simulation of this example on Proteus is given
14
3.7 Details of Final Working Prototype
The inputs are given in binary form in 4-bit full adder. The given numbers to be added
are in decimal form so first they are converted to binary. If the bit is 1 the switch is kept
open for that bit. If the bit is 0, the switch is kept closed for that respective bit. Two 4 -
bit binary numbers A and B are taken as input in 4-bit full adder. Cin can be 1 or 0
according to the output requirement.
3.8 Summary
Full adder is a logic circuit that adds two input operand bits plus a carry in bit and
outputs a carry out bit and a sum bit. When the switch is open, current goes into the 4 -
bit full adder as Logic 1. When the switch is close, the current goes to the ground
indicating the Logic 0. The carry-bit is taken 0 initially. Then two 4-bit binary numbers
are taken as inputs in the 4-bit full adder. The inputs are given in binary form in 4-bit
full adder. There are four full adders in the circuit. The first full adder activates when
Cin is taken as input to the first full adder. A0, B0 and Cin are given as inputs in the first
full adder. The sum bit and carry bit is obtained. Then C 0 is fed as input to the second
full adder and A1 , B1 and C0 are given as inputs and the process is repeated till fourth
full adder until the values of S3 and C 3 is obtained. The sum-bit obtained from the first
full adder is the least significant bit of the sum while the sum- bit obtained from the last
full adder is the most significant bit of the sum. The resultant sum is obtained in decimal
numbering system.
15
Chapter 4
Digital electronic devices make use of adders to a greater extent. So among other
combinational circuits, adders are of significant importance. If we ever come to meet
the reader, six months from now, we would want him to remember that how we drew
the four bit full adder making use of the four full adders. The whole working of the four
bit full adder that how we initially give carry in. Moreover, the carry out of each adder
acts as carry in for each circuit. And lastly, observing the final carry out and sums. The
new observations we made, was in the part of obtaining output. We observed that the
output of the additions performed by four bit full adder can be in the form of Binary,
decimal or Hex decimal numbers, depending upon in which number system we are
required to display our output. So for displaying output in different number system, the
approach is entirely different. Out recommendations to anyone who wants to carry on
with our work is that he/she should amend the circuit in a way that it displays result in
these three number systems binary, decimal or Hex decimal. So the resulting adder can
become that component of device which have multiple choice of number system to
display results in.
16
REFERENCES
[1] https://www.studocu.com/hk/document/comsats-university-islamabad/design-
technologies-i/other/digital-design4th-editionm-morris-mano/4446752/view
[2] https://www.geeksforgeeks.org/4-bit-binary-adder-subtractor/
[3] https://www.quora.com/What-are-the-applications-of-a-4-bit-parallel-
adder#:~:text=in%20Electronic%20and%20Communications%20Engineering,Electro
nics%20Hobbyist.&text=Adders%20are%20digital%20logic%20devices%20that%20
add%20or%20sum%20binary%20numbers%20together.&text=So%20if%20you%20
had%20a%204%20bit%20adder%20it%20would,to%20form%20an%208bit%20adde
r.
[4] https://www.elprocus.com/half-adder-and-full-adder/
[5] https://en.wikipedia.org/wiki/AND_gate
[6] https://en.wikipedia.org/wiki/XOR_gate
[7]http://www.davidswinscoe.com/electronics/components/7447/#:~:text=The%2074
xx47%20chip%20is%20used,come%20from%20a%20binary%20counter.
[8] https://www.techopedia.com/definition/7346/full-adder
17