Information Theory and Coding Basics

To convert a Gray code into an ordinary binary number, the most significant bit is used as it is, and each lower bit is found as the exclusive OR of the binary bit already found one position higher and the Gray code bit in the same position. Which of the following is the 4-bit Gray code 1101 converted into binary?

  1. A1001 (decimal 9)
  2. B1011 (decimal 11)
  3. C1101 (decimal 13)
Show answer and explanation

Answer: A. 1001 (decimal 9)

The most significant bit is 1, the next is 1 ⊕ 1 = 0, the next 0 ⊕ 0 = 0 and the least significant 0 ⊕ 1 = 1, so the binary number is 1001 (decimal 9). As a check, the exclusive OR of 1001 and 0100, which is 1001 shifted right by 1 bit, is 1101, the original Gray code. In the Gray code, adjacent values differ in only one bit, as in 8 = 1100, 9 = 1101 and 10 = 1111.

  • A. Correct. Finding 1, 1 ⊕ 1, 0 ⊕ 0 and 0 ⊕ 1 in turn gives 1001.
  • B. 1011 is the result of applying the binary-to-Gray conversion (exclusive OR of adjacent bits) to 1101; the conversion goes the wrong way.
  • C. 1101 is the value of the Gray code read as it is as a binary number.
Practice this topic Back to topic

Books on Information Theory and Coding Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Information Theory and Coding Basics questions

  1. Let the amount of information obtained on being told that an event of probability p has occurred be −log₂ p bits. Which of the following is the amount of information obtained on being told that an event of probability 1/8 has occurred?
  2. Which of the following correctly describes a property of the amount of information (−log₂ p on being told that an event of probability p has occurred)?
  3. A source emits the symbols A, B, C and D independently with probabilities 1/2, 1/4, 1/8 and 1/8. Which of the following is the entropy (average amount of information per symbol) of this source?
  4. Which of the following correctly pairs the maximum entropy of a source that emits 8 kinds of symbols with the condition under which it is reached?
  5. A binary source emits 0 with probability 0.9 and 1 with probability 0.1, independently. Take log₂ 0.9 ≈ −0.152 and log₂ 0.1 ≈ −3.32. Which of the following is closest to the entropy of this source?