0% found this document useful (0 votes)
21 views13 pages

Encoder

Uploaded by

anzilshahjahan1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views13 pages

Encoder

Uploaded by

anzilshahjahan1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Encoder

Learning Intention
• Computers are made up of digital circuits and a logic gate is
the building blocks of these circuits.
• It is necessary to analyse the working of simple logic circuits,
as this fundamental knowledge will be useful in designing
more complex electronic circuits using the logic gates.
Success Criteria
At the end of this unit the student should be able to
• Analyze the working of simple logic circuits
• Design simple logic circuits like the Encoder, Decoder and
Multiplexer using the appropriate logic gates (either
Fundamental or derived)
Lesson Objectives
To be able to
• analyze Encoder circuits
• explain the working of Encoder circuits
• design the block diagrams and truth tables for designing
encoder circuits
• design a 4 to 2 encoder, Octal to Binary encoder, Decimal to
Binary encoder and Hexadecimal to Binary encoder circuits
Encoder
• A binary encoder, is a multi-input combinational logic circuit that
converts its inputs into an equivalent binary code as its output.

• It accepts a decimal or an octal digit or a hexadecimal digit and


converts it to Binary signals.
Inputs and Outputs in an Encoder
• Generally, digital encoders produce outputs of 2-bit, 3-bit or 4-
bit codes depending upon the number of data input lines.
• An “n-bit” binary encoder has 2n input lines and n-bit output
lines with common types that include 4-to-2, 8-to-3 and 16-to-4
line configurations.
• A classic application example is a keyboard encoder. The ten
decimal digits on the keyboard of a computer, must be encoded
for processing by the logic circuitry. When one of the keys is
pressed, the decimal digit is encoded to the corresponding
Binary code.
Method of determining the number of output lines
• In order to convert the digits 0 to 9 ie., 10 digits into binary, the number of output lines of the
encoder will be 4, as a minimum of 4 bits are required to represent the digits 0 to 9.
• Similarly, to convert the digits 0 to 7 ie., 8 digits into binary, the number of output lines of the
encoder will be 3, as a minimum of 3 bits are required to represent the digits 0 to 7.
• To convert hexadecimal digits (0 to 9, A-F), i.e. 16 digits into binary, the number of output lines
of the encoder will be 4, as a minimum of 4 bits are required to represent the digits.

• 2n must be >= I where I represents the total digits to be encoded.


• If I is 10, as the digits 0-9 are to be encoded, then n must be 4.
• If I is 8, as the digits 0-7 are to be encoded, then n must be 3.
• If I is 16, as the digits 0-15 (hexadecimal 0-9 and A-F) are to be encoded, then n must be 4
4 to 2 Encoder
Block Diagram Truth Table

The above Encoder is capable of converting 4 digits From the truth table, the Boolean function for each output is
(0 - 4) to a Binary form. A1 = Y3 + Y2
The 4 to 2 Encoder consists of four inputs Y3, Y2, Y1 A0 = Y3 + Y1
The above two Boolean functions can be implemented using
& Y0 and two outputs A1 & A0. At any time, only
two input OR gates. The circuit diagram of 4 to 2 encoder is
one of these 4 inputs can be ‘high’ in order to get
shown in the following figure.
the respective binary code at the output.
A0 has value 1 for input switches 1 and 3 and A1
has value 1 for input switches 2 and 3. Therefore A0
is connected to switches 1 and 3 and A1 is
connected to switches 2 and 3.
Working of the 4 to 2 Encoder

.When Y1 is pressed When Y2 is pressed When Y3 is pressed

• When Y0 is pressed, there is no signal


• For this circuit, an OR gate is used, because only some of the inputs may be active and the rest of the
inputs may be inactive and only an OR gate will be able to get the output.
Decimal to Binary Encoder – Block Diagram
Truth Table for Decimal to Binary Encoder
• This is a basic 10-line-to-4-line encoder. This encoder converts decimal numbers to
equivalent binary numbers. This type of encoder has ten inputs--one for each decimal
digit-and four outputs corresponding to the Binary code, as shown in the table below.
Y9 Y8 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 A3 A2 A1 A0 From the table, the relationship between the
Binary digits and the decimal digits can be
0 0 0 0 0 0 0 0 0 1 0 0 0 0 analyzed.
0 0 0 0 0 0 0 0 1 0 0 0 0 1
Let us consider the MSB of the Binary code is A3
0 0 0 0 0 0 0 1 0 0 0 0 1 0 and the LSB of the Binary code is A0.
0 0 0 0 0 0 1 0 0 0 0 0 1 1
From the table, it is clear that, A3 is always a 1
0 0 0 0 0 1 0 0 0 0 0 1 0 0 for decimal digits 8 and 9, A2 is always a 1 for
0 0 0 0 1 0 0 0 0 0 0 1 0 1 decimal digits 4,5,6,7, A1 is always a 1 for
decimal digits 2,3,6,7 and A0 is always a 1 for
0 0 0 1 0 0 0 0 0 0 0 1 1 0 decimal digits 1,3,5,7,9 and the other input lines
0 0 1 0 0 0 0 0 0 0 0 1 1 1 are 0.
0 1 0 0 0 0 0 0 0 0 1 0 0 0 So, if the input lines consist of 0s and 1s and an
1 0 0 0 0 0 0 0 0 0 1 0 0 1 output signal must be obtained, then each BCD
bit is to be represented as an OR gate and the
A3=Y8 + Y9, A2= Y4 + Y5+Y6+Y7 outputs from these 4 OR gates will be the Binary
A1 = Y2+Y3+Y6+Y7, A0=Y1+Y3+Y5+Y7+Y9 equivalent of the pressed switch.
Encoder Circuit
• In the Encoder circuit shown below, the input lines from switches 8 and 9 are connected to the OR gate
represented by A3, the input lines from switches 4,5,6 and 7 are connected to the OR gate represented by
A2, the input lines from switches 2,3,6 and 7 are connected to the OR gate represented by A1 and the input
lines from switches 1,3,5,7 and 9 are connected to the OR gate represented by A0.

When a HIGH appears on one of the decimal digit input lines, the
appropriate binary equivalent is generated. For instance, if input
line 9 is HIGH, assuming all other input lines are LOW, this
condition will produce a HIGH on outputs A0 and A3 and LOW on
outputs A1 and A2, which is the Binary code, 1001 for decimal 9.
Similarly, when push button 4 is pressed (input line 4 is HIGH),
only A2 gets a HIGH input and A3, A1 and A0 get LOW inputs.
Therefore, A2 produces a HIGH output and A3, A1 and A0 produce
LOW outputs.
A3 A2 A1 A0 = 0100 (which is the binary equivalent of the decimal
digit 4)
The working of the Octal to Binary encoder and Hexadecimal to
Binary encoder circuits can be explained in a similar manner.
Test your understanding
• Draw the block diagram, truth table and the circuit diagram of a
Hexadecimal to Binary Encoder. Give a brief explanation of its
working.

You might also like