Decoders and Encoders
Decoders and Encoders
OTHER COMBINATIONAL
LOGIC CIRCUITS
WEEK 7 AND WEEK 8 (LECTURE 2 OF 3)
DECODERS
ENCODERS
DECODER
A decoder is a logic circuit that accepts a set of inputs that
represents a binary number and activates only the output that
corresponds to the input number.
In other words, a decoder circuit looks at its inputs,
determines which binary number is present there, and activates
the one output that corresponds to that number ; all other
outputs remain inactive
Decoding logic for the binary code 1001 with an active-HIGH output.
2-to-4-Line Decoder
(with Enable input)-Active LOW output (1)...
2-to-4-Line Decoder
(with Enable input)-Active LOW output (2)
The circuit operates with complemented outputs and a
complement enable input. The decoder is enabled when E is equal
to 0.
Only one output can be equal to 0 at any given time, all other
outputs are equal to 1.
The output whose value is equal to 0 represents the minterm
selected by inputs A and B
The circuit is disabled when E is equal to 1.
10
11
12
13
14
15
4-line-to-16 line Decoder constructed with two 3-lineto-8 line decoders (1)...
16
4-line-to-16 line Decoder constructed with two 3-lineto-8 line decoders (2)
When w=0, the top decoder is enabled and the other is disabled.
The bottom decoder outputs are all 0s , and the top eight outputs
generate min-terms 0000 to 0111.
When w=1, the enable conditions are reversed. The bottom
decoder outputs generate min-terms 1000 to 1111, while the
outputs of the top decoder are all 0s.
17
Application example
A simplified computer I/O port system with a port address decoder with only four address
lines shown.
18
21
23
24
BCD-7segment decoders/drivers
Most digital equipment has some means for
displaying information in a form that can
be understood by the user. This information
is often
numerical data but also be
alphanumeric.
One of the simplest and most popular
methods for displaying numerical digits
uses a 7-segment configuration to form
digital characters 0 to 9 and some times the
hex characters A to F
25
7-segment decoder
A BCD-7 segment decoder/driver is used to take four-bit
BCD input and provide the outputs that will pass current
through the appropriate segments to display the decimal digit.
The logic for this decoder is more complicated than the logic
of decoders of earlier case, because each output is activated for
more than one combination of inputs.
27
28
29
31
7-segment display
There are two types of 7segment LED displays;
A) common - anode
B) common cathode
32
Common Anode
In commonanode, the anode of all of the LEDs are tied together to
positive of the power supply (Vcc) as shown
33
Common Cathode
In commoncathode, the cathode of all of the LEDs are tied together to
ground as shown.
GND
34
35
36
37
Encoder
An encoder is a combinational logic circuit that essentially
performs a reverse of decoder functions.
An encoder accepts an active level on one of its inputs,
representing digit, such as a decimal or octal digits, and
converts it to a coded output such as BCD or binary.
Encoders can also be devised to encode various symbols and
alphabetic characters.
The process of converting from familiar symbols or numbers
to a coded format is called encoding.
39
41
42
A low at any single input will produce the output binary code corresponding to that
input. For instance , a low at A3 will produce O2 =0, O1=1 and O0 =1, which is
binary code for 3. Ao is not connected to the logic gates because the encoder
outputs always be normally at 0000 when none of the inputs is LOW
43
0
0
1
X
X
0
0
0
1
X
0
0
0
0
1
X
0
0
1
1
X
0
1
0
1
0
1
1
1
1
44
V=D0+D1+D2+D3
K-Maps for 4-input Priority Encoder
46
48
51
52
ActiveLOW enable output, the output pin goes LOW when all
inputs are inactive (HIGH) and is LOW.
53
54
55
Application example
56
When one of the keys is pressed, the decimal digit is encoded to the
corresponding BCD code
The keys are represented by 10 push-button switches, each with a pull-up
resistor to V+. The pull-up resistor ensures that the line is HIGH when a key is
not depressed.
When a key is depressed, the line is connected to ground, and a LOW is applied
to the corresponding encoder input.
The zero key is not connected because the BCD output represents zero when
none of the other keys is depressed
The BCD complement output of the encoder goes into a storage device, and
each successive BCD code is stored until the entire number has been entered
57
Exercise
Sketch the output waveforms of the 74LS148 encoder based on the given waveforms.
Assume that
58