GATE Computer ScienceHardGATE CS

An 8-bit binary counter and an 8-bit Gray-code counter each count up from 0 to 200 (200 increments). Every change of a stored bit is one toggle. How many more toggles does the binary counter make than the Gray-code counter?

  1. A. 194
  2. B. 197
  3. C. 200
  4. D. 203

Correct answer: B. 197

A Gray code changes exactly one bit per increment, so the Gray counter makes 200 toggles. Binary counting from 0 to N toggles 2N − (number of 1 bits of N) bits; for N = 200 = 11001000₂ that is 400 − 3 = 397. The difference is 397 − 200 = 197.

More Digital Logic questions

Exams that ask this topic