CircuitNote

Quick electronics calculators for lab work and circuit design. Free, no sign-up, works in your browser.

한국어

Values accept SI prefixes. Examples: 4.7k 4k7 100n 10u 20mA 1M

7SEG

7-Segment Display Decoder

Pick 0–F to see which segments light, the BCD input, and the hex byte to send from a microcontroller.

Segment names and cautions

Going clockwise from the top the segments are a, b, c, d, e, f, with g in the middle. A common-cathode display lights on High, a common-anode one on Low. BCD decoder ICs such as the 74LS47 only show 0–9 as digits, draw 6 and 9 without tails (no a or d), and show odd symbols for 10–15. Each segment needs its own current-limiting resistor.

Worked example: the segment code for 2

  1. The digit 2 lights the top (a), upper right (b), middle (g), lower left (e) and bottom (d) → a b d e g
  2. In the order g f e d c b a with lit = 1: 1 0 1 1 0 1 1 → common-cathode code 0x5B
  3. A common-anode display lights on Low, so invert every bit → 0xA4

7-segment code table for 0–F

DigitDCBALit segmentsg f e d c b aCommon cathodeCommon anode
00000a b c d e f0 1 1 1 1 1 10x3F0xC0
10001b c0 0 0 0 1 1 00x060xF9
20010a b d e g1 0 1 1 0 1 10x5B0xA4
30011a b c d g1 0 0 1 1 1 10x4F0xB0
40100b c f g1 1 0 0 1 1 00x660x99
50101a c d f g1 1 0 1 1 0 10x6D0x92
60110a c d e f g1 1 1 1 1 0 10x7D0x82
70111a b c0 0 0 0 1 1 10x070xF8
81000a b c d e f g1 1 1 1 1 1 10x7F0x80
91001a b c d f g1 1 0 1 1 1 10x6F0x90
A1010a b c e f g1 1 1 0 1 1 10x770x88
B1011c d e f g1 1 1 1 1 0 00x7C0x83
C1100a d e f0 1 1 1 0 0 10x390xC6
D1101b c d e g1 0 1 1 1 1 00x5E0xA1
E1110a d e f g1 1 1 1 0 0 10x790x86
F1111a e f g1 1 1 0 0 0 10x710x8E

Codes use the bit order dp g f e d c b a (a is the least significant bit) with the decimal point off. BCD decoders such as the 7447 show different shapes for 10–15.

Frequently asked questions

What hex codes show 0–9 on a common-cathode display?

With bit 0 = a through bit 6 = g: 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F. For a common-anode display invert the bits (0xC0 for 0).

Why does my 74LS47 show strange symbols for 10–15?

The 74LS47 is a BCD decoder: it is designed for 0–9 only, and inputs 10–15 produce fixed special patterns rather than A–F. Use a microcontroller or a hex decoder to show A–F.