Home › Practice › RTL Design › Reading the dial back

Reading the dial back

EasyRTLcombinational

The knob sent its position in Gray code. The computer wants an ordinary binary number.

Concept first. Converting binary to Gray code can be undone, so you can always get the binary number back. The top bit is the same in both. The other bits are found one by one from the top down: to get a bit you need the answer you just found for the bit above it, together with the Gray bit at this place. So each step uses the result of the step before. Check it with 2-bit Gray 11 (which is binary 10): the top bit is 1, so what must the next bit be?

What to build.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← A dial that changes one bit at a timeA rotary switch for data →