0% found this document useful (0 votes)
15 views7 pages

1a. Binary Vs BCD Code

Uploaded by

f2023065013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

1a. Binary Vs BCD Code

Uploaded by

f2023065013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Digital Design

Binary and Binary-Coded Decimal Code

M. Morris Mano
Edition 5
BINARY CODES
An n‐bit binary code is a group of n bits that assumes up to 2n distinct combinations of 0’s and 1’s,
A B C 5‐
2‐bit Binary code. 3‐bit Binary code. Dec.
0D 0
A B 0 0 00 bit B
A Dec.
Dec. C 1 0 000 I
B
0 0 0
0 0 2 0 101 N
0

4‐bit Binary code.


0 00 A
1 01 1 3 0 011
0 11
2 11 2 4 0 110 R
3 0 10 5 0 010 Y
3 0
1 01 6 0 11
1 4
1 00 7 1 01 C
5 8 1 100
1 1
1 O
6 9 1 00 D
1 0
1
7 10 1 101 E
1 11 1 011
12 1 10
The bit combination of an n‐bit code is determined from the count 13 1 010
in binary from 0 to 2n - 1. 14 1 11 etc.
Each element must be assigned a unique binary bit combination. 15 01
1
BINARY CODED DECIMAL – (BCD)
The binary number system is the most natural one for a computer, but people are accustomed to the
decimal system
One way to resolve this difference is to

• To convert decimal numbers to binary

• perform all arithmetic calculations in binary, and then

• convert the binary results back to decimal.

This method requires that we store the decimal numbers in the computer in such a way that
they can be converted to binary.

Since the computer can accept only binary values, we must represent the decimal digits by a
code that contains 1s and 0s.
It is also possible to perform the arithmetic operations directly with decimal numbers when
they are stored in the computer in coded form.
BINARY CODED DECIMAL – (BCD)
The code used for the decimal digits (0 to 9) is the straightforward binary assignment and is
called binary-coded decimal (BCD) as shown below:

Dec. A B C
0D 0 As the number of elements in this set is not a power of 2, So this
0 0 00 binary code will have some unassigned bit combinations.
1 0 000
2 0 101
3 011 Unused bit for BCD:
0 1 0
4 10 1 01
0 1
5 00 1 011
0 1 1 10
6 11
0 1 1 010
7 01 1 11
1 0
10 01
8 1 0 1
9 0
0
1
BINARY CODED DECIMAL – (BCD)
BCD Code: BCD
A B C
Dec.
0D 0
Binary Number
0 0 00 0 0000
1 0 000 0000
2 101 1 0001 A number with n
0
3 0 011 0001 decimal digits will
4 10 -- --- require 4*n bits in
0 1
00 --- BCD.
5 0 1
11 -- ---
6 0 1 --
7 01
1 0 9 1001
8 10 1001
1 0
9 0
0 10 0001 0000
1 1010
• BCD number needs more 11 bits than its equivalent
0001
binary0001
value.
1011
• However, BCD representation
-- of decimal numbers is still important, because computer input
and output data used by- most
- people needs to be in the decimal system.
99 1001 1001
BINARY CODED DECIMAL – (BCD)

• BCD numbers are decimal numbers and not binary numbers, even
though they are represented using bits.

• The only difference between a decimal and a BCD number is that

- decimals are written with the symbols 0, 1, 2, ..., 9, and

- BCD numbers use the binary codes 0000, 0001, 0010, ...,
1001.
DECIMAL CODES
Other decimal codes are possible but not commonly used.

• 2 4 2 1 Code
• Excess-3 Code
• 8 4 -2 -1 code
• Reflected Code

You might also like