BCD to 7-Segment Decoder Using Karnaugh Maps: Complete Design

Design a BCD to 7-segment decoder with four-variable Karnaugh maps. Follow the common-cathode truth table, seven output functions, don't-care conditions and logic circuit.

Kalana Sandeep11 min read
BCD to 7-segment decoder design using 4-variable Karnaugh maps and common cathode display logic

A digital display needs a way to turn binary information into something people can read. One common example is a seven-segment display, which uses seven individually controlled LED segments to show decimal digits from 0 to 9.

A BCD to 7-segment decoder performs this conversion. It accepts a four-bit Binary Coded Decimal (BCD) input and generates seven output signals that control the display segments.

Designing this decoder is also a useful application of Karnaugh maps because each segment has its own Boolean function.

In this tutorial, we will derive the seven output functions from the BCD truth table, simplify them using four-variable Karnaugh maps, and examine how the resulting logic can be implemented.

We will use a common-cathode display throughout the main design so that a logic HIGH (1) turns a segment ON.

1. What Is a BCD to 7-Segment Decoder?

BCD stands for Binary Coded Decimal. In this representation, each decimal digit is encoded separately using four binary bits.

For example:

  • Decimal 0 = 0000
  • Decimal 1 = 0001
  • Decimal 5 = 0101
  • Decimal 9 = 1001

A seven-segment decoder receives these four input bits and decides which display segments must turn ON to represent the corresponding digit.

The four inputs are:

  • A: Most significant bit (weight 8).
  • B: Second bit (weight 4).
  • C: Third bit (weight 2).
  • D: Least significant bit (weight 1).

The seven outputs are:

  • a
  • b
  • c
  • d
  • e
  • f
  • g

The output of each segment is determined by the four BCD input variables.

Seven-segment display diagram showing labelled segments a through g alongside BCD decoder block diagram

Figure 1: Standard seven-segment display anatomy (segments a through g) and BCD decoder block architecture.

Segment positions must be accurate:

  • a: Top horizontal segment.
  • b: Upper right vertical segment.
  • c: Lower right vertical segment.
  • d: Bottom horizontal segment.
  • e: Lower left vertical segment.
  • f: Upper left vertical segment.
  • g: Middle horizontal segment.

Also create a simple BCD decoder block diagram showing four input lines and seven output lines.

2. Common-Cathode and Common-Anode Displays

Before designing the logic equations, it is necessary to know how the display hardware works.

Common-Cathode Display

In a common-cathode display:

  • All LED cathodes are tied together and connected to ground (GND).
  • An individual segment turns ON when its anode receives a logic HIGH (1).
  • An individual segment turns OFF when its anode receives a logic LOW (0).

Therefore, the outputs are active-high.

This is the configuration we will use for the derivations in this guide.

Common-Anode Display

In a common-anode display:

  • All LED anodes are tied together and connected to VCC (power supply).
  • An individual segment turns ON when its cathode receives a logic LOW (0).
  • An individual segment turns OFF when its cathode receives a logic HIGH (1).

Therefore, the outputs are active-low.

If you are designing for a common-anode display, you invert the common-cathode outputs:

Output_anode = NOT(Output_cathode)

This distinction is important because confusing the two display types will cause every digit to display inverted segments.

3. BCD to 7-Segment Truth Table

A four-bit binary number can have 16 possible values from 0000 to 1111.

However, valid BCD digits only range from 0 to 9 (0000 to 1001).

The remaining six binary values:

  • 1010 (10)
  • 1011 (11)
  • 1100 (12)
  • 1101 (13)
  • 1110 (14)
  • 1111 (15)

are not valid BCD digits. Under normal operation, these inputs should never occur.

We treat these six combinations as don't-care conditions, labelled X.

The complete truth table for a common-cathode display is:

DigitA (8)B (4)C (2)D (1)abcdefg
000001111110
100010110000
200101101101
300111111001
401000110011
501011011011
601101011111
701111110000
810001111111
910011111011
10–15Invalid BCDXXXXXXX

