LogicLab

BCD to 7-segment decoder

A BCD to 7-segment decoder turns a 4-bit binary-coded decimal digit into the seven signals that drive a 7-segment display.

Circuit diagram of the BCD to 7-segment decoder

Open this circuit in LogicLab →

Boolean expressions

Truth table

DCBAseg aseg bseg cseg dseg eseg fseg g
00001111110
00010110000
00101101101
00111111001
01000110011
01011011011
01101011111
01111110000
10001111111
10011111011
10100000000
10110000000
11000000000
11010000000
11100000000
11110000000

How it works

Ten AND gates detect digits 0 to 9. Each segment (a to g) is the OR of the digits that need it lit. Inputs 10 to 15 are not valid BCD, so no digit gate fires and the display stays blank.

Try it yourself

Decodes a 4-bit BCD digit (0 to 9) into the seven segment signals a to g; values 10 to 15 blank the display. Open the circuit, click the switches to change the inputs, and watch the LEDs and the waveform panel respond. You can edit the circuit, convert it to NAND-only or NOR-only gates, and save or export your version.

Related circuits

Reference: en.wikipedia.org/wiki/Seven-segment_display