250+ TOP MCQs on Hamming Code and Answers

Data Structures & Algorithms Multiple Choice Questions on “Hamming Code”.

1. The most common hamming codes are a generalized version of?
a) Hamming(7, 4) code
b) Hamming(8, 4) code
c) Hamming(6, 3) code
d) Hamming(5, 7) code

Answer: a
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.

2. What is the minimal Hamming distance between any two correct codewords?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Clarification: Since we use a generalized version of Hamming(7, 4) code, the minimal hamming distance is 3. It cannot correct burst errors.

3. Why do we require hamming codes?
a) Error correction
b) Encryption only
c) Decryption
d) Bit stuffing

Answer: a
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.

4. Hamming codes can be used for both single-bit error and burst error detection and correction.
a) True
b) False

Answer: b
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.

5. Who invented Hamming codes?
a) Richard Hamming
b) Ross Hamming
c) Shannon
d) Huffman

Answer: a
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.

6. What is the total block length ‘n’ of a Hamming code?
a) 2r
b) 2r-1
c) 2r-1-1
d) 2r+1
View Answer

Answer: b
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.

7. What is the message length ‘k’ of a Hamming(7,4) code?
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.

8. What is the rate of hamming codes?
a) 1-[r/(2r-1)]
b) 1-(r/2r)
c) 1+(r/2r)
d) r/2r+1

Answer: a
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.

9. A two-out-of-five code consists of _________
a) Two 0s and three 1s
b) Three 0s and two 1s
c) Four 0s and one 1s
d) One 0s and four 1s

Answer: b
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.

10. Including a parity bit along with the data surely detects the errors.
a) true
b) false

Answer: b
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.

11. ________ is the mechanism of sending data bits multiple times to ensure consistency.
a) Repetition
b) Duplication
c) Mirroring
d) Redundancy

Answer: a
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.

12. An Extended hamming code is also called as __________
a) SEDDEC
b) SEDDED
c) SECDED
d) SECDEC

Answer: c
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.

13. What is the code rate of a repetition Hamming code (3, 1)?
a) 1
b) 3
c) 1/3
d) 1.3

Answer: c
Clarification: The code rate of a repetition hamming code is the second number divided by the first number. Here, it is 1/3.

14. For a hamming code of parity bit m=8, what is the total bits and data bits?
a) (255, 247)
b) (127, 119)
c) (31, 26)
d) (0, 8)

Answer: a
Clarification: Total bits are computed as, 2m-1 = 28-1 =255.
Data bits are computed as 2m-m-1= 28-8-1= 247.

15. What is the rate of the hamming code of parity bit m=8?
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.

contest

Leave a Reply

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