PPT: Binary Coded Decimal (BCD) | Analog and Digital Electronics - Electrical Engineering (EE) PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 1


Chapter 1            44
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits.   A few are useful:
Page 2


Chapter 1            44
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits.   A few are useful:
Chapter 1            45
§ What special property does the Gray code have
in relation to adjacent decimal digits?
GRAY CODE – Decimal
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0100
2 0010 0101
3 0011 0111
4 0100 0110
5 0101 0010
6 0110 0011
7 0111 0001
8 1000 1001
9 1001 1000
Page 3


Chapter 1            44
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits.   A few are useful:
Chapter 1            45
§ What special property does the Gray code have
in relation to adjacent decimal digits?
GRAY CODE – Decimal
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0100
2 0010 0101
3 0011 0111
4 0100 0110
5 0101 0010
6 0110 0011
7 0111 0001
8 1000 1001
9 1001 1000
Chapter 1            46
Binary Coded Decimal (BCD)
§ The BCD code is the 8,4,2,1 code.
§ 8, 4, 2, and 1 are weights
§ BCD is a weighted code
§ This code is the simplest, most intuitive binary
code for decimal digits and uses the same
powers of 2 as a binary number, but only
encodes the first ten values from 0 to 9.
§ Example:  1001 (9) = 1000 (8) + 0001 (1)
§ How many “invalid” code words are there?
§ What are the “invalid” code words?
Page 4


Chapter 1            44
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits.   A few are useful:
Chapter 1            45
§ What special property does the Gray code have
in relation to adjacent decimal digits?
GRAY CODE – Decimal
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0100
2 0010 0101
3 0011 0111
4 0100 0110
5 0101 0010
6 0110 0011
7 0111 0001
8 1000 1001
9 1001 1000
Chapter 1            46
Binary Coded Decimal (BCD)
§ The BCD code is the 8,4,2,1 code.
§ 8, 4, 2, and 1 are weights
§ BCD is a weighted code
§ This code is the simplest, most intuitive binary
code for decimal digits and uses the same
powers of 2 as a binary number, but only
encodes the first ten values from 0 to 9.
§ Example:  1001 (9) = 1000 (8) + 0001 (1)
§ How many “invalid” code words are there?
§ What are the “invalid” code words?
Chapter 1            47
Warning: Conversion or Coding?
§ Do NOT mix up conversion of a decimal
number to a binary number with coding
a decimal number with a BINARY
CODE.
§ 13
10
= 1101
2
(This is conversion)
§ 13 Û 0001|0011 (This is coding)
Page 5


Chapter 1            44
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits.   A few are useful:
Chapter 1            45
§ What special property does the Gray code have
in relation to adjacent decimal digits?
GRAY CODE – Decimal
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0100
2 0010 0101
3 0011 0111
4 0100 0110
5 0101 0010
6 0110 0011
7 0111 0001
8 1000 1001
9 1001 1000
Chapter 1            46
Binary Coded Decimal (BCD)
§ The BCD code is the 8,4,2,1 code.
§ 8, 4, 2, and 1 are weights
§ BCD is a weighted code
§ This code is the simplest, most intuitive binary
code for decimal digits and uses the same
powers of 2 as a binary number, but only
encodes the first ten values from 0 to 9.
§ Example:  1001 (9) = 1000 (8) + 0001 (1)
§ How many “invalid” code words are there?
§ What are the “invalid” code words?
Chapter 1            47
Warning: Conversion or Coding?
§ Do NOT mix up conversion of a decimal
number to a binary number with coding
a decimal number with a BINARY
CODE.
§ 13
10
= 1101
2
(This is conversion)
§ 13 Û 0001|0011 (This is coding)
Chapter 1            48
BCD Arithmetic
§ Given a BCD code, we use binary arithmetic to add the digits:
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
§ Note that the result is MORE THAN 9, so must be
represented by two digits!
§ To correct the digit, subtract 10 by adding 6 modulo 16.
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
+0110 so add 6
carry = 1 0011 leaving 3 + cy
0001 | 0011 Final answer (two digits)
§ If the digit sum is > 9, add one to the next significant digit
Read More
137 videos|143 docs|71 tests

Top Courses for Electrical Engineering (EE)

FAQs on PPT: Binary Coded Decimal (BCD) - Analog and Digital Electronics - Electrical Engineering (EE)

1. What is Binary Coded Decimal (BCD)?
Ans. Binary Coded Decimal (BCD) is a binary representation of decimal numbers where each decimal digit is represented by a fixed number of bits. In BCD, each digit is encoded using 4 bits, allowing easy conversion between binary and decimal representations.
2. How is BCD different from regular binary representation?
Ans. BCD differs from regular binary representation by using a fixed number of bits (typically 4 bits) to represent each decimal digit. Regular binary representation uses variable-length binary strings to represent numbers.
3. What are the advantages of using BCD?
Ans. BCD offers several advantages, including: - Easy conversion between binary and decimal representations. - Simplified arithmetic operations on decimal numbers. - Direct compatibility with decimal-based systems, such as calculators and digital displays.
4. How does BCD encoding work?
Ans. BCD encoding assigns a unique 4-bit binary code to each decimal digit from 0 to 9. For example, the BCD code for the decimal digit 5 is 0101. To encode a decimal number in BCD, each decimal digit is individually converted to its BCD equivalent.
5. Can BCD be used in modern computing systems?
Ans. BCD is still used in certain applications where decimal arithmetic operations are required, such as financial calculations and some embedded systems. However, in general-purpose computing systems, BCD is less commonly used due to its inefficiency in terms of storage and processing compared to binary representation.
137 videos|143 docs|71 tests
Download as PDF
Explore Courses for Electrical Engineering (EE) exam

Top Courses for Electrical Engineering (EE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

mock tests for examination

,

PPT: Binary Coded Decimal (BCD) | Analog and Digital Electronics - Electrical Engineering (EE)

,

Summary

,

Exam

,

MCQs

,

Sample Paper

,

pdf

,

PPT: Binary Coded Decimal (BCD) | Analog and Digital Electronics - Electrical Engineering (EE)

,

past year papers

,

video lectures

,

Semester Notes

,

study material

,

Objective type Questions

,

Extra Questions

,

practice quizzes

,

Previous Year Questions with Solutions

,

Viva Questions

,

Free

,

PPT: Binary Coded Decimal (BCD) | Analog and Digital Electronics - Electrical Engineering (EE)

,

ppt

,

Important questions

,

shortcuts and tricks

;