Log in Sign up
Back to Discover
💻

Hamming code

technology Maturity 7-9

Computers use special codes.

Hamming(7,4).svg
Hamming(7,4).svg
These codes fix mistakes. Sometimes a computer gets a wrong bit. These codes find the wrong bit. Then they fix it fast. This helps computers work well. Do you like computers?

36 words

Computers use codes to fix mistakes.

Hamming(7,4).svg
Hamming(7,4).svg
Sometimes, a bit gets a wrong value. This can happen in computer memory. A man named Richard Hamming made a way to fix this. His code can find the wrong bit. Then, it can fix the bit. This helps the computer keep working. It is much faster than starting over. These codes are still used today. They help keep computer data safe and correct.

71 words

Computers use bits to store data. Sometimes, a bit flips to the wrong value. This is called an error. In 1950, Richard Hamming made a way to fix this. He wanted to stop computers from stopping when errors happened.

Hamming(7,4).svg
Hamming(7,4).svg

Before his work, people used a simple parity code. This code adds one extra bit to check for mistakes. It can tell if an error happened. But it cannot fix the mistake. It also cannot tell which bit is wrong. The computer must start the whole job over. This takes a lot of time.

Hamming codes are much better. They are error-correcting codes. This means they can find and fix a wrong bit. They do this by adding special bits called parity bits. These bits overlap. Each data bit is checked by many different parity bits.

Hamming(7,4).svg
Hamming(7,4).svg

If one bit changes, the code finds its exact spot. Then, it fixes it. This is very useful for computer memory. We call this ECC memory. It helps keep data safe and keeps the computer running fast.

174 words

Computers use bits to store and move information. Sometimes, a bit flips from a zero to a one, or a one to a zero. This is called an error. These mistakes can cause a computer to stop working or give the wrong answer. Hamming codes are a special way to fix these errors. They belong to a family of error-correcting codes. These codes are very important for keeping digital information safe and accurate.

Hamming(7,4).svg
Hamming(7,4).svg

To fix errors, Hamming codes use extra bits called parity bits. These bits work like a clever overlapping check. Each data bit is checked by several different parity bits at once. If one bit flips, the different parity bits will show a specific pattern of mistakes. This pattern acts like a map. It tells the computer exactly which bit is wrong. Once the computer finds the wrong bit, it can flip it back to the right value. This happens automatically without needing a person to help.

Hamming(7,4).svg
Hamming(7,4).svg

Richard Hamming invented these codes in 1950. He worked at Bell Labs during the late 1940s. At that time, he used a machine called the Bell Model V. This machine used electromechanical relays to work. People fed information into it using paper tape with small holes. If the machine found an error, it would stop and flash lights. This was very frustrating for Hamming when he worked on weekends. He did not want to restart his whole program every time a mistake happened.

Hamming(7,4).svg
Hamming(7,4).svg

There are many different types of Hamming codes. One famous version is the Hamming(7,4) code. This code uses seven bits in total. Four of those bits are the actual data, and three are parity bits. Hamming also studied the "distance" between codes. This is called the Hamming distance. A code with a distance of three can fix one-bit errors. Some special versions, called extended Hamming codes, use an extra bit. These can find two-bit errors and fix one-bit errors.

Hamming(7,4).svg
Hamming(7,4).svg

You can see these codes working in your own devices. Many computers use a special kind of memory called ECC memory. ECC stands for error-correcting code memory. It uses Hamming codes to keep the computer running smoothly. Without this, tiny errors in the memory could crash your computer. It is a way to make sure the digital world stays reliable. This clever math helps technology work even when small mistakes occur.

Hamming(7,4).svg
Hamming(7,4).svg

397 words

Hamming codes are a specific family of linear error-correcting codes used in computer science. These mathematical systems allow computers to detect and fix errors that occur during data transmission or storage. In digital systems, an error happens when a bit flips from a zero to a one, or vice versa. While simple parity codes can detect that an error occurred, they cannot identify which bit is wrong. Hamming codes solve this by adding specific redundancy to the data. This allows a system to locate the exact position of a single-bit error and correct it automatically.

Hamming(7,4).svg
Hamming(7,4).svg

The mechanism of a Hamming code relies on the strategic placement of parity bits. A parity bit is an extra bit added to a block of data to check for mistakes. In a Hamming code, these parity bits are placed at specific positions that are powers of two. For example, bit positions 1, 2, 4, and 8 are reserved for parity bits. All other positions are used for the actual data bits. Each data bit is covered by a unique set of parity bits. This coverage is determined by the binary form of the bit's position. Because the parity bits overlap, they create a mathematical map of the entire block.

Hamming(7,4).svg
Hamming(7,4).svg

When a receiver checks a Hamming code, it calculates the index-XOR of the bit positions. The index-XOR is found by performing an XOR operation on the positions of all bits containing a one. If the result is zero, the receiver concludes there were no errors. If the result is non-zero, the resulting value indicates the exact index of the corrupted bit. This allows the computer to flip the incorrect bit back to its original state. This process is highly efficient because it requires very little extra space. It provides a much higher code rate than simpler methods like repetition codes.

Hamming(7,4).svg
Hamming(7,4).svg

Richard Hamming invented these codes in 1950 while working at Bell Labs. During the late 1940s, he worked with the Bell Model V computer. This was an electromechanical machine that used relays and punched paper tape. The tape was seven-eighths of an inch wide and had up to six holes per row. When the machine detected an error, it would stop and flash lights for operators. Hamming found this process very frustrating, especially when working on weekends without operators. He grew tired of restarting entire programs just because of a single bit error. He famously asked why a machine could detect an error but not locate it.

Hamming(7,4).svg
Hamming(7,4).svg

There are several distinct types and variations of Hamming codes. The most famous is the Hamming(7,4) code. This specific code uses a block length of seven bits. Within those seven bits, four are used for data and three are parity bits. Hamming also defined the concept of Hamming distance. This is the minimum number of bit changes needed to turn one valid code word into another. A code with a distance of three can correct one-bit errors. An extended Hamming code adds one extra parity bit to the block. This increases the Hamming distance to four. This allows for SECDED, which stands for single-error correcting and double-error detecting.

Hamming(7,4).svg
Hamming(7,4).svg

These codes are vital for modern computing, especially in computer memory. Many systems use ECC memory, which stands for error-correcting code memory. In RAM, bit errors are extremely rare but can still cause crashes. ECC memory uses Hamming codes to ensure these rare errors do not disrupt the system. The efficiency of these codes is measured by the code rate. The code rate is the number of data bits divided by the total block length. For a (7,4) code, the rate is 4/7. This is much more efficient than a repetition code, which might have a rate as low as 1/3.

Hamming(7,4).svg
Hamming(7,4).svg

Understanding Hamming codes helps us see the connection between mathematics and reliable technology. They represent a solution to the problem of noise in communication and storage. Before Hamming, methods like the two-out-of-five code or simple parity were common. However, these methods could not correct errors and often required data to be re-transmitted. Hamming's work turned error detection into error correction. This transition allowed for the development of much faster and more complex digital systems. Today, the principles of Hamming distance and linear codes remain fundamental to telecommunications and data science.

717 words
🖼️ Images & Media (1)
File:Hamming(7,4).svg
Hamming(7,4).svg
Up Next
💻
Error correction code
Technology
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.