Hamming Codes with error detection and Correction Part-1

Duration: 12 min

This video lesson is available to enrolled students.

Enroll to watch — Computer Networks

AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This lecture introduces Hamming codes as single-bit error-correcting block codes with minimum distance dmin = 3, enabling detection of up to two errors or correction of one error. The instructor defines the relationship between codeword length n, data bits k, and parity bits r using n = 2^r - 1 and k = 2^r - r - 1, illustrated with a bit-position table mapping parity bits p1, p2, p4, p8, and p16 to their covered data positions. A worked example constructs the Hamming code C(7, 4) for r = 3, placing parity bits at powers of two (positions 1, 2, and 4) and data bits in the remaining positions. Even parity is used: P1 checks positions 1, 3, 5, and 7; P2 checks 2, 3, 6, and 7; and P4 checks 4, 5, 6, and 7. The instructor demonstrates calculating parity bit values from a sample data word using binary arithmetic on the board, with curved lines visually linking each parity bit to its covered positions. The session focuses on encoding construction; error detection and correction procedures are implied by the title but not fully shown in sampled frames.

Chapters

  1. 0:00 2:00 00:00-02:00

    The lecture opens with the slide titled 'Hamming Codes,' stating that these codes are designed with dmin = 3, allowing detection of up to two errors or correction of one single error. The instructor presents the formulas n = 2^r - 1 and k = 2^r - r - 1, relating codeword length n to the number of parity bits r and data bits k. A table maps bit positions 1 through 20 to encoded data bits, showing parity bits p1, p2, p4, p8, and p16 at power-of-two positions with X marks indicating which data bits each parity bit covers. The phrase 'single-bit error-correcting code' is underlined as the focus of discussion.

  2. 2:00 5:00 02:00-05:00

    The instructor elaborates on the n-k-r relationship using a hand-drawn diagram with arrow segments labeled K and r, alongside the boxed formula k = 2^r - r - 1. The bit-position table remains visible, with the 'Parity bit coverage' column listing p1 through p16 highlighted in green. The instructor points across the table to explain how each parity bit's coverage spans specific data positions, reinforcing that parity bits occupy positions 1, 2, 4, 8, and 16 while data bits fill the remaining slots. Handwritten annotations appear on the right side of the board as the instructor begins working through numerical values.

  3. 5:00 10:00 05:00-10:00

    A new slide presents the worked example: 'For example, if r = 3, then n = 7 and k = 4. This is a Hamming code C(7, 4) with dmin = 3.' The instructor explains that parity bits are placed at positions equal to powers of two (2^0 = 1, 2^1 = 2, 2^2 = 4), yielding the codeword layout D4 D3 D2 P4 D1 P2 P1. Even parity rules are stated: 'For parity bit P1 we check position 1, 3, 5, 7,' 'For parity bit P2 we check position 2, 3, 6, 7,' and 'For parity bit P4 we check position 4, 5, 6, 7.' The instructor writes binary values on the board and points to specific columns in the table to compute each parity bit from the data bits.

  4. 10:00 11:58 10:00-11:58

    The instructor completes the encoding demonstration for C(7, 4), writing binary digits into a 7-bit codeword table with columns labeled D1, D2, D3, D4, P1, P2, and P4. Curved lines are drawn connecting each parity bit to the data positions it covers, visually illustrating the even-parity check groups. The instructor points to the binary representation on the right side of the board, showing how the parity bit values are determined by ensuring an even number of 1s in each checked group. This visual mapping reinforces how the codeword structure supports single-bit error detection and correction.

The lecture progresses from general principles to a concrete construction. First, the instructor establishes that Hamming codes achieve dmin = 3 through systematic placement of parity bits at power-of-two positions, governed by n = 2^r - 1 and k = 2^r - r - 1. The bit-position table serves as a recurring visual anchor, showing how each parity bit covers a specific subset of data and other parity positions. The transition to the C(7, 4) example grounds these formulas in a tangible 7-bit codeword. The even-parity check rules (P1: positions 1,3,5,7; P2: 2,3,6,7; P4: 4,5,6,7) are the operational core of encoding. The final curved-line diagrams connect abstract coverage rules to visual groupings, preparing students for the error detection and correction procedures that would follow in subsequent parts. Key exam-relevant takeaways include: parity bits always occupy power-of-two positions, the number of data bits is k = 2^r - r - 1, and each parity bit ensures even parity over its designated position set.

Loading lesson…