Sie sind auf Seite 1von 7

EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

Date: 07-09-20

Experiment No.5: Encoder/Decoder and Code Decoder.

Objectives:
 Study about encoder, decoder circuit and binary to gray code converter.
 Making Logic Diagram.

Theoretical Background:
Encoder: An Encoder is a combinational circuit that performs the reverse operation of Decoder. It has
maximum of 2n input lines and ‘n’ output lines. It will produce a binary code equivalent to the input,
which is active High. Therefore, the encoder encodes 2 n input lines with ‘n’ bits. It is optional to
represent the enable signal in encoders.
4 to 2 Encoder: Let 4 to 2 Encoder has four inputs Y 3, Y2, Y1 & Y0 and two outputs A1 & A0. The block
diagram of 4 to 2 Encoder is shown in the following figure.

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

At any time, only one of these 4 inputs can be ‘1’ in order to get the respective binary code at the
output. The Truth table of 4 to 2 encoder is shown below.

Boolean Algebra: A1=Y3+Y2 A0=Y3+Y1

4:2 Priority Encoder: A 4 to 2 priority encoder has four inputs Y 3, Y2, Y1 & Y0 and two outputs A 1 & A0.
Here, the input, Y3 has the highest priority, whereas the input, Y 0 has the lowest priority. In this case,
even if more than one input is ‘1’ at the same time, the output will be the binary code corresponding to
the input, which is having higher priority.
We considered one more output, V in order to know, whether the code available at outputs is valid or
not.
 If at least one input of the encoder is ‘1’, then the code available at outputs is a valid one. In this
case, the output, V will be equal to 1.
 If all the inputs of encoder are ‘0’, then the code available at outputs is not a valid one. In this
case, the output, V will be equal to 0.
The Truth table of 4 to 2 priority encoder is shown below.

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

Boolean Algebra: A1=Y3+Y2 A0=Y3+Y1Y2’ V= Y 3+Y2+ Y1+Y0


Decoders: A decoder is a logic circuit that will detect the presence of a specific binary number or word.
The input to the decoder is a parallel binary number and the output is a binary signal that indicates the
presence or absence of that specific number. It is a combinational circuit that converts binary
information from n input lines to a maximum of 2 n unique output lines.

Boolean Algebra: F1 = A’.B’ F2 = A.B’ F3 = A’.B F4 = A.B

Binary to Gray Code Converter: The logical circuit which converts the binary code to equivalent Gray
code is known as binary to Gray code converter. An n-bit Gray code can be obtained by reflecting an n-
1-bit code about an axis after 2n-1 rows and putting the MSB (Most Significant Bit) of 0 above the axis and
the MSB of 1 below the axis. Reflection of Gray codes is shown below.

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

The 4-bit binary to Gray code conversion table is given below:

Gray code to Binary Converter: In a gray to binary code converter, the input is gray code and output is
its equivalent binary code. Let us consider a 4-bit gray to binary code converter. To design a 4-bit gray to
binary code converter, we first have to draw a gray code conversion table, as shown below:

Logic Diagram:

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

Area of Electronics and Communication Engineering , NIIT University


EL 101, DIGITAL LOGIC CIRCUITS LAB, AY2020-2021

Learnings: In this experiment we learned about encoder and decoders. We also learned
their applications. We learned about how to generate gray code from binary and also
how to convert gray code to binary. We also learned advantages of encoders, decoders
and binary to gray converter. We learned about disadvantages of each one of them. This
gave us the view why we use priority encoder.

Area of Electronics and Communication Engineering , NIIT University

Das könnte Ihnen auch gefallen