Data Structures & Algorithms Multiple Choice Questions on “Hamming Code”.
1. The most common hamming codes are a generalized version of? Answer: a 2. What is the minimal Hamming distance between any two correct codewords? Answer: c 3. Why do we require hamming codes? Answer: a 4. Hamming codes can be used for both single-bit error and burst error detection and correction. Answer: b 5. Who invented Hamming codes? Answer: a 6. What is the total block length ‘n’ of a Hamming code? Answer: b 7. What is the message length ‘k’ of a Hamming(7,4) code? 8. What is the rate of hamming codes? Answer: a 9. A two-out-of-five code consists of _________ Answer: b 10. Including a parity bit along with the data surely detects the errors. Answer: b 11. ________ is the mechanism of sending data bits multiple times to ensure consistency. Answer: a 12. An Extended hamming code is also called as __________ Answer: c 13. What is the code rate of a repetition Hamming code (3, 1)? Answer: c 14. For a hamming code of parity bit m=8, what is the total bits and data bits? Answer: a 15. What is the rate of the hamming code of parity bit m=8?
a) Hamming(7, 4) code
b) Hamming(8, 4) code
c) Hamming(6, 3) code
d) Hamming(5, 7) code
Clarification: The most common hamming codes generalize to form hamming(7, 4) code. It encodes four bits of data into seven bits by adding three parity bits.
a) 1
b) 2
c) 3
d) 4
View Answer
Clarification: Since we use a generalized version of Hamming(7, 4) code, the minimal hamming distance is 3. It cannot correct burst errors.
a) Error correction
b) Encryption only
c) Decryption
d) Bit stuffing
Clarification: Hamming codes are used for the purpose of error detection and correction. It is also used for channel encoding and decoding. They are linear-error correcting codes.
a) True
b) False
Clarification: Hamming bits are suitable only for single-bit error detection and correction and two bit error detection. It is very unlikely to detect burst errors.
a) Richard Hamming
b) Ross Hamming
c) Shannon
d) Huffman
Clarification: Richard W. Hamming invented hamming codes in Bell Telephone Laboratory to minimize the errors in punched card readers. Huffman invented huffman codes. Shannon invented Shannon-Fanno codes.
a) 2r
b) 2r-1
c) 2r-1-1
d) 2r+1
View Answer
Clarification: Hamming codes are a class of binary linear codes, hence r>=2. For a hamming(7, 4) code, the block length ‘n’ is 2r-1 where r is the parity bit. Here, r=3.
a) 2r-1
b) 2r-r+1
c) 2r-r-1
d) 2r+1-r
Answer: c
Clarification: Hamming codes are a class of binary linear codes, hence r>=2. For a hamming(7,4) code, the message length ‘k’ is 2r-r-1 where r is the parity bit. Here, r=3.
a) 1-[r/(2r-1)]
b) 1-(r/2r)
c) 1+(r/2r)
d) r/2r+1
Clarification: Rate of a hamming code is message length divided by block length (i.e.) 2r-r-1/2r-1 = 1-[r/(2r-1)]. It is the highest rate for a minimum distance of three.
a) Two 0s and three 1s
b) Three 0s and two 1s
c) Four 0s and one 1s
d) One 0s and four 1s
Clarification: A two-out-of-five code consists of three 0s and two 1s. Hence, it contains ten possible combinations to represent digits from 0-9.
a) true
b) false
Clarification: If error has occurred in a data string, parity will change inorder to indicate errors. However, if the error occurs in parity bit, the error goes undetected.
a) Repetition
b) Duplication
c) Mirroring
d) Redundancy
Clarification: Repeating data bits multiple times is done to ensure consistency. If the data bit to be sent is a 1, a n=3 repetition code will send 111. If the bits are not the same, an error has occurred.
a) SEDDEC
b) SEDDED
c) SECDED
d) SECDEC
Clarification: An Extended Hamming code is also called as SECDED (Single Error Correction Double Error Detection). The most popular codes are (72, 64) code and (127,120) code.
a) 1
b) 3
c) 1/3
d) 1.3
Clarification: The code rate of a repetition hamming code is the second number divided by the first number. Here, it is 1/3.
a) (255, 247)
b) (127, 119)
c) (31, 26)
d) (0, 8)
Clarification: Total bits are computed as, 2m-1 = 28-1 =255.
Data bits are computed as 2m-m-1= 28-8-1= 247.
a) 0.94
b) 0.92
c) 0.90
d) 0.97
Answer: d
Clarification: For a hamming code of parity bit 8, total bits = 255 and data bits = 247. Rate= data bits/ total bits
= 247/255 = 0.969 = 0.97.