Skip to content

VLSIFacts

Let's Program the Transistors

  • Home
  • DHD
    • Digital Electronics
    • Fault Tolerant System Design
    • TLM
    • Verification
    • Verilog
    • VHDL
    • Xilinx
  • Embedded System
    • 8085 uP
    • 8086 uP
    • 8051 uC
  • VLSI Technology
    • Analog Electronics
    • Memory Devices
    • VLSI Circuits
  • Interview
    • Interview Experience
    • Training Experience
    • Question Bank
  • Notifications
  • QUIZ
  • Community
  • Job Board
  • Contact Us

Hamming Distance

Posted on March 19, 2023June 19, 2025 By vlsifacts No Comments on Hamming Distance

Hamming distance between two bit-strings of equal length is the number of bit positions at which they are different. In other words, Hamming distance is the number of mismatches at the same bit position between two same-length words.

For example:

Consider two 3-bit code words, 000 and 001. Here, the Hamming distance is 1, as both the words differ at only one-bit position from each other (at the LSB bit). In general, we use the following cubical figure to determine the Hamming distances between any pair of code words for 3-bit word size. In this figure, all such words that are having Hamming distance of 1 are situated at the adjacent vertices.

Considering 000 and 011, here, the Hamming distance is 2, as both the words differ at two-bit positions (two right bits). In the above figure, the code words that have Hamming distance of 2 can be reached by traversing two edges from one code word to the other one.

Distance of a Code

The Distance of a code is known as the minimum Hamming distance between any two valid code words. The Hamming distance, or the Distance of a code, is an important concept in error detection and correction. This determines the error detection as well as correction capability of the code.

Example – Code with 4 codewords – {001,010,100,111} : This code has a distance of 2, as any pair of code words differ by 2 bits from each other. Since the distance is 2, it can detect any single-bit error.

Example – Code with 2 codewords – {000,111} : This code has a distance of 3. In this case, any single or double-bit error can be detected. If double-bit errors are not likely to happen, then this code can correct any single-bit error along with any single-bit error detection.

To detect up to k-bit errors, the code distance should be at least k+1
To correct up to k-bit errors, the code distance should be at least 2k+1

Previous           Table of Content           Next

Spread the Word

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related posts:

  1. What are Code Words in case of Error Detection and Correction
  2. Hamming Codes
  3. Error Detection and Correction Codes
  4. Parity Code for Error Detection
Digital Electronics Tags:code words, error correction, error detection, hamming distance

Post navigation

Previous Post: Parity Code for Error Detection
Next Post: What are Code Words in case of Error Detection and Correction

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top Posts & Pages

  • ASCII Code
  • Different Coding Styles of Verilog Language
  • Truth Tables, Characteristic Equations and Excitation Tables of Different Flipflops
  • Circuit Design of a 4-bit Binary Counter Using D Flip-flops
  • NAND and NOR gate using CMOS Technology

Copyright © 2025 VLSIFacts.

Powered by PressBook WordPress theme

Subscribe to Our Newsletter

%d