Notice:

  • Decimal 0 activates all segments except g.
  • Decimal 1 activates segments b and c.
  • Decimal 8 activates all seven segments.
Complete BCD to 7-Segment truth table for digits 0 to 9 with active illuminated display patterns and don't-care conditions

Figure 2: Complete truth table for decimal digits 0–9 showing segment illumination patterns and invalid input don't-cares (10–15).

4. Identifying the Minterms for Each Segment

From the truth table, we write down the list of minterms where each segment is 1, together with the shared don't-care terms:

d(A,B,C,D) = Σm(10, 11, 12, 13, 14, 15)

The segment minterm lists are:

  • a: Σm(0, 2, 3, 5, 6, 7, 8, 9) + d(10–15)
  • b: Σm(0, 1, 2, 3, 4, 7, 8, 9) + d(10–15)
  • c: Σm(0, 1, 3, 4, 5, 6, 7, 8, 9) + d(10–15)
  • d: Σm(0, 2, 3, 5, 6, 8, 9) + d(10–15)
  • e: Σm(0, 2, 6, 8) + d(10–15)
  • f: Σm(0, 4, 5, 6, 8, 9) + d(10–15)
  • g: Σm(2, 3, 4, 5, 6, 8, 9) + d(10–15)

Each segment is a separate combinational logic problem that can be simplified using its own four-variable Karnaugh map.

5. Karnaugh Map Arrangement

All seven Karnaugh maps use the standard four-variable layout:

  • Rows: AB = 00, 01, 11, 10
  • Columns: CD = 00, 01, 11, 10

Both axes follow Gray-code order.

Each map contains:

  • 16 cells in total.
  • 1s for the segment minterms.
  • Xs in the six invalid BCD cells: m10, m11, m12, m13, m14 and m15.
  • 0s in the remaining cells.

Let's simplify each segment individually.

5.1 K-Map for Segment a

a = Σm(0,2,3,5,6,7,8,9)

AB \ CD00011110
001011
010111
11XXXX
1011XX

The simplified expression is:

a = A + C + BD + B'D'

Explain the groups:

  • A: Eight-cell group formed by rows 11 and 10.
  • C: Four-cell group.
  • BD: Four-cell group.
  • B'D': Four-cell group using corner cells.

Corner adjacency is used to form B'D'.

Four-variable Karnaugh map for segment a showing octet, quads, corner wrap-around group and derivation

Figure 3: Four-variable K-Map for segment a with 4 essential groups yielding a = A + C + BD + B'D'.

5.2 K-Map for Segment b

b = Σm(0,1,2,3,4,7,8,9)

AB \ CD00011110
001111
011010
11XXXX
1011XX

The simplified expression is:

b = B' + C'D' + CD

Explain the groups:

  • B': Eight-cell group formed by rows 00 and 10 through wrap-around.
  • C'D': Four-cell group.
  • CD: Four-cell group.
Four-variable Karnaugh map for segment b showing wrap-around octet and quads with derivation

Figure 4: Four-variable K-Map for segment b featuring vertical wrap-around octet B' to yield b = B' + C'D' + CD.

5.3 K-Map for Segment c

c = Σm(0,1,3,4,5,6,7,8,9)

AB \ CD00011110
001110
011111
11XXXX
1011XX

The simplified expression is:

c = B + C' + D

Explain the groups:

  • B: Eight-cell group where B = 1.
  • C': Eight-cell group where C = 0.
  • D: Eight-cell group where D = 1.
Four-variable Karnaugh map for segment c showing three 8-cell octets and derivation

Figure 5: Four-variable K-Map for segment c showing three overlapping 8-cell octets yielding c = B + C' + D.

5.4 K-Map for Segment d

d = Σm(0,2,3,5,6,8,9)

AB \ CD00011110
001011
010101
11XXXX
1011XX

The simplified expression is:

d = A + B'C + CD' + B'D' + BC'D

Explain the five groupings:

  • A: Eight-cell group.
  • B'C: Four-cell group.
  • CD': Four-cell group.
  • B'D': Four-cell group.
  • BC'D: Two-cell group.

