All Exams Test series for 1 year @ ₹349 only
Question

What would be the gray code equal to the number 14?

The correct answer is

1001

Gray Code Conversion: Understanding the Process

The question asks to find the Gray code equivalent of the decimal number 14. Gray codes are a type of non-weighted binary code where two successive values differ in only one bit. This unique property makes them very useful in various digital applications, especially in preventing errors that can occur during transitions in position encoders or other systems where multiple bits might change simultaneously.

To convert a decimal number into its Gray code equivalent, we typically follow a two-step process:

  1. First, convert the decimal number to its binary equivalent.
  2. Then, convert the binary number to its Gray code equivalent.

Decimal to Binary Conversion for 14

Let's convert the decimal number \(14_{10}\) into its binary representation. We do this by repeatedly dividing the decimal number by 2 and noting the remainders, reading them from bottom to top.

Division Quotient Remainder
14 ÷ 2 7 0
7 ÷ 2 3 1
3 ÷ 2 1 1
1 ÷ 2 0 1

Reading the remainders from bottom to top, the binary equivalent of \(14_{10}\) is \(1110_2\).

Binary to Gray Code Conversion

Now that we have the binary number \(1110_2\), we will convert it to its Gray code equivalent. The rules for converting a binary number \(B_n B_{n-1} \dots B_1 B_0\) to a Gray code \(G_n G_{n-1} \dots G_1 G_0\) are as follows:

  • The most significant bit (MSB) of the Gray code is the same as the MSB of the binary number: \(G_n = B_n\).
  • Each subsequent Gray code bit is obtained by performing an exclusive-OR (\(\oplus\)) operation between the corresponding binary bit and the next higher binary bit: \(G_i = B_{i+1} \oplus B_i\).

Let's apply these rules to our binary number \(1110_2\):

  • Binary: \(B_3 B_2 B_1 B_0\) = \(1110\)
  • Gray Code: \(G_3 G_2 G_1 G_0\)

Step-by-step conversion:

  • For \(G_3\): \(G_3 = B_3 = 1\). (The MSB remains the same)
  • For \(G_2\): \(G_2 = B_3 \oplus B_2 = 1 \oplus 1 = 0\).
  • For \(G_1\): \(G_1 = B_2 \oplus B_1 = 1 \oplus 1 = 0\).
  • For \(G_0\): \(G_0 = B_1 \oplus B_0 = 1 \oplus 0 = 1\).

Combining these bits, the Gray code equivalent of \(1110_2\) (which is \(14_{10}\)) is \(1001_G\).

Therefore, the Gray code equal to the number 14 is 1001.

Was this answer helpful?

Important Questions from Binary Codes

  1. Which of the following is/are the popular techniques for error detection?

  2. What is maximum number represented by 4 bit BCD code?
  3. A code in which each decimal digit is represented by a group of 4 binary bits is

  4. BCD equivalent of (345)10 is:

  5. Which of the following is an invalid state in 8-4-2-1 Binary Coded Decimal counter

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App