Skip to content
Solved Examples · Example 7

Q.Convert (1001)2(1001)_2 into gray code.

Karnataka PUCTextbookNumericImportance★★★★★est
19% · 31/160 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

[!TLDR]

Copy the MSB, then XOR each pair of neighbouring binary bits to get (1001)2=(1101)G(1001)_2 = (1101)_G.

Gray code is a unit-distance code, so successive values differ in only one bit. To convert a binary number b3b2b1b0=1001b_3b_2b_1b_0 = 1001 to gray g3g2g1g0g_3g_2g_1g_0:

  • g3=b3=1g_3 = b_3 = 1 (the MSB is copied straight down)
  • g2=b3⊕b2=1⊕0=1g_2 = b_3 \oplus b_2 = 1 \oplus 0 = 1 …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.