The group for BC'D includes m5 and the appropriate don't-care cell m13.

Four-variable Karnaugh map for segment d showing octet, quads, pair and derivation

Figure 6: Four-variable K-Map for segment d with 5 groups yielding d = A + B'C + CD' + B'D' + BC'D.

5.5 K-Map for Segment e

e = Σm(0,2,6,8)

AB \ CD00011110
001001
010001
11XXXX
1010XX

The simplified expression is:

e = B'D' + CD'

Explain the groups:

  • B'D': Four-cell group.
  • CD': Four-cell group.
Four-variable Karnaugh map for segment e showing four corner quad and column quad with derivation

Figure 7: Four-variable K-Map for segment e showing 4-corner quad B'D' and column quad CD' yielding e = B'D' + CD'.

5.6 K-Map for Segment f

f = Σm(0,4,5,6,8,9)

AB \ CD00011110
001000
011101
11XXXX
1011XX

The simplified expression is:

f = A + BC' + BD' + C'D'

Explain the groups:

  • A: Eight-cell group.
  • BC': Four-cell group.
  • BD': Four-cell group.
  • C'D': Four-cell group.
Four-variable Karnaugh map for segment f showing octet and three quads with derivation

Figure 8: Four-variable K-Map for segment f showing octet and 3 quads yielding f = A + BC' + BD' + C'D'.

5.7 K-Map for Segment g

g = Σm(2,3,4,5,6,8,9)

AB \ CD00011110
000011
011101
11XXXX
1011XX

The simplified expression is:

g = A + BC' + B'C + CD'

Explain the groups:

  • A: Eight-cell group.
  • BC': Four-cell group.
  • B'C: Four-cell group.
  • CD': Four-cell group.
Four-variable Karnaugh map for segment g showing octet and quads with derivation

Figure 9: Four-variable K-Map for segment g showing octet and 3 quads yielding g = A + BC' + B'C + CD'.

Important K-Map explanation

A group containing X cells is allowed when those cells help produce a simpler expression.

Do not treat every X as a compulsory 1. It can be used as either 0 or 1 depending on which choice creates better valid groups.

The first and last rows or columns of a K-Map are also adjacent through wrap-around.

All diagrams correctly represent these rules.

6. Final Simplified Boolean Expressions

After simplifying all seven maps, the final active-high common-cathode equations are:

a = A + C + BD + B'D'

b = B' + C'D' + CD

c = B + C' + D

d = A + B'C + CD' + B'D' + BC'D

e = B'D' + CD'

f = A + BC' + BD' + C'D'

g = A + BC' + B'C + CD'

Notation:

  • A' means NOT A.
  • BC means B AND C.
  • B + C means B OR C.

Different valid don't-care groupings can produce other equivalent expressions. The expressions above are one verified set of minimized SOP forms under the stated common-cathode convention and invalid-input assumptions.

7. Implementing the BCD Decoder Logic Circuit

Each segment output has its own Boolean function.

The seven equations can be implemented using AND, OR and NOT gates.

A practical design can share complemented input signals such as A', B', C' and D' rather than generating the same inversion separately for every output.

The outputs must connect to the corresponding display segments:

  • a → Top.
  • b → Upper right.
  • c → Lower right.
  • d → Bottom.
  • e → Lower left.
  • f → Upper left.
  • g → Middle.

The decoder implementation diagram incorporates:

  • Four BCD inputs.
  • Seven Boolean output networks.
  • Seven labelled output connections.
  • A common-cathode display representation.
  • Clearly identified active-high output convention.
Complete BCD to 7-Segment decoder circuit architecture schematic showing input bus, logic generator networks, and display connections

Figure 10: Complete BCD to 7-segment decoder circuit block architecture and active-high common-cathode display interface.

In real hardware, each LED segment also needs appropriate current limiting and a compatible driver. A logic equation alone does not provide the electrical current required by the LED.

8. Worked Examples

Let's test the simplified Boolean equations with two sample digits.

