Questions tagged [hamming-code]

Refers to a class of linear error-correcting data encoding schemes, but is often used to refer to the specific scheme Hamming(7,4) invented in 1950 by Richard W. Hamming.

In telecommunication theory, Hamming codes refer to a family of linear error-correcting codes that generalize the Hamming(7,4)-code invented by Richard Hamming in 1950. Hamming codes can detect up to two-bit errors or correct one-bit errors without detection of uncorrected errors. By contrast, the simple parity code cannot correct errors, and can detect only an odd number of bits in error. Hamming codes are perfect codes, that is, they achieve the highest possible rate for codes with their block length and minimum distance 3.1


  1. I basically ripped this out of the wikipedia page.
96 questions
15
votes
6 answers

How does the Hamming code work?

When transmitting data, the Hamming code apparently allows you to recreate data that has been corrupted over the wire (an error correcting code). How does this work and what are its limitations, if any? Are there any better solutions for error…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
8
votes
1 answer

What is the minimum number of bits needed to correct all 2 bit errors?

I learned about hamming codes and how to use them to correct 1 bit errors and detect all 2 bit errors, but how extend this to correcting 2 bits, and maybe more? What is the minimum number of bits needed to correct all 2 bit errors?
user623879
  • 4,066
  • 9
  • 38
  • 53
7
votes
4 answers

I wrote this Hamming Encoding code for class. Why is it so slow?

I wrote this for my OS class: #include #include //encodes a file using the (8,4) Hamming Code. //usage : HammingEncode.out < inputFile > outputFile int main() { unsigned char const codebook[] = {0x00, 0x1E, 0x2D, 0x33,…
Jon Cohen
  • 445
  • 3
  • 16
7
votes
2 answers

bool multiplication with exclusive-or, not or (with Eigen Matrix Library)

I'm trying to implement hamming error correcting codes, and to do this I need to take a bool Vector (the data) and multiply it with a bool Matrix(hamming generator matrix), performing XOR operations (instead of what looks like OR as Eigen's default…
keith gould
  • 403
  • 1
  • 4
  • 10
6
votes
5 answers

How to calculate the parity bit of the following bit sequence?

The sequence is: 00111011 How do i calculate the parity bit for the above sequence? This question is from Databases- The complete book by jeffery ullman (Exercise 13.4.1 a) I am not sure what the answer to this question should be. Is it as simple as…
Nikhil
  • 1,279
  • 2
  • 23
  • 43
4
votes
4 answers

What causes a segmentation fault (core dump) to occur in C?

I am trying to write a Hamming code program in C. However, I keep getting a Segmentation Fault(Core Dumped) error when trying to run the ./a.out after compiling. It compiles with no errors, and I understand that this error can occur when trying to…
V.Bean
  • 65
  • 1
  • 1
  • 5
4
votes
2 answers

C# hamming encoded serial output

I'm trying to talk to a RS232 device that expects hamming encoded ASCII characters. The following table is provided by the manufacturer: Byte Encoded 0 15 1 02 2 49 3 5E 4 64 5 73 6 38 7 2F 8 …
Quantum_Kernel
  • 303
  • 1
  • 7
  • 19
3
votes
1 answer

WHY the result I calculated is different from what matlab calculated?

Here's matlab's answer: x=[1,0,1,1] x_encode=encode(x,7,4) >>x_encode [1,0,0,1,0,1,1] I calculated the hamming code from definition of hamming code, here's my calculation…
Jay Kwok
  • 31
  • 2
3
votes
1 answer

CRC/Parity/Hamming Protect 16-bit parallel bus

I've got a Cortex-M4 based MCU linked to a FPGA via a 16-bit parallel memory bus interface. In essence the FPGA behaves like an external memory mapped to the memory space of the MCU: the MCU presents an address followed by either a data word (write)…
Arne
  • 1,111
  • 2
  • 11
  • 22
3
votes
1 answer

Algorithms: data binarization

I have a huge dataset with words word_i and weights weight[i,j], where weight is the "connection strength" between words. I'd like to binarize this data, but I want to know if there is any existing algorithm to make binary code of each word in such…
Ivri
  • 2,159
  • 5
  • 25
  • 33
3
votes
2 answers

Single-Byte Error Correction

A 200 byte message has one random byte corrupted. What's the most efficient way to fix the corrupt byte? A Hamming(255,247) code has 8 bytes of overhead, but is simple to implement. Reed-Solomon error correction has 2 bytes of overhead, but is…
rmmh
  • 6,997
  • 26
  • 37
2
votes
1 answer

Hamming code in Matlab

I would like to build Hamming(15, 11) code with parity bit (SECDED) to correct 1 bit errors and detect 2-bit errors. Are there any Matlab function that implement encoding and decoding of such code?
alexey
  • 8,360
  • 14
  • 70
  • 102
2
votes
2 answers

Error correction on small message (8-Bit) with high resilience, what is the best method?

I need to implement an ECC algorithm on an 8-bit message with 32 bits to work with (32, 8), being new to ECC I started to google and learn a bit about it and ended up coming across two ECC methods, Hamming codes and Reed Solomon. Given that I needed…
2
votes
2 answers

Python code stops outputting during/after print statement, but the same part of code works when isolated as its own program. What's going on?

I am trying to implement my own version of Hamming code with even parity (as shown here, except I'm starting counting the bits from left to right, rather than right to left) in Python. My code is as follows: # Python program to demonstrate Hamming…
The Pointer
  • 2,226
  • 7
  • 22
  • 50
2
votes
1 answer

Error detection techniques accuracy

I can't find information on the accuracy of different error detection techniques. Say if I want to be able to correct 1, 2, or 3 bit errors in 32-bit word, then I can use a modified Hamming code with 7 redundant bits. But what about other coding…
Vladimir Keleshev
  • 13,753
  • 17
  • 64
  • 93
1
2 3 4 5 6 7