Lab 6.
Codes that
light digits.
On a 3D digital logic trainer with a real breadboard, drive a seven segment display with the 7447 decoder, one resistor per segment. Then convert BCD to Gray code and back with XOR gates.
Read the concepts first →Your details
Free to use, no sign up. Your name is only printed on your own lab sheet, and your work is saved in this browser so you can continue later. Nothing is sent to a server.
BCD, Gray Code and the Seven Segment Decoder (7447)
This virtual lab drives a seven segment display with the 7447 BCD to seven segment decoder on a 3D digital logic trainer with a real breadboard. Four switches give a BCD digit, the 7447 turns it into seven segment signals, and one resistor per segment protects the display.
The second part converts between binary and Gray code with XOR gates, in both directions. Gray code changes only one bit between neighbouring values, which is why it is used in rotary encoders and Karnaugh maps. Running the two converters back to back gives the original BCD digit again, which is an easy way to check both circuits.

What you do on this bench
- Place the 7447 and a common anode display and wire one resistor per segment.
- Set BCD digits 0 to 9 on the switches and check each digit shown.
- Build a BCD to Gray code converter from XOR gates.
- Build the Gray code to BCD converter and check that it undoes the first circuit.
On the bench
- Digital logic trainer with 16 toggle switches, 16 LEDs, pulse switches, a clock and a two digit seven segment display
- Full size breadboard with power rails and jumper wires that are wired pin by pin
- Cabinet of TTL chips with real pinouts (7400 series)
- Logic probe, multimeter and a binder of chip data sheets
Free, runs in the browser, no sign up and nothing to install. A computer with a graphics card gives the smoothest 3D view.
Questions students ask
Why does the 7447 need a common anode display?
Its outputs are active low: a segment lights when its output pulls the cathode to ground. The common anode of the display goes to +5 V.
How do you convert binary to Gray code?
Keep the most significant bit, then XOR each pair of neighbouring bits: G3 = B3, G2 = B3 XOR B2, G1 = B2 XOR B1, G0 = B1 XOR B0.
Why does each segment need its own resistor?
Each resistor limits the current of one LED segment. A single shared resistor would make the digit dimmer as more segments light.
Read the concepts page for this lab · All Digital Logic Design virtual labs · All articles