THE 8421 BCD CODE
• BCD stands for Binary-Coded Decimal.
• A BCD number is a four-bit binary
group that represents one of the ten
decimal digits 0 through 9.
Example:
Decimal number 4926 4 9
2 6
8421 BCD coded number 0100 1001 0010 0110
Encoder &
Decoder
ENCODERS AND DECODERS
A0 O0 A0 O0
A1 O1 A1 O1
A2 O2 A2 O2
A3 ENCODER DECODER O3
A4 O4
A5 O5
A6 O6
A7 O7
ONLY ONE INPUT BINARY CODE INPUT
ACTIVATED AT A TIME ONLY ONE OUTPUT
BINARY CODE OUTPUT ACTIVATED AT A TIME
ENCODER
A digital circuit that produces a binary
output code depending on which of its
inputs are activated.
• An Encoder is a combinational logic circuit.
• It performs the inverse operation of a
Decoder.
• The opposite process of decoding is known as
Encoding.
• An Encoder converts an active input signal
into a coded output signal.
• Block diagram of Encoder is shown in Fig.10. It
has ‘M’ inputs and ‘N’ outputs.
• An Encoder has ‘M’ input lines, only one of
which is activated at a given time, and
produces an N-bit output code, depending
on which input is activated.
•Encoders are used to translate the rotary or
linear motion into a digital signal.
•The difference between Decoder and Encoder
is that Decoder has Binary Code as an input
while Encoder has Binary Code as an output.
•Encoder is an Electronics device that converts
the analog signal to digital signal such as BCD
Code.
•Types of Encoders
• Decimal to BCD Encoder – Converts
decimal digits to BCD; used in digital
displays.
• 4 to 2 Encoder- It is widely used in the
following applications: Data
multiplexing, Generating digital control
signals, Address decoding applications,
Encoding data in digital systems, etc.
• 8 to 3 Encoder – Converts octal input to
binary; used in memory and digital systems.
DECIMAL TO BCD
ENCODER:
• It has ten inputs corresponding to ten
decimal digits (from 0 to 9) and four
outputs (A, B, C, D) representing the
BCD.
•From Truth Table it is clear that the
output A is HIGH when input is 8 OR 9 is
HIGH
Therefore A = 8 + 9
•The output B is HIGH when 4 OR 5 OR
6 OR 7 is HIGH
Therefore B = 4 + 5 + 6 + 7
•The output C is HIGH when 2 OR 3 OR
6 OR 7 is HIGH
Therefore C = 2 + 3 + 6 + 7
•Similarly D = 1 + 3 + 5 + 7 + 9
ELECTRONIC ENCODER -
DECIMAL TO BCD
BCD output
Decimal input
00
1011
0
7
Decimal
5 to
BCD
3 Encoder
0
• Encoders are available in IC form.
• This encoder translates from decimal
input to BCD output.
•It has eight inputs and three outputs.
•Only one input has one value at any given time.
Octal to Binary •Each input corresponds to each octal digit and output
Encoder generates corresponding Binary Code.
From Truth table:
X = D₄ + D₅ + D₆ + D₇
Y = D₂ + D₃ + D₆ + D₇
Z = D₁ + D₃ + D₅ + D₇
• It is assume that only one input is HIGH at any
given time. If two outputs are HIGH then
undefined output will produced.
For example D₃ and D₆ are HIGH, then
output of Encoder will be 111. This output neither
equivalent code corresponding to D₃ nor to D₆.
• To overcome this problem, priorities should be
assigned to each input.
• Form the truth table it is clear that the output X
becomes 1 if any of the digit D₄ or D₅ or D₆ or D₇
is 1.
• D₀ is considered as don’t care because it is not
shown in expression.
• If inputs are zero then output will be zero.
Similarly if D₀ is one, the output will be zero.
4 to 2 Encoder
• A 4 to 2 Encoder is a type of
encoder which has 4 (22) input
lines and 2 output lines.
• It produces an output code (i.e.,
convert input information in a
2-bit format) depending on the
combination of input lines.
• The working of a 4 to 2 Encoder for different input
combinations is described in the following truth
table −
From the truth table, the outputs are derived as:
• Y₀ = I₁ + I₃
• Y₁ = I₂ + I₃
The following figure depicts the logic diagram of the 4
to 2 Encoder.
DECODER
A digital circuit that converts an
input binary code into a single
numeric output.
• A decoder is a combinational circuit.
• A decoder accepts a set of inputs that
represents a binary number and
activates only that output
corresponding to the input number. All
other outputs remain inactive.
• A decoder with n inputs can have up to 2ⁿ
outputs.
• Some decoders have one or more
ENABLE (E) inputs that are used to
control the operation of the decoder.
TYPES OF DECODER
• 2-to-4 Line Decoder
Has 2 input lines and 4 output lines. Activates one of four
outputs for each input combination.
• 3-to-8 Line Decoder
Has 3 input lines and 8 output lines. Widely used in memory
addressing.
• BCD to Decimal Decoder
Converts Binary-Coded Decimal (BCD) input into its
corresponding decimal output (0–9).
• BCD to 7-Segment Decoder
Converts BCD input into signals to drive a 7-segment display
(used in digital clocks, calculators).
2 to 4 Line Decoder
• The 2 to 4 decoder is one that has 2
input lines and 4 (22) output lines.
• When this decoder is enabled with
the help of enable input E, then its
one of the four outputs will be active
for each combination of inputs. The
operation of this 2-line to 4-line
decoder can be analyzed with the
help of its truth table which is given
below.
Decoder Output Expressions
• Using the truth table, we can derive
the Boolean expression for each
output as follows:
• Here,
E = Enable input
A, B = Input variables
Y₀ to Y₃ = Output lines
3-to-8 Line
Decoder
•The 3 to 8 decoder is one that has 3
input lines and 8 (23) output lines
•When this decoder is enabled with the
help of enable input E, then it's one of
the eight outputs will be active for each
combination of inputs. The operation of
this 3-line to 8-line decoder can be
analyzed with the help of its function
table which is given below.
• Using the function table, we can derive
Boolean Expressions &
the Boolean expression for each output
Logic Circuit Diagram
as follows:
for 3-to-8 Decoder
• Where:
E = Enable input
A, B, C = Input variables
Y₀ to Y₇ = Output lines
• As we can see, each output term
contains products of input variables,
hence they can be implemented with the
help of AND gates. Therefore, the logic
circuit diagram of the 3 to 8 decoder
BCD to Decimal Decoder
• A decoder that takes a 4-bit
BCD as the input code and
produces 10 outputs
corresponding to the decimal
digits is called a BCD to decimal
decoder.
• Here each output goes high
when its corresponding BCD
code is applied at inputs.
We can derive the Boolean expressions for each of the
decimal outputs in terms of 8421 BCD code. These
Boolean expressions are given below −
• The logic circuit implementation of the BCD to decimal
converter is shown in the following figure.
BCD to 7-Segment
Decoder
• A BCD to seven-segment
decoder is a circuit that converts
BCD input into signals for a seven-
segment display.
• It has four input lines (A, B, C, and
D) and seven output lines (a, b, c,
d, e, f, and g).
• Truth table for common cathode
type BCD to seven segment
decoder
• We can derive the Boolean expressions-
The logic circuit implementation of
the BCD to seven-segment decoder is
shown in the following figure.
DECODERS: BCD TO
7-SEGMENT DECODER
BCD input Decimal output
LED
0
010
00
1 1
10
0 1
1
0
BCD-to-
7-Segment
Decoder
• Electronic decoders are available in IC form.
• This decoder translates from BCD to decimal.
• Decimals are shown on an 7-segment LED display.
• This IC also drives the 7-segment LED display.
4 to 2 Encoder with 2 to 4 Decoder
Advantages and Disadvantages of
Encoder & Decoder
Encoders Decoders
Advantages: Advantages:
• Reduces the number of data lines. • Converts coded data into usable information.
• Simplifies circuit complexity. • Simplifies circuit operation in multi-output
• Useful in data compression and systems.
transmission. • Essential in memory selection and display
• Helps in tracking motion (rotary/optical systems.
encoders). • Used in demultiplexing and instruction
Disadvantages: decoding.
• Priority conflicts if multiple inputs are active. Disadvantages:
• Requires additional logic to handle invalid • Limited to specific input-output
inputs. combinations.
• Limited accuracy in mechanical applications. • Complexity increases with higher bit inputs.
• Sensitive to input noise in real-world
applications.
Applications Of
Encoder and
Decoder
1). Speed Synchronization of
Multiple Motors in Industries
The proposed system
uses a reference motor to set a
desired speed transmitted via RF
communication. It consists of a
transmitter block (with encoder)
and a receiver block (with
decoder). The transmitter sends
the speed data digitally, which
the receiver decodes and applies
to other motors. This ensures all
motors maintain the same speed
as the reference motor.
2) Robotic Vehicle with Metal
Detector
This project develops an RF-
controlled robotic vehicle that detects
metals, simulating landmine detection.
Commands are encoded by the RF
transmitter using an encoder and sent
wirelessly to the receiver. The RF
receiver decodes the signals using a
decoder and passes them to a
microcontroller to control the motors.
The system offers a range of up to 200
meters with a proper antenna.
3) Automatic Wireless Health
Monitoring System in Hospitals for
Patients
This project designs a wireless
system for remote patient temperature
monitoring using RF communication.
The transmitter reads temperature via
a digital sensor, displays it on an LCD,
and sends encoded data using an
encoder and RF module. The receiver
decodes the data with a decoder and
displays it for the doctor. This enables
continuous, wireless health monitoring.
4) Secret Code Enabled Secure
Communication using RF
Technology
This project enables secure
message transmission via RF technology
using a secret code. The message from a
keyboard is encoded with the secret code
using an encoder and sent through an RF
transmitter. At the receiver end, the signal is
decoded using a decoder, and the message
is displayed only upon correct code entry.
This ensures complete confidentiality in
communication.