VIN Technologies › Labs › Digital Systems Lab

Binary to Gray code converter

Digital Systems Lab · free online experiment, runs in your browser with no install or sign-up.

Open this experiment in the circuit simulator

Objective

Convert a 3-bit binary number to Gray code with two XOR gates.

Procedure

  1. Run through 000 … 111 and note that only one Gray bit changes per step.

Theory

G2 = B2, G1 = B2 ⊕ B1, G0 = B1 ⊕ B0. Consecutive Gray codes differ in exactly one bit.

Questions to answer

  1. Where is Gray code used?

Components used

3 × Logic probe / LED, 3 × Logic switch, 2 × XOR

About the model

Ideal wires; component models as listed in the catalogue (no parasitics, no temperature drift). Built without a breadboard so the schematic stays readable.

Open this experiment in the circuit simulator

More Digital Systems Lab experiments