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

Lecture 2 Complement & Error Detecting Code.pptx

The document discusses digital logic design, focusing on addition and subtraction using 2's complement and error-detecting codes. It explains the concept of parity bits for ensuring data integrity in communication, detailing the process of generating and checking parity bits during data transmission. An example illustrates how parity checks can detect errors in transmitted data.

Uploaded by

x2jc497zf9
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)
10 views

Lecture 2 Complement & Error Detecting Code.pptx

The document discusses digital logic design, focusing on addition and subtraction using 2's complement and error-detecting codes. It explains the concept of parity bits for ensuring data integrity in communication, detailing the process of generating and checking parity bits during data transmission. An example illustrates how parity checks can detect errors in transmitted data.

Uploaded by

x2jc497zf9
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/ 61

Digital Logic Design

Daniyal Adeeb
Recall : Addition and Subtraction with 2’s Complement

0101 +5 0101 +5
0010 +2 1110 -2
0111 +7 10011 +3

1011 -5 1011 -5
1110 -2 0010 +2
11001 -7 1101 -3
Recall : Addition and Subtraction with 2’s Complement

2’s Complement Signed Binary


0101 +5 0101 +5
0010 +2 0010 +2
0111 +7 0111 +7

1011 -5 1101 -5
1110 -2 1010 -2
11001 -7 10111 -7
Recall : Addition and Subtraction with 2’s Complement

0101 +5 0101 +5
1110 -2 1010 -2
10011 +3 1111 +3

1011 -5 1101 -5
0010 +2 0010 +2
1101 -3 1111 -3
Error-Detecting Code
● Error-detecting codes ensure data integrity during communication and processing.
● ASCII characters often use an additional eighth bit, known as a parity bit, for error detection.

Understanding Parity Bits

● Parity Bit: An extra bit added to a binary message to ensure the total number of 1’s is even or odd.
● Even Parity: Total number of 1’s is even.
● Odd Parity: Total number of 1’s is odd.

Parity Bits for ASCII Characters

● The leftmost bit is the parity bit.


● Ensures consistency in the total count of 1’s according to the chosen parity type.
Error-Detecting Code
Error Detection Process
1. Sending End
○ Generates an even parity bit for each character.
○ Transmits the 8-bit character (7 bits + parity bit).
2. Receiving End
○ Checks the parity of each received character.
○ If parity is incorrect, an error is detected.
Error-Detecting Code
Error Detection Process
Sending End:
1. Character to Transmit: Let's say the character we want to transmit is "A".
2. Binary Representation: The ASCII value of "A" is 65, which in binary is: 01000001
3. Even Parity Calculation:
● Count the number of 1's in the binary representation of "A" (01000001).
● There are two 1's (at positions 7 and 1).
● Since the number of 1's is already even (2 is even), we don't need to change anything.
● To maintain even parity, the parity bit is 0.

Transmitted Data: The character "A" with the parity bit becomes: 010000010 (7 bits for the character + 1
parity bit)
Receiving End:
1. Received Data: The receiver receives the data 010000010.

2. Parity Check:
○ The receiver checks the number of 1's in the received 8-bit string (010000010).
○ There are two 1's in the string, which is an even number.
○ Since the parity is correct (even), no error is detected.
Error-Detecting Code
Example of Error in Transmission:
Now, let's assume an error occurs during transmission and the receiver gets the wrong data:
Received Data: The receiver receives 010000011 (the last bit has been flipped).
1. Received Data: 010000011

2. Parity Check:

○ The receiver checks the number of 1's in the received 8-bit string (010000011).
○ There are three 1's in the string, which is an odd number.
○ Since the parity is incorrect (odd instead of even), the receiver detects an error.
Home Assignment (Ungraded)
1.14,1.15
from Digital design by Morris Mano 5th edition

You might also like