You are on page 1of 30

Digital Electronics

Principles & Applications
Seventh Edition

Roger L. Tokheim
Chapter 6

Encoding, Decoding, and Seven-Segment Displays

©2008 The McGraw-Hill Companies, Inc. All rights reserved.

INTRODUCTION
• The BCD Code • The Excess-3 Code • The Gray Code • The ASCII Code • Decoders • BCD-to-SevenSegment Decoder/ Driver

• Encoders
• Seven-segment Displays • Seven-segment LED Displays

• Liquid Crystal Displays
• Vacuum Fluorescent Displays

©2008 The McGraw-Hill Companies, Inc. All rights reserved.

The 8421 BCD Code
• BCD stands for Binary-Coded Decimal.

• A BCD number is a four-bit binary group that represents one of the ten decimal digits 0 through 9. Example:

Decimal number 4926

4

9

2

6

8421 BCD coded number 0100 1001 0010 0110
©2008 The McGraw-Hill Companies, Inc. All rights reserved.

BCD Coded Number Decimal Number 1000 0111 0001 8 7 1 ©2008 The McGraw-Hill Companies. Inc.QUIZ Convert the BCD coded number 1000 0111 0001 into decimal. . All rights reserved.

Inc. Decimal Number 3 5 0 BCD Coded Number 0011 0101 0000 ©2008 The McGraw-Hill Companies. All rights reserved. .QUIZ Convert the decimal number 350 to its BCD equivalent.

The Excess-3 Code • Add 3 to each digit of decimal and convert to 4-bit binary form • A BCD code (not 8421 BCD) Decimal 0 1 2 3 4 5 6 7 8 9 Binary +3 Excess-3 0000 0011 0011 0001 0011 0100 0010 0011 0101 0011 0011 0110 0100 0011 0111 0101 0011 1000 0110 0011 1001 0111 0011 1010 1000 0011 1011 1001 0011 1100 Sample Problem: Decimal 3 5 9 Excess-3 0110 1000 1100 ©2008 The McGraw-Hill Companies. All rights reserved. Inc. .

QUIZ 1. True 71 0111 0101 1011 ©2008 The McGraw-Hill Companies. (True or False) 2. 3. Inc. decimal 3 is added to the decimal number and this is converted to its 4-bit binary code. . The decimal number 428 equals what excess-3 number. The excess-3 BCD number 1010 0100 equals __________ in decimal. All rights reserved. To form an excess-3 coded number.

Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Gray code 00000 00001 00011 00010 00110 00111 00101 00100 01100 01101 01111 01110 01010 01011 01001 01000 11000 ©2008 The McGraw-Hill Companies. • The Gray code is commonly associated with input/output devices such as an optical encoder of a shaft’s angular position. All rights reserved.The Gray Code • The Gray code’s most important characteristic is that only one digit changes as you increment or decrement the count. Inc. • The Gray code is NOT a BCD code. .

. The Gray code is commonly associated with input/output devices such as an optical encoder of a shaft’s angular position. All rights reserved. The Gray code is not a type of BCD code. The most important characteristic of the ____________ (BCD. (True or False) 2.QUIZ 1. Inc. 3. (True or False) True Gray code True ©2008 The McGraw-Hill Companies. Gray code) is that only one digit changes state as you increment or decrement the count.

punctuation marks and control characters • Standard ASCII is a 7-bit code (127 characters) • Extended ASCII (IBM ASCII).The ASCII Code • ASCII is an acronym for American Standard Code for Information Interchange • Represents numbers. letters. All rights reserved. Inc. is also very popular • Extended ASCII adds graphics and math symbols to code (total of 256 symbols) ©2008 The McGraw-Hill Companies. an 8-bit code. .