Example 1: Display Decimal 5

Binary input:

A = 0, B = 1, C = 0, D = 1

Evaluate each segment equation:

a = A + C + BD + B'D' = 0 + 0 + (1·1) + (0·0) = 1

b = B' + C'D' + CD = 0 + (1·0) + (0·1) = 0

c = B + C' + D = 1 + 1 + 1 = 1

d = A + B'C + CD' + B'D' + BC'D = 0 + 0 + 0 + 0 + (1·1·1) = 1

e = B'D' + CD' = (0·0) + (0·0) = 0

f = A + BC' + BD' + C'D' = 0 + (1·1) + (1·0) + (1·0) = 1

g = A + BC' + B'C + CD' = 0 + (1·1) + 0 + 0 = 1

Active segments:

a, c, d, f, g

Inactive segments:

b, e

Looking at a standard seven-segment display, turning ON segments a, c, d, f, and g correctly forms the digit 5.

Example 2: Display Decimal 8

Binary input:

A = 1, B = 0, C = 0, D = 0

Evaluate each segment equation:

a: Contains term A = 1 → a = 1.

b = B' + C'D' + CD: B = 0, so B' = 1 → b = 1.

c = B + C' + D: C = 0, so C' = 1 → c = 1.

d: Contains term A = 1 → d = 1.

e = B'D' + CD': B = 0 and D = 0, so B'D' = 1 → e = 1.

f: Contains term A = 1 → f = 1.

g: Contains term A = 1 → g = 1.

Active segments:

a, b, c, d, e, f, g (all seven segments)

Inactive segments:

None.

All segments are ON, displaying the digit 8 as expected.

9. Common Mistakes

When designing a BCD to 7-segment decoder, watch out for the following traps:

  • Forgetting to label segments in standard clockwise order (a at top through f, with g in the center).
  • Confusing common-cathode (active-HIGH) with common-anode (active-LOW).
  • Ignoring don't-care conditions (X for minterms 10–15), which results in much larger, more expensive circuits.
  • Treating all X terms as mandatory 1s rather than choosing them selectively to create the largest possible powers-of-two groups.
  • Overlooking wrap-around opportunities across opposite edges and the four corners (such as B'D').

10. Frequently Asked Questions

What is a BCD to 7-segment decoder?

It is a combinational circuit that converts a four-bit BCD input into seven control signals for displaying decimal digits.

How many inputs and outputs does a BCD to 7-segment decoder have?

It has four BCD inputs and seven segment outputs.

Why are there six don't-care conditions?

A four-bit input can represent 16 combinations, but standard BCD uses only ten. The six remaining combinations are not valid BCD digits.

Why are common-cathode and common-anode outputs different?

A common-cathode segment turns ON with a HIGH signal, whereas a common-anode segment turns ON with a LOW signal.

Why do we need seven Karnaugh maps?

Each display segment is a separate Boolean function. Each function needs its own simplification.

Can the same don't-care values be used for all seven outputs?

Yes. The six invalid BCD combinations are the same for all seven outputs. However, the selected groupings can differ between outputs.

Can a BCD decoder be implemented using a ROM?

Yes. A ROM can store the output truth table and produce the seven output signals for each valid input combination.

11. Try Your Own Karnaugh Map Problems

The best way to become comfortable with four-variable K-Maps is to practise different functions and compare your groupings with the simplified expressions.

Use the Karnaugh Map Solver on this website to explore Boolean functions and verify your own calculations. You can also explore how multi-output combinational circuits work in our 4-Bit Binary to Gray Code Converter Tutorial.

Conclusion

A BCD to 7-segment decoder is a practical example of how Karnaugh maps can simplify a multi-output digital logic design.

Starting with the BCD truth table, we derived seven separate Boolean functions, used invalid BCD inputs as don't-care conditions, and obtained simplified equations for every display segment.

The same design approach can be applied to other decoders and combinational circuits.

Understanding the seven individual functions makes it easier to see how a simple digital display is controlled by Boolean logic.