7 Segment Display
7 Segment Display
Example: 10100010 V ( B) 1 27 0 1 25 0 0 0 1 21 0
128 32 2 162
Example: 11000011 V ( B) 1 27 1 26 0 0 0 0 1 21 1 20
128 64 2 1 195
Finally: 00000000 = 0 in the decimal number system
11111111 = 255 in the decimal number system
0 OFF
1 ON
However, this type of representation of a binary number is NOT
really practical as it is difficult for us humans to interpret.
APSC 160 Display P2-4-5
7-Segment Displays
A more useful way to display decimal numbers involves using a
7-Segment Display.
Here we arrange a group of 7 LEDs into a pattern that allows us
to display the digits 0-9 by individually turning on/off segments
in the display (i.e. by writing a 0 or 1 to each segment).
Traditionally the segments are labelled ‘a’ to ‘g’ as shown below
a
f b
g
e c
decimal point
So there are in fact 8 LEDs if you count the decimal point (but
they are still called seven segment displays!!). We can
completely control the display by writing a BYTE (8 bits) to it.
a b c d e f g p
8 bits (1 byte)
A ‘1’ in a position turns the segment on, and a ‘0’ turns it off.
a b c d e f g p
1 1 1 1 0 1 1 0 =9
a b c d e f g p
1 0 1 1 0 1 1 0
which is 128 + 32 + 16 + 4 + 2 = 182
D d n 1d n 2d n 3... d1d 0
V ( D) dn 1 10 n 1
dn 2 10 n 2
... d1 101 d 0 10 0
di is 0, 1, 2, 3, …, 8, or 9.
V ( B) bn 1 2n 1
bn 2 2n 2
... b1 21 b0 20
bi is 0 or 1.
As discussed earlier, each digit in the binary system, 1 and 0 (a
binary digit), is called a bit.
APSC 160 Display P2-4-20