A 7-segment display shows a digit by lighting seven bars, named a to g clockwise starting from the top, with g in the middle. The decoder receives a 4-bit BCD digit (ABCD, A the most significant) and turns on the required bars. It is a classic problem because it combines seven four-variable functions with don’t cares.
1. The truth table
A convention has to be chosen: here 6 has its top bar (a), 7 has no f and 9 has its bottom bar (d). Inputs 10 to 15 are not BCD digits, so they are don’t cares for every segment.
| Digit | ABCD | a | b | c | d | e | f | g | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0000 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | |
| 1 | 0001 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | |
| 2 | 0010 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | |
| 3 | 0011 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | |
| 4 | 0100 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | |
| 5 | 0101 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | |
| 6 | 0110 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | |
| 7 | 0111 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | |
| 8 | 1000 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 9 | 1001 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | |
| 10 | 1010 | X | X | X | X | X | X | X | |
| 11 | 1011 | X | X | X | X | X | X | X | |
| 12 | 1100 | X | X | X | X | X | X | X | |
| 13 | 1101 | X | X | X | X | X | X | X | |
| 14 | 1110 | X | X | X | X | X | X | X | |
| 15 | 1111 | X | X | X | X | X | X | X |
2. One segment step by step: e
Segment e (bottom left) is only lit for 0, 2, 6 and 8: e = Σm(0, 2, 6, 8) + d(10…15). On the map:
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 10 | 01 | 03 | 12 |
| 01 | 04 | 05 | 07 | 16 |
| 11 | X12 | X13 | X15 | X14 |
| 10 | 18 | 09 | X11 | X10 |
- The four corners (m0, m2, m8 and m10, the last one a don’t care) form a group with B = 0 and D = 0:
B'D'. - m6 is left out. Column CD = 10 (m2, m6, m14 and m10) is a group of 4 with C = 1 and D = 0 thanks to two don’t cares:
CD'.
e = B'D' + CD'
Without the don’t cares, m6 could only be grouped with m2 (A'CD') and m8 with m0 (B'C'D'), and the expression would be longer.
3. All seven segments
Repeating the process for each segment gives the table below. Every expression is computed by the site’s minimizer and the link opens its map:
| Segment | Minimal expression | Terms | Literals | |
|---|---|---|---|---|
| a | B'D' + C + BD + A | 4 | 6 | open |
| b | B' + C'D' + CD | 3 | 5 | open |
| c | C' + D + B | 3 | 3 | open |
| d | B'D' + B'C + BC'D + CD' + A | 5 | 10 | open |
| e | B'D' + CD' | 2 | 4 | open |
| f | C'D' + BC' + BD' + A | 4 | 7 | open |
| g | B'C + BC' + A + CD' | 4 | 7 | open |
If you reach a different expression by hand, it may be just as valid: it only has to give the same output for inputs 0 to 9 and have the same number of terms and literals.
4. Sharing products between segments
Adding up the terms of the seven expressions gives 25 products, but many repeat. A real circuit only needs one AND gate per distinct product: there are 15. These are the ones used by more than one segment:
B'D'— a, d, eA— a, d, f, gC'D'— b, fB'C— d, gCD'— d, e, gBC'— f, g
5. What changes with another convention
If 6 is drawn without its top bar or 9 without its bottom bar, the functions of a and d change (and f if 7 has a side bar). It is a good exercise: change the segment’s minterms in the minimizer and compare the size of the expressions.