# BCD to 7 segment decoder

In BCD (Binary Coded Decimal), a binary pattern is used to represent a decimal number. A 7 segment display is used to display hexadecimal numeral by seven LEDs arranged in a definite pattern as shown in figure (a).

A BCD to 7 segment decoder accepts the BCD code on its input and provide output to drive a 7 segment display.

For example, if the BCD code in the input is 0011 then we have to display decimal 3 on the 7 segment display. From the figure(b) it is clear that to display a 3 on a seven-segment display we have to enable LEDs a,b,c,d and g. So the output lines should be a=,b=1,g=1,c=1 and d=1.

The truth table for a seven segment decoder is given below,

Decimal Digit Input Decoding function Output
A0 A1 A2 A3 a b c d e f g
0 0 0 0 0 $${abcdef \overline g}$$ 1 1 1 1 1 1 0
1 0 0 0 1 $${\overline a bc \overline d \overline e \overline f \overline g}$$ 0 1 1 0 0 0 0
2 0 0 1 0 $${ab \overline c de \overline f g}$$ 1 1 0 1 1 0 1
3 0 0 1 1 $${abcd \overline e \overline f g}$$ 1 1 1 1 0 0 1
4 0 1 0 0 $${\overline a bc \overline d \overline e f g}$$ 0 1 1 0 0 1 1
5 0 1 0 1 $${a \overline bcde \overline f g}$$ 1 0 1 1 0 1 1
6 0 1 1 0 $${a \overline b cdefg}$$ 1 0 1 1 1 1 1
7 0 1 1 1 $${abc \overline d \overline e \overline f \overline g}$$ 1 1 1 0 0 0 0
8 1 0 0 0 $${abcdefg}$$ 1 1 1 1 1 1 1
9 1 0 0 1 $${abcd \overline e fg}$$ 1 1 1 1 0 1 1