Unit 08
Unit 08
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Comparators
IC comparators provide outputs to indicate which of the input
numbers is larger or if they are equal. Cascading inputs are provided
to expand the comparator to larger numbers.
COMP
A0 0
A1 A
A2
A3 3
Cascading A>B A>B
A=B A=B Outputs
inputs
A<B A<B
B0 0
B1 B The IC shown is the
B2 4-bit 7485.
B3 3
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Comparators
IC comparators can be expanded using the cascading inputs as
shown. The lowest order comparator has a HIGH on the A = B input.
LSBs MSBs
A0 COMP A4 COMP
A1 0 A5 0
A2 A A6 A
A3 A7
3 3
A>B A>B A>B A>B
+5.0 V A=B A=B A=B A=B Outputs
A<B A<B A<B A<B
B0 0 B4 0
B1 B B5 B
B2 B6
B3 3 B7 3
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Comparator Chip
A0 A0
A1 X A1 X
A2 A2
A3 A3
Active HIGH decoder for 0011 Active LOW decoder for 0011
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decoders
A0 = 0
A1 = 1
1
A2 = 0
A3 = 1
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decoders
IC decoders have multiple outputs to decode any
combination of inputs. For example the hex decoder
shown here has 16 outputs – one for each combination of
binary inputs. Bin/Dec
0 1
For the input shown, 1 1
2 1
what is the output? 3 1
4 1
1 A0 5 1
6 1
4-bit binary 1 A1 7 1 Decimal
input 0 A2 8 1 outputs
9 1
1 A3 10 1
11 0
12 1
13 1
14 1
15 1
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decoders
X/Y
0
A specific integrated circuit 1
decoder is the 74154, a 4-to-16 2
3
decoder. It includes two active 4
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Octal Decoder
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Encoders
Show how the BCD encoder converts the decimal
number 3 into a BCD 0011.
The top two OR gates have ones as indicated with
the red lines. Thus the output is 0011.
1 0 1
A0
2 0
1
3 1
A1
4 0
5 0 0
6
0
0 A2
7
8 0 0
A3
0
9
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Encoders
The 74147 is an example of an IC encoder. It is has ten
active-LOW inputs and converts the active input to an
active-LOW BCD output. V CC
(16)
This device offers additional (11)
HPRI/BCD
1
flexibility in that it is a priority (12)
2
(13)
encoder. This means that if more (1)
3
1 (9)
4 (7)
than one input is active, the one Decimal (2) 5
2
(6)
BCD
input 4 output
with the highest order decimal (3)
(4)
6
8
(14)
digit will be active. (5)
7
8
(10)
9
(8)
74HC147
The next slide shows an application … GND
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
VCC
Encoders R7 R8 R9
Keyboard
7 8 9
encoder HPRI/BCD
1
R4 R5 R6 2
3
1
4
2
5 4 BCD complement of
6
4 5 6 7
8 key press
8
9
R1 R2 R3 74HC147
1 2 3
R0
The zero line is not needed by the
0 encoder, but may be used by other
circuits to detect a key press.
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
BCD Encoder
10 input pins.
4 output pins for output code.
Also called 10-line-to-4-line
encoder.
May have other inputs and outputs
too, such as enable inputs.
Example chip: 74147
Octal Encoder
8 input pins.
3 output pins for output code.
Also called 8-line-to-3-line encoder.
May have other inputs and outputs
too, such as enable inputs.
Example chip: 74148
Different Numeric Codes
MUX DEMUX
Select Inputs Select Inputs
A MUX routes one of its data inputs A DEMUX routes its single data input
to its single data output. to one of its data outputs.
Multiplexers
A multiplexer, or “MUX,” (also called a data selector)
selects one of two or more data inputs and routes data
from that selected input to the output. The particular data
input that is selected is determined by the select inputs.
MUX
Two select inputs are shown 0
Select S0 0
here to choose any of the inputs 1 1
S1
four data inputs.
D0 0 Data
Data D1 1 output
inputs D2 2
Which data input is selected D3 3
if S1S0 = 10? D2
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Some Multiplexer Chips
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
A0
A1
Demultiplexers
A2
Determine the outputs, given the
inputs shown. G1
G2A LOW
The output logic is opposite to the input G2B LOW
because of the active-LOW convention. (Red
shows the selected line). Y0
DEMUX Y1
Y0
A0
Select Y1 Y2
inputs A1
A2
Y2
Data
Y3
Y3
Data input Y4 outputs Y4
G1
Y5
Enable G2A Y5
Y6
inputs G2B Y6
Y7
74LS138 Y7
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Some Demultiplexer Chips