0% found this document useful (0 votes)
98 views

15 BCD Addition

The document discusses binary-coded decimal (BCD) representation and addition. BCD uses 4 bits to represent each decimal digit, requiring more bits than binary but allowing for decimal representation. BCD addition treats each 4-bit digit as a binary number, adding and carrying between positions. If the sum exceeds the maximum valid BCD value, 6 is added to obtain the correct digit and carry. An example demonstrates adding three BCD numbers and obtaining the proper sum and carry through this method. The document then introduces alphanumeric codes, noting that computers require binary representation of letters, numbers and symbols to process text-based data.

Uploaded by

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

15 BCD Addition

The document discusses binary-coded decimal (BCD) representation and addition. BCD uses 4 bits to represent each decimal digit, requiring more bits than binary but allowing for decimal representation. BCD addition treats each 4-bit digit as a binary number, adding and carrying between positions. If the sum exceeds the maximum valid BCD value, 6 is added to obtain the correct digit and carry. An example demonstrates adding three BCD numbers and obtaining the proper sum and carry through this method. The document then introduces alphanumeric codes, noting that computers require binary representation of letters, numbers and symbols to process text-based data.

Uploaded by

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

ManoCh01v4.

fm Page 24 Wednesday, May 2, 2007 6:11 PM

24 CHAPTER 1 / DIGITAL SYSTEMS AND INFORMATION

TABLE 1-4
Binary-Coded Decimal (BCD)

Decimal BCD
Symbol Digit

0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

The BCD value has 12 bits, but the equivalent binary number needs only 8 bits. It
is obvious that a BCD number needs more bits than its equivalent binary value.
However, BCD representation of decimal numbers is still important, because com-
puter input and output data used by most people needs to be in the decimal sys-
tem. 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 num-
bers use the binary codes 0000, 0001, 0010, ..., 1001.

BCD Addition
Consider the addition of two decimal digits in BCD, together with a possible
carry of 1 from a previous less significant pair of digits. Since each digit does not
exceed 9, the sum cannot be greater than 9  9  1  19, the 1 being a carry.
Suppose we add the BCD digits as if they were binary numbers. Then the binary
sum will produce a result in the range from 0 to 19. In binary, this will be from
0000 to 10011, but in BCD, it should be from 0000 to 1 1001, the first 1 being a
carry and the next four bits being the BCD digit sum. When the binary sum is
less than 1010 (without a carry), the corresponding BCD digit is correct. But
when the binary sum is greater than or equal to 1010, the result is an invalid
BCD digit. The addition of binary 6, (0110)2, to the sum converts it to the correct
digit and also produces a decimal carry as required. The reason is that the differ-
ence between a carry from the most significant bit position of the binary sum and
a decimal carry is 16  10  6. Thus, the decimal carry and the correct BCD sum
ManoCh01v4.fm Page 25 Wednesday, May 2, 2007 6:11 PM

1-5 / Alphanumeric Codes 25

digit are forced by adding 6 in binary. Consider the next three-digit BCD addi-
tion example.

EXAMPLE 1-8 BCD Addition

110 BCD carry 1 1


448 0100 0100 1000
489 0100 1000 1001
937 Binary sum 1001 1101 1 0001
Add 6 0110 0110
BCD sum 1 0011 1 0111
BCD result 1001 0011 0111

In each position, the two BCD digits are added as if they were two binary numbers.
If the binary sum is greater than 1001, we add 0110 to obtain the correct BCD digit
sum and a carry. In the right column, the binary sum is equal to 17. The presence of
the carry indicates that the sum is greater than 16 (certainly greater than 9), so a
correction is needed. The addition of 0110 produces the correct BCD digit sum,
0111 (7), and a carry of 1. In the next column, the binary sum is 1101 (13), an
invalid BCD digit. Addition of 0110 produces the correct BCD digit sum, 0011 (3),
and a carry of 1. In the final column, the binary sum is equal to 1001 (9) and is the
correct BCD digit. ■

1-5 ALPHANUMERIC CODES


Many applications of digital computers require the handling of data consisting not
only of numbers, but also of letters. For instance, an insurance company with thou-
sands of policyholders uses a computer to process its files. To represent the names
and other pertinent information, it is necessary to formulate a binary code for the
letters of the alphabet. In addition, the same binary code must represent numerals
and special characters such as $. Any alphanumeric character set for English is a
set of elements that includes the ten decimal digits, the 26 letters of the alphabet,
and several (more than three) special characters. If only capital letters are
included, we need a binary code of at least six bits, and if both uppercase letters
and lowercase letters are included, we need a binary code of at least seven bits.
Binary codes play an important role in digital computers. The codes must be in
binary because computers can handle only 1s and 0s. Note that binary encoding
merely changes the symbols, not the meaning of the elements of information being
encoded.

You might also like