SinBench
← All labs · Digital Logic Design · Free virtual lab

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 →
7447BCD to 7-segment driver
180 ohmone resistor per segment
Gray codeone bit changes at a time
Before you start

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.

01
Read the concepts page: BCD, Gray and excess-3 codes, and how a common anode display works.
02
Forget a resistor and the segment burns, as on the bench.
03
Set the ten digits on the switches and the table records every segment.
Designed by
© 2026 Fasih Ullah Saleem. All rights reserved. · About · Terms of Use · Privacy
About this virtual lab

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.

BCD, Gray Code and the Seven Segment Decoder (7447): the working 3D lab bench with its trainer and instruments
The bench of this lab, as it looks after you enter it.

What you do on this bench

  1. Place the 7447 and a common anode display and wire one resistor per segment.
  2. Set BCD digits 0 to 9 on the switches and check each digit shown.
  3. Build a BCD to Gray code converter from XOR gates.
  4. 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.