Error Detection
Error Detection
ARCHITECTURE
Presented by
Prof. Salwan Tajjour
1
DATA
REPRESENTATION
Error Detection
Parity
Hamming code
Contents
2
ERROR DETECTING CODES
Binary information transmitted through some form of communication medium is
subject to external noise that could alters certain bits. (0 to 1 and vice versa).
An error detection code is a binary code that detects digital errors during
transmission (cannot correct).
If the error is too often, the system is checked for mal function.
The most common error detection code used is the parity bit . A
parity bit is an extra bit included with a binary message to make
the total number of 1’s either odd or even. The P(odd) bit is
chosen in such a way as to make the sum of 1's (in all four bits)
odd . The P(even) bit is chosen to make the sum of all 1's even. In
either case, the sum is taken over the message and the P bit. In
any particular application, one or the other type of parity will be
adopted. The even-parity scheme has the disadvantage of having a
bit combination of all O’s, while in the odd parity there is always
one bit (of the four bits that constitute the message and P) that is
1. Note that the P(odd) is the complement of the P(even).
Even/Odd Parity
Even Parity Odd Parity
One bit is attached to the
information so that the total One bit is attached to the
number of 1 bits is an even information so that the total
number number of 1 bits is an odd
number
Message Parity
Message Parity
10110010
10110011
1010010 1
1010010 0
20
Parity generator
21
Hamming Code
• Hamming code is a block code that is
capable of detecting up to two
simultaneous bit errors and correcting
single-bit errors.
• Redundant bits are extra binary bits that
are generated and added to the
information-carrying bits of data transfer
to ensure that no bits were lost during
the data transfer.
• The number of redundant bits can be
calculated using the following formula:
2^p ≤ m + p + 1
where:
p = redundant bit
m = data bit
Encoding messages By Hamming
Code
1 2 3
Calculating the Positioning the Calculating the
number of redundant bits value of each
redundant bits redundant bit.
Example
Generate Hamming code for
the message 1010 using even
parity.