10-bit) code which adds graphic and math symbols to ASCII for a total of 256 symbols. Inc. letters. 3. punctuation marks.QUIZ 1. . The acronym ASCII stands for __________________________. ASCII 2. All rights reserved. and control characters is known by the acronym __________. American Standard Code for Information Interchange 8-bit ©2008 The McGraw-Hill Companies. A common 7-bit code used to represent numbers. Extended ASCII code is a(n) __________ (8-bit.

Electronic Encoder . All rights reserved.Decimal to BCD BCD output Decimal input 00 10 0 11 Decimal to BCD Encoder 7 5 3 0 • Encoders are available in IC form. ©2008 The McGraw-Hill Companies. Inc. . • This encoder translates from decimal input to BCD output.

All rights reserved. Inc. .Seven Segment Displays LED (light emitting diode) display • High power consumption • Viewing best under low light conditions • Commonly red but available in other colors LCD (liquid crystal display) • Commonly dark characters on a silvery background • Very low power consumption • Viewing only OK in good light • Backlighted displays can be viewed in low light VF (vacuum fluorescent) display • Commonly blue-green display (without filters) • Medium power consumption • Viewing good from dark to lighter conditions • Based on vacuum tube triode technology ©2008 The McGraw-Hill Companies.

The type of 7-segment display based on vacuum tube technology which usually has blue-green characters and can be viewed in dark to lighter conditions is the vacuum fluorescent display (VF). (True or False) ©2008 The McGraw-Hill Companies. (True or False) 3. Inc. and is good for viewing in bright light is called the liquid crystal display (LCD). . The seven-segment LED display is best viewed in True True False very bright sunlight. uses very little power. The type of 7-segment display that shows dark characters on a silvery background. (True or False) 2. All rights reserved.QUIZ 1.

7-Segment LED Display Operation Inputs 7-segment code 7-segment b & c inputs display active Note reads that therefore decimal inputs 1 are (segments segments “active-LOW” b b& &c c light are on lit) display H L b L c H H H H a +5V g Limiting resistors Cathode terminals (a thru g) Common anode 7-segment LED display (common anode) ©2008 The McGraw-Hill Companies. Inc. All rights reserved. .

QUIZ Q#4#1-What What the decimal the 7-segment LED Q #2iswill the be decimal outputoutput on the on display for the new set display? of inputs? #3- Inputs 7-segment code L H L H L H L H L H L H L a b b c d e f g a +5V g ©2008 The McGraw-Hill Companies. Inc. . All rights reserved.

• Decimals are shown on an 7-segment LED display. • This IC also drives the 7-segment LED display. . • This decoder translates from BCD to decimal. All rights reserved. Inc. ©2008 The McGraw-Hill Companies.Decoders: BCD to 7-Segment Decoder/Driver BCD input Decimal output LED 01 00 10 1 BCD-to7-Segment Decoder/ Driver • Electronic decoders are available in IC form.

Inc.What is the decimal output from the decoder that #2#3#4appears on the 7-segment display? Answer: 6 3 0 9 7 BCD input Decimal output 10 1 0 00 0 00 1 11 0 BCD-to7-Segment Decoder/ Driver ? ©2008 The McGraw-Hill Companies. . All rights reserved.QUIZ Q #5#1.

• Active-matrix color LCD screens use thin-film transistors (TFT) and red. • Most laptop screens are backlighted for brightness. ©2008 The McGraw-Hill Companies. calculators. . • LCDs are commonly used on watches. green. All rights reserved. • Color LCDs use either passive-matrix or active-matrix technology. Inc.Liquid Crystal Displays • LCDs control available light (do not generate light) • Nematic fluid (also called liquid crystal fluid) is sandwiched between two glass plates • Monochrome twisted-nematic field-effect LCDs display dark figures on a silvery background. and laptops. LCD monitors and TVs are becoming common. blue. and white filters. • Active-matrix color LCD screens are more expensive.

Liquid Crystal Display Metalized segments Polarizer Conductive pattern on glass Contacts Liquid crystal Metalized layer Glass backplane Polarizer 100 Hz out-of-phase signal activates segment ©2008 The McGraw-Hill Companies. All rights reserved. Inc. .

QUIZ 1. control available liquid crystal dark 4. While VF and LED displays emit light. liquid crystal). The nematic fluid sandwiched between the glass plates of a LCD is also called _______ _______ (green phosphor. Monochrome twisted-nematic field-effect LCDs display __________ (dark. . white) figures on a silvery background. 3. LCDs __________ (control available. (True or False) ©2008 The McGraw-Hill Companies. sublimate red) light. 2. Liquid crystal displays are difficult to read under low light conditions however most laptop computer flat screens are backlighted True to add brightness. All rights reserved. Inc.

All rights reserved. . b.Driving an LCD Display BCD Input 0111 a b c LCD d driver e f g Phase 100 Hz Clock Common The LCD segments with out-of-phase signals are active (a. Inc. & c are active) ©2008 The McGraw-Hill Companies.

Inc. .QUIZ Q#1: Q#2: What is the output on the LCD display? Q#3: What Whatis isthe theoutput outputon onthe theLCD LCDdisplay? display? ANS: 2 ANS: ANS: 0 5 BCD Input A B LCD C Driver D E F G ? LCD Common 100 Hz Clock ©2008 The McGraw-Hill Companies. All rights reserved.

• VF displays are based on an older triode vacuum tube technology. ©2008 The McGraw-Hill Companies. and will operate at wide extremes of temperature. have a pleasing blue-green color. • VF displays are also commonly used in point-ofsale terminals and some desktop calculators. All rights reserved. Inc.Vacuum Fluorescent Displays • VF displays are commonly used in automobiles because they operate at the proper voltages. . are easy to see even when viewed under lower light conditions.

. Inc. automobiles). One of the most common applications of VF displays is in _________________ (flat-screen laptop computer screens. VF display).QUIZ 1. The VF display has the advantage of being easily readable in either light or dark conditions. VF display 2. (True or False) automobiles True ©2008 The McGraw-Hill Companies. A vacuum fluorescent display is based on an older vacuum tube technology and is commonly referred to as a _____ _________ (TFT display. All rights reserved. 3.

Inc. All rights reserved. .Vacuum Fluorescent Display Cathodes (heaters) Grid KG f a e g d c b K Plates Glass back ©2008 The McGraw-Hill Companies.

. Q#3-The The screen like at C called is called the ___.QUIZ Q#1thin wires atsection A are called heaters or ___. All rights reserved. Inc. Q#2The segments at B are ___. A ANS: Cathodes ANS: Plates ANS: Grid B C ©2008 The McGraw-Hill Companies.

Plate must be at +12V ©2008 The McGraw-Hill Companies. Grid must be at +12V 3. Heaters must be hot 2. Inc. All rights reserved.Operating a VF 7-Segment Display +12 V Pa +12 V Pb Pc Pd Pe 0V Pf Pg Plates Grid Cathodes (heaters) To light a segment: 1. .

.at +12V. Q#6. Q#5To Q#3light Parts a plate C are it must the ___. Inc.QUIZ Q#1Part A is theheaters ___. Q#2Q#4Part The B points grid is at normally the or ___. All rights reserved. (T or F) (T (Tor orF) F) ANS:cathodes grid ANS: ANS: plates ANS: True ANS: ANS: False True C A B Schematic diagram of VF display with heaters connected to battery. ©2008 The McGraw-Hill Companies.To light a plate it must be at +12V. be grounded.

All rights reserved. Inc. .REVIEW • The BCD Code • The Excess-3 Code • The Gray Code • The ASCII Code • Decoders • BCD-to-SevenSegment Decoder/ Driver • Encoders • Seven-segment Displays • Seven-segment LED Displays • Liquid Crystal Displays • Vacuum Fluorescent Displays ©2008 The McGraw-Hill Companies.