Digital Logic Design · Lab 6 · read before the labAll labsGo to the lab →

One digit, many codes.

Systems that speak different codes need converters between them. Meet BCD, Gray and excess-3, and the chip that turns BCD into a lit digit.

01

Codes for a digit

DecimalBCDGrayExcess-3
0000000000011
1000100010100
2001000110101
3001100100110
4010001100111
5010101111000
6011001011001
7011101001010
8100011001011
9100111011100
02

BCD

Binary coded decimal writes each decimal digit in four bits with the weights 8 4 2 1. Only 0000 to 1001 are used; 1010 to 1111 never appear, which a designer can use as don't cares in a K-map.

03

Gray code

1 bit

Only one bit changes between neighbouring numbers: a minimum change code.

encoders

Used for shaft and position encoders, where several bits changing at once would give false readings.

K-maps

The rows and columns of a K-map are in Gray order for the same reason.

04

The seven segment display

Seven LEDs (a to g) shaped as an 8, plus a decimal point. In a common anode display all anodes are joined to pin 3 and pin 8, which go to +5 V; a segment lights when its own pin is pulled LOW. Each segment needs a series resistor (180 ohm) to limit the current, or it burns.

05

The 7447 driver

The 7447 has its own shapes for 6 and 9: it draws 6 without the top bar (segments c, d, e, f, g, so it looks like a small b) and 9 without the bottom bar (a, b, c, f, g). This is how the real chip is made, so the trainer in the lab room shows the same. Later chips such as the 74LS247 add the bars (a tailed 6 and 9). Try 6 and 9 below.

abcdefg
0100100

Input 5 (0101). The 7447 pulls a segment pin LOW (0) to light it; the common anode sits at +5 V, so current flows through the segment and its resistor into the pin.

7447BCD to 7-segment decoder/driver1B2C3LT4BI/RBO5RBI6D7A8GND9e10d11c12b13a14g15f16VCC

Hold the chip with its notch on the left. Pin 1 is at the bottom left, the pins count up to the right, then continue along the top from right to left. Most 14 pin chips have VCC on pin 14 and GND on pin 7, but not all: check every new chip.

06

Gray from XOR gates

From the K-maps: W = A, X = A ⊕ B, Y = B ⊕ C, Z = C ⊕ D. Back from Gray to binary each bit is the XOR of the binary bit above it and the Gray bit: W = A, X = W ⊕ B, Y = X ⊕ C, Z = Y ⊕ D.

07

Check yourself

Q1Which pins of the common anode display go to +5 V?

Pin 3 and pin 8 (the common anode). Either one is enough; they are joined inside.

Q2Why is a 180 ohm resistor needed in every segment line?

To limit the LED current; without it the segment (or the driver) burns.

Q3What Gray code is 7?

0100.

Q4On the 7447 is a lit segment a 0 or a 1 at its output pin?

A 0: the outputs are active LOW.

I am ready, go to the lab →