KEMBAR78
Part 3 CH 2.10-2.12 - Recorded Presentation | PDF | Binary Coded Decimal | Error Detection And Correction
0% found this document useful (0 votes)
15 views20 pages

Part 3 CH 2.10-2.12 - Recorded Presentation

pk

Uploaded by

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

Part 3 CH 2.10-2.12 - Recorded Presentation

pk

Uploaded by

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

2–10 Binary Coded Decimal (BCD)

Decimal Binary BCD


0 0000
0000 0001
 Binary coded decimal (BCD) is a weighted 1 0010
0001 0011
code that is commonly used in digital
2
4 0100
systems when it is necessary to show 0010
0100 0101
3
5 0011 0110
decimal numbers such as in clock displays.
0101 0111
 The table illustrates the difference between 6 0110 1000
7 0111 1001
straight binary and BCD. BCD represents 8 1000 00010000
each decimal. 11
9 00010001
1011
1001 00010010
 digit with a 4-bit code.
12
10 00010011
1100
1010 00010100
13 00010101
1101
Floyd, Digital Fundamentals, 2015 14 1110
The 8421 BCD Code
The 8421 code is a type of BCD (binary coded decimal) code.

Invalid Codes
With four bits, 16 numbers (0000 through
1111) can be represented but that, in the
8421 code, only ten of these are used.
The six code combinations that are not
used are invalid in the 8421 BCD code.

Floyd, Digital Fundamentals, 2015


BCD Addition
 Add the two BCD numbers.
 If a 4-bit sum is 9, it is a valid BCD number.
 If a 4-bit sum is 9, or if a carry out of the 4-bit group is
generated, it is an invalid result. Add 6 (0110) to the 4-bit sum in
order to skip the six invalid states and return the code to 8421. If
a carry results when 6 is added, simply add the carry to the next
4-bit group.

Floyd, Digital Fundamentals, 2015


Floyd, Digital Fundamentals, 2015
Floyd, Digital Fundamentals, 2015
Applications
Digital clocks, digital thermometers, digital meters, and other
devices with seven-segment displays typically use BCD code to
simplify the displaying of decimal numbers.
2–11 Digital Codes
Decimal Binary Gray code
Gray code 0 0000
0000 0001
1 0011
 Gray code is an unweighted code that
0001 0010
4
2 0110
has a single bit change between one
0100
0010 0111
code word and the next in a sequence. 5
3 0011 0101
0101 0100
 Gray code is used to avoid problems 6 0110 1100
7 0111 1101
in systems where an error can occur if 8 1000 1111
11
9 1110
more than one bit changes at a time. 1011
1001 1010
12
10 1011
1100
1010 1001
13 1000
1101
Floyd, Digital Fundamentals, 2015 14 1110
Binary-to-Gray Code Conversion
The following rules explain how to convert from a binary number to a
Gray code word:

1. The most significant bit (left-most) in the Gray code is the same
as the corresponding MSB in the binary number.
2. Going from left to right, add each adjacent pair of binary code
bits to get the next Gray code bit. Discard carries.

For example, the conversion of the binary number 10110 to


Gray code is as follows:

The Gray code is 11101.


Gray-to-Binary Code Conversion
The following rules apply:

1. The most significant bit (left-most) in the binary code is the same
as the corresponding bit in the Gray code.
2. Add each binary code bit generated to the Gray code bit in the
next adjacent position. Discard carries.

For example, the conversion of the Gray code word 11011 to


binary is as follows:

The binary number is 10010.

Floyd, Digital Fundamentals, 2015


Floyd, Digital Fundamentals, 2015
ASCII

 using numbers to represent text.


 ASCII is a code for alphanumeric characters and control characters. In its
original form, ASCII encoded 128 characters and symbols using 7-bits.
 The first 32 characters are control characters, that are based on obsolete
teletype requirements, so these characters are generally assigned to other
functions in modern usage.
 In 1981, IBM introduced extended ASCII, which is an 8-bit code and
increased the character set to 256. Other extended sets (such as Unicode)
have been introduced to handle characters in languages other than
English.
2–12 Error Codes
Parity Method
Many systems use a parity bit as a means for bit error
detection.
• Any group of bits contain either an even or an odd number of 1s.
• A parity bit is attached to a group of bits to make the total
number of 1s in a group always even or always odd.
• An even parity bit makes the total number of 1s even, and
• an odd parity bit makes the total odd.

Floyd, Digital Fundamentals, 2015


The ASCII character for “a” is 1100001 and for “A” is
1000001. What is the correct bit to append to make both of
these have odd parity?
The ASCII “a” has an odd number of bits that are equal to 1;
therefore the parity bit is 0. The ASCII “A” has an even number
of bits that are equal to 1; therefore the parity bit is 1.

Detecting an Error

A parity bit provides for the detection of a single bit error (or any
odd number of errors, which is very unlikely) but cannot check for
For instance,
two let’sgroup.
errors in one assume that we wish to transmit the BCD code
0101. The total code transmitted, including the even parity bit, is

an error occurs
Make the parity bit either 1 or 0 as necessary to make the total
number of 1s even. The parity bit will be the left-most bit
(color).

Since odd parity is required, any group with an even number of


incorrect.
The following groups are in error: 110011 and 1100010101010.
Cyclic Redundancy Check
The cyclic redundancy check (CRC) is an error detection method that can
detect multiple errors in larger blocks of data. At the sending end, a
checksum is appended to a block of data. At the receiving end, the check
sum is generated and compared to the sent checksum. If the check sums are
the same, no error is detected.

Simply put, CRC is based on the division of two binary numbers; and,
as you know, division is just a series of subtractions and shifts. To do
subtraction, a method called modulo-2 addition can be used.

Floyd, Digital Fundamentals, 2015


1. CRC Process
The process is as follows:
2. Select a fixed generator code; it can have fewer bits than the
data bits to be checked.
3. Append a number of 0s equal to the number of bits in the
generator code to the data bits.
4. Divide the data bits including the appended bits by the generator
code bits using modulo-2.
5. If the remainder is 0, the data and appended bits are sent as is.
6. If the remainder is not 0, the appended bits are made equal to the
remainder bits in order to get a 0 remainder before data are sent.
7. At the receiving end, the receiver divides the incoming appended
data bit code by the same generator code as used by the sender.
8. If the remainder is 0, there is no error detected.
9. If the remainder is not 0, an error has been detected in the
transmission and a retransmission is requested by the receiver.
Since the generator code has four data bits, add
four 0s (blue) to the data byte.
Divide the appended data by the generator
code (red) using the modulo-2 operation until
all bits have been used.

Remainder = 0100. Since the remainder


is not 0, append the data with the four
remainder bits (blue). Then divide by the
generator code (red).

the remainder is 0, there is no error


detected.
Thank you
Stay safe and healthy

You might also like