Lab Report 4
Lab Report 4
Lab Report 4
EEE 304
Experiment No. 04
Objectives:
(i) Implementation of simple decoding technique
(ii) Introduction of priority concept in encoding/decoding
(iii) Study different aspects of MUX(Data Selector)
Apparatus:
(i) OR gate (IC 7432, 1 piece)
(ii) AND gate (IC 7408, 2 piece)
(iii) NOT gate (IC 7404, 1 piece)
(iv) IC 74150 (16X1 MUX)(1 piece)
(v) IC 74153 (dual 4X1 MUX)(1 piece)
(vi) IC 74154 (4 line to 16 line decoder)(1 piece)
(vii) Wires, trainer board etc.
Introduction to decoder logic:
The basic function of a decoder circuit is to detect the presence of a specific combination of
bits(code) on its inputs and to indicate the presence of that code by a specified output level. In its
general form, a decoder has n input lines to handle n bits and 2^n output lines to indicate the
presence of one or more n-bit combinations.
Example:
Suppose we need to construct a decoder system which has A and B (i.e 2 bits) as its input and we
have to determine the presence of each combination of these inputs (2^2=4 combination)by
observing the output lines(one for each combination). The presence of AB=11 can be determined
by observing the output of an AND gate whose output is AB. Similarly logic equation for other 3
combinations can be found. Then , if we find out which output line is active ,we can determine
input. The complete circuit diagram is shown below:
Prelab 1: Develop the logic required to detect the binary code 10010 and produce an active
LOW output.
Exercise 1: Construct a decoder circuit which can detect the presence of 8 and 15 at the
input.
The number (8 or 15) that is present at the input in binary, is high at the output.
Here, each decoder has two control inputs. For active operation both of them should be low. The
upper decoder is for lines 0-15, and the lower decoder is for lines 16-32. The lower decoder is
chosen by the state of MSB (10000 - 11111). A NOT gate performs this function. When MSB is
equal to 1, the lower decoder is activated while the upper one is inactive.
For example, when the input is 10110 (decimal 22), the decoder output is 22nd pin which is low
and the rest are high.
Note that A0 output should be high when any of 1,3,5,7,9 input lines is present at the input.
Hence the expression for A0 will be:
A0 = 1+3+5+7+9
Similarly, A1=2+3+6+7
A2=4+5+6+7
A3= 8+9
The input lines do not always exhibits same priority. There may be cases where some inputs
have higher priorities than others. In such cases, when two input lines are active simultaneously,
the output choose to respond to the input line with highest priority. The encoder described above
can be modified to function as a priority encoder.
In that case, the encoder will produce BCD output corresponding to the highest order decimal
digit input that is active and will ignore any other active inputs. For example, if the 6 and 3
inputs are both active, the BCD output is 0110 (which represents decimal 6).
Now lets look at the requirements for the priority detection logic. This logic circuitry prevents a
lower order digit input from disrupting the encoding of a higher order digit. We want to examine
the output A0. Note that A0 is HIGH when 1,3,5,7 or 9 is high. Note that Digit 1 should activate
the A0 output only if no higher order digits other than those that also activate A0 are HIGH. The
requirements can be stated as follows:
1.A0 is HIGH if 1 is HIGH and 2,4,6 and 8 are LOW
2.A0 is HIGH if 3 is HIGH and 4,6 and 8 are LOW
3.A0 is HIGH if 5 is HIGH and 6 and 8 are LOW
4.A0 is HIGH if 7 is HIGH and 8 are LOW
5.A0 is HIGH if 9 is HIGH
A0 output is HIGH if any of the above 5 conditions occur. Hence,
1
x
x
1
0
2
x
x
x
1
3
x
1
0
0
A1
0
1
0
1
A0
0
1
1
0
Note from the table that when C is 1, output is connected to the input B and in that case the state
of input at A does not have any effect on the output Y. Similarly when C is 0, output is connected
to the input A.
Exercise 4: Implementation of the Multiplexing function using IC 74LS153
This multiplexer has two enable pins for each of configurations. Those pins 1G and
2G have to be low for active operation. It has two control inputs A, and B which are
represented respectively by S0, and S1 in the truth table. The output is found
according to the truth table in pins 1Y, and 2Y.
Here the data inputs 1,3,5,9,11,13, and 15 are kept low while the rest are kept high.
According to the control inputs A,B,C, and D the appropriate input is chosen and
shown in the output. In this design output is high for odd number of input lines.
Exercise 6: Implement a 8 line to 1 line MUX using two 4 line to 1 line MUX (found in IC
74153) and an OR gate.