Mini Project 1 - 2-to-4 Decoder with Enable Input E and 4-to-2 Line Priority Encoder
1. EEEC6420307
Digital Circuits and SystemDesign
Faculty of Engineering and Computer Technology
Laboratory Manual
Lecturer: Ravandran Muttiah BEng (Hons) MSc MIET
Year/Semester: Year 1 / Semester 2
Academic Session: 2021/2022
The information in this documentis important and should be noted by all students undertaking the
Bachelor of Engineering (Honours) in Electrical and Electronic Engineering
Approved by Coordinator: Endorsed By Dean:
------------------------------------------ __________________
2. AIMST University Faculty of Engineering and Computer Technology
BEng (Hons) in Electrical and Electronic Engineering Digital Circuits and System Design 1
Mini Project 1 - 2-to-4 DecoderWith Enable Input E And 4-to-2 Line
Priority Encoder
Decoder
An ๐ โ to โ 2๐
decoder is a multiple-output combinational logic network with ๐ input
lines and 2๐
output signals, as illustrated in figure 1. For each possible input condition,
one and only one output signal will be at logic 1. Therefore, we may consider the ๐ โ
to โ 2๐
decoder as imply a minterm generator, with each output corresponding to exactly
one min-term. Decoders are important tools in the logic designerโs repertoire. They are
used for such things as interrogating memory in order to select a particular word from the
many that are available, code conversion (for example, binary to decimal), and routing of
data.
Figure 1: ๐ โ to โ 2๐
decoder module.
Decoder Circuit Structures
The logic circuit of a 2-bit parallel decoder is shown in figure 2. In general, this decoder
is very simple, but also expensive. As can be seen from the figure, an input combination
or vector of ๐ต๐ด = 00 selects the ๐0 output line, ๐ต๐ด = 01 selects the ๐1 output line, and
so on.
๐0 = ๐ต
ฬ ๐ดฬ
๐1 = ๐ต
ฬ ๐ด
๐2 = ๐ต๐ดฬ
๐3 = ๐ต๐ด (1)
The AND gate realisations of the ๐ โ to โ 2๐
decoder shown in figure 2 there is only a
single level of logic and that one ๐ โ input AND gate is required for each of the 2๐
output lines. However, a problem is soon encountered in this configuration as ๐ becomes
๐ฅ0
๐ฅ๐โ1
๐ฆ0
๐ฆ1
๐ฆ2๐
โ1
โฎ โฎ
LSB
MSB
๐ โ to โ 2๐
Decoder
๐ฅ1
3. AIMST University Faculty of Engineering and Computer Technology
BEng (Hons) in Electrical and Electronic Engineering Digital Circuits and System Design 2
large because the number of inputs to the AND gates (the fan-in) exceeds practical limits
(five or six). Then two-input AND gates are used to combine these signals to form the 2๐
output lines for the total decoder network.
Figure 2: Two-bit parallel decoder circuit structure (active-high outputs).
Enable Control Inputs
Decoders often include one or more enable inputs, as shown in figure 3, which can be
used to either inhibit (disable) the designated function or allow (enable) it to be
performed. The decoding function of a decoder is inhibited by forcing all its outputs to
the inactive state. For example, output ๐ฆ0 of the 2 โ to โ 4 decoder in figure 3 is given
by ๐ฆ0 = ๐ฅฬ 1๐ฅฬ 0๐ธ = ๐0๐ธ. In general,
๐ฆ๐ = ๐๐๐ธ (2)
When ๐ธ = 0, all outputs are forced to 0, whereas for ๐ธ = 1, each output ๐ฆ๐ is equal to
๐๐.
Figure 3: 2 โ to โ 4 decoder with enable input ๐ธ.
๐0
LSB ๐ด
MSB ๐ต
๐1
๐2
๐3
๐ฆ0
๐ฆ1
๐ฆ2
๐ฆ3
๐0
๐1
๐ธ
๐ฆ0
๐ฆ1
๐ฆ2
๐ฆ3
๐ฅ0
๐ฅ1
๐ฅ2
4. AIMST University Faculty of Engineering and Computer Technology
BEng (Hons) in Electrical and Electronic Engineering Digital Circuits and System Design 3
Encoders
An encoder is a combinational logic module that assigns a unique output code (a binary
number) for each input signal applied to the device; as such, it is the opposite of a
decoder. If an encoder module has ๐ inputs, the number of outputs ๐ must satisfy the
expression,
2๐
โฅ ๐ (3)
or
๐ โฅ log2 ๐
Encoder Circuit Structures - Encoders with Mutually Exclusive Inputs
Consider first the case in which the inputs are mutually exclusive; that is, one (and only
one) of the input lines is active at any particular instant in time; two or more input lines
are never simultaneously active. In this case the input combinations that never occur may
be used as donโt-care conditions. The design of an encoder for four input lines if one and
only one is active at any moment in time is shown in figure 4.
Figure 4: 4 โ to โ 2 line encoder.
๐0
๐3
๐ด0
๐1
๐2
๐ด1
4 โ to โ 2
Encoder
5. AIMST University Faculty of Engineering and Computer Technology
BEng (Hons) in Electrical and Electronic Engineering Digital Circuits and System Design 4
Table 1: Truth table
Priority Encoders
Another type of encoder is the priority encoder. The priority encoder allows multiple
input lines to be active and sends out the binary value of the subscript of the input line
with highest priority. To simplify the design, the highest priority is assigned to the
highest subscript, the next highest priority to the second highest subscript, and so on.
Consider the priority encoder of figure 5. The input lines are encoded,
๐ด1 ๐ด0
๐0 โ 0 0
๐1 โ 0 1
๐2 โ 1 0
๐3 โ 1 1
If no input line is active, the priority encoder sends out (๐ด1๐ด0) = (00). If a single line is
active, the encoder sends out the binary value of the subscript of the active line. If more
than one input is active, the encoder sends out the binary value of the largest subscript of
the active lines. Table 2 displays the truth table for the encoder. Note that the two
additional output lines indicate that no input line is active (๐ธ๐ = 1) and one or more
inputs are active (๐บ๐ = 1). Figure 6 present the logic diagram of the function, which
reduces to,
๐3 ๐2 ๐1 ๐0 ๐ด1 ๐ด0
0 0 0 0 ๐ ๐
0 0 0 1 0 0
0 0 1 0 0 1
0 0 1 1 ๐ ๐
0 1 0 0 1 0
0 1 0 1 ๐ ๐
0 1 1 0 ๐ ๐
0 1 1 1 ๐ ๐
1 0 0 0 1 1
1 0 0 1 ๐ ๐
1 0 1 0 ๐ ๐
1 0 1 1 ๐ ๐
1 1 0 0 ๐ ๐
1 1 0 1 ๐ ๐
1 1 1 0 ๐ ๐
1 1 1 1 ๐ ๐
Outputs
Inputs
7. AIMST University Faculty of Engineering and Computer Technology
BEng (Hons) in Electrical and Electronic Engineering Digital Circuits and System Design 6
The two output functions ๐ด1 and ๐ด0 are independent of ๐0. Note that the priority encoder
can realise the truth table of table 1.
Figure 6: Logic diagram of 4 โ to โ 2 line priority encoder.
Objectives
The objective of this experimental project is to become acquainted with the design of
decoder and an encoder. Demonstrate your ability to design and construct the decoder
and encoder, and to view the function of the inputs and outputs respectively.
Specification
Design a 2 โ to โ 4 decoder with enable input ๐ธ, and a 4 โ to โ 2 line priority encoder.
Report
Write a laboratory report on this project:
(1) Explain in detail about the theory of 2 โ to โ 4 decoder with enable input ๐ธ, and
the 4 โ to โ 2 line priority encoder.
(2) Discuss the method of productions and fabrications of decoder and encoder, and
comment on the test results.
(3) Prepare slides for presentation and demonstration of this project.
๐ด0
๐ด1
๐ธ0
๐ธ๐
๐1
๐
ฬ 2
๐3
๐0
๐2