Step 1) Calculation of the number of redundant bits Once the receiver gets an incoming message, it performs recalculations to detect errors and correct them. Hence, the message sent will be 11000101100. The values of redundant bits will be as follows − R 3 is the parity bit for all data bits in positions whose binary representation includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so on)Įxample 3 − Suppose that the message 1100101 needs to be encoded using even parity Hamming code. R 2 is the parity bit for all data bits in positions whose binary representation includes a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on) R 1 is the parity bit for all data bits in positions whose binary representation includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and so on) It covers all bit positions whose binary representation includes a 1 in the i th position except the position of r i. Odd Parity − Here the total number of bits in the message is made odd.Įach redundant bit, r i, is calculated as the parity, generally even parity, based upon its bit position. The two types of parity are −Įven Parity − Here the total number of bits in the message is made even. A parity bit is an extra bit that makes the number of 1s either even or odd. They are referred in the rest of this text as r 1 (at position 1), r 2 (at position 2), r 3 (at position 4), r 4 (at position 8) and so on.Įxample 2 − If, m = 7 comes to 4, the positions of the redundant bits are as follows − The r redundant bits placed at bit positions of powers of 2, i.e. The total number of bits in the encoded message, (m + r) = 11. m = 7, the minimum value of r that will satisfy the above equation is 4, (2 4 ≥ 7 + 4 + 1). Thus the following equation should hold −Įxample 1 − If the data is of 7 bits, i.e. Since, r bits can indicate 2 r states, 2 r must be at least equal to (m + r + 1). Here, (m + r) indicates location of an error in each of bit positions and one additional state indicates no error. If the message contains m number of data bits, r number of redundant bits are added to it so that is able to indicate at least (m + r + 1) different states. Once the redundant bits are embedded within the message, this is sent to the destination. Step 3 − Calculating the values of each redundant bit. Step 1 − Calculation of the number of redundant bits. The procedure used by the sender to encode the message encompasses the following steps −
HOW TO ENCODE A MESSAGE IN BLOCK PARITY CODE CODE
The procedure for single error correction by Hamming Code includes two parts, encoding at the sender’s end and decoding at receiver’s end. When the destination receives this message, it performs recalculations to detect errors and find the bit position that has error.
These redundant bits are extra bits that are generated and inserted at specific positions in the message itself to enable error detection and correction. In this coding method, the source encodes the message by inserting redundant bits within the message. Hamming code is a block code that is capable of detecting up to two simultaneous bit errors and correcting single-bit errors.