BCD TO BINARY CONVERTERMohammad Atiqul IslamRiasat Khan
EEL 6726 Advanced VLSI Design
Gonzalo MedinaDavid Viviescas
Contents
Introduction Explanation of BCD History and Applications of BCD
Mentor Graphics Approach Algorithm / Block Diagram
Circuit Diagrams Simulation Results Conclusion
2
Introduction
What is BCD? Binary Coded Decimal
(BCD) is a class of binary encoding where decimal numbers are represented by a fixed number of binary digits. The table below shows the 4-bit representation of decimal digits (0-9) as BCD.
Decimal Digit
BCD8 4 2 1
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
3
Introduction
Why BCD? BCD is used in
computing and electronics system, mainly because it allows for easy conversion to decimal digits for printing, display and fast decimal arithmetic calculations.
4
Introduction
Where can you find BCD? BCD is common in digital logic for purposes of displaying a
numeric value in an electronic system. Storing the same value to be displayed as a binary would require conversion to ASCII to be understood once displayed, resulting in a more expensive process. Examples of BCD in electronics: 7 Segment Displays, Digital Watches,
Automotive Displays
5
Introduction
Converting from decimal to BCD: 65Dec = 0110 0101BCD
BCD representation as Binary: 0110 0101Bin = 1x20 + 1x22 + 1x25 +1x26 = 1
+ 4 + 32 + 64 = 101Dec
PROBLEM: 0110 0101Bin ≠ 65Dec!!
BCD to Binary: We want to show 01100101BCD as 0100 0001Bin
6
Algorithm
How do we go about converting from BCD to Binary? Our Internet research led us to find circuits that
could convert from Binary to BCD, but not BCD to Binary. So we just made our own, working algorithm.
Continuing with previous example: 65Dec= 0110 0101BCD 65Dec = (6 x10) + 5
Our Concept: Use the left most nibble and multiple by 10. Use adder to then add output of multiplication with
right nibble and ultimately obtain the desired binary result.
7
Algorithm
Decimal to BCD
Decimal to BCD
BCD to BinaryBCD to Binary
8
Circuit Creation Breakdown
8-Bit Adder
1-Bit Adder (x8)
Combinational Logic (XOR, OR, AND)
CMOS Inverter Logic
9
CMOS Inverter Circuit Design
Circuit
10
Symbol
CMOS Inverter Logic
CMOS Inverter Simulation11
InputOutpu
t
0 1
1 0
Truth Table
AND Gate Circuit Design12
Circuit Symbol
Combinational Logic (XOR, OR, AND)
AND Gate Simulation13
InputOutpu
tA B
0 0 0
0 1 0
1 0 0
1 1 1
Truth Table
OR Gate Circuit Design14
Circuit Symbol
Combinational Logic (XOR, OR, AND)
OR Gate Simulation15
InputOutpu
tA B
0 0 0
0 1 1
1 0 1
1 1 1
Truth Table
XOR Gate Circuit Design16
Circuit Symbol
Combinational Logic (XOR, OR, AND)
XOR Gate Simulation17
InputOutpu
tA B
0 0 0
0 1 1
1 0 1
1 1 0
Truth Table
1-Bit Adder Circuit Design18
Circuit Symbol
1-Bit Adder (x8)
1-Bit Adder Simulation19
8-Bit Adder Circuit Design20
Circuit Symbol
BCD to Binary Circuit Design
21
BCD to Binary Truth Table
DecBCD
7BCD
6BCD
5BCD
4BCD
3BCD
2BCD
1BCD
0BIN7
BIN6
BIN5
BIN4
BIN3
BIN2
BIN1
BIN0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
.
.
.
.
.
.
.
.
.
38 0 0 1 1 1 0 0 0 0 0 1 0 0 1 1 0
.
.
.
.
.
.
.
.
.
65 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 1
.
.
.
.
.
.
.
.
.
99 1 0 0 1 1 0 0 1 1 1 0 0 0 0 1 1
22
6 5
3 832 +4+2 =
38
64 + 1 = 65
BCD to Binary Simulation23
BCD Input Binary Output
0
Conclusion
MENTOR GRAPHICS Mentor Graphics gives engineers the ability to design, model, and test a
system from the high level of abstraction down to the structural gate level with the inclusion of:
Various Building Blocks Simulation of Circuitry User Defined Symbols
Availability to work with analog, digital and/or mixed signals. Simple circuits can be completed with schematics while more complex
circuits can be implemented with Verilog or VHDL. Easy integration with current channel length sizes used by foundries (i.e.
TSMC -Taiwan Semiconductor Manufacturing Company).
BCD 2 BINARY Easy conversion to decimal numbers that can be displayed or used for
simplifying calculations. Main component for proper implementation is the 8-Bit Full Adder, easily
created in Mentor Graphics through schematic representation.
24
References
http://cryptodox.com/Binary-coded_decimal http://en.wikipedia.org/wiki/Binary-coded_decimal http://www.flickr.com/photos/33947113@N03/4696915622/sizes/l/
in/set-72157620266822943/ http://www.tuaw.com/2011/03/09/apple-selects-taiwans-tsmc-to-p
roduce-its-a5-chip/ http://www.innovatoys.com/images/thumbs/led-binary-clock_1262
290.jpg http://www.meegoexperts.com/wp-content/uploads/2010/12/258_
mentor_logo.jpg http://pixhost.me/avaxhome/2006-12-01/epcb1.gif
25