Jan 21&29(HD) Flashcards

1
Q

What is the Hamming Distance of real-life Hamming code? Explain how you know. Also, how many errors can be detected and corrected by Hamming code?

A

The Hamming distande of real-life Hamming code is 3 bits. This is because each bit change in the dataword will change at least 3 bits in the codeword. 1 for the data bit, and 2 for the lowest number of parity bits checking the data bit. Hamming code can detect errors of up to 2 bits, and correct errors of up to 1 bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If the Hamming distance of a code is R bits, how many bit errors can it detect and correct? Why not more than those amounts?

A

It can detect R-1(inclusive) because an error in R bits will result in a valid codeword which can’t be detected. For correction, it can fix errors in up to (R-1)/2 bits. If there are more errors than this, the system might mistakenly ‘correct’ the data to the wrong sequence, which is not the original intended data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define Hamming distance.

A

The minimum number of bits different between any 2 valid words in a code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

codeA:
only 00000000 and 11111111 are valid.

codeB: 00000000 and 11111111 are invalid.

?Which one is better for detecting and correcting errors and why?

A

Code A is better for finding and fixing small errors compared to Code B. It works well when there are minor changes. For example, if the original code is 00000000 and it changes a little, like to 00100000 or 01001000, Code A can correct these errors. However, it’s not as effective with bigger errors. It can’t fix situations where 00000000 changes to something very different, like 00001111 or 11111110. In short, Code A is good for small errors but not for large or complex ones.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why must numbers be stored in the same direction across different system, but letters in strings don’t require the same consistency?

A

Numbers require consistent byte ordering because their value is dependent on the sequence of bytes(e.g. an integer is typically 4 bytes). A change in byte order can alter the numerical value. In contrast, each character in a string is independent and typically 1 byte, and its meaning is not affected by byte order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Do we want a small or large Hamming distance? Why?

A

Larger Hamming distance. Because Hamming Distance refers to The minimum number of bits different between any 2 valid words in a code, so that indicates a greater difference between valid words, resulting in an increased capacity to detect and correct errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If a code has a Hamming distance of 14 bits, how many errors can it detect? Why not more than that?

A

13 errors are detectable because 14 errors are actually a valid word.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which data bits are checked by bit4 in a 21-bit codeword? Explain how you know.

A

But 5,6,7,12,13,14,15,20, and 21 because they can be broken down into power of 2 that include 2^2=4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly