0% found this document useful (0 votes)
2 views6 pages

Encoder Decoder Assignment

This assignment explores encoders and decoders, essential combinational circuits in digital electronics that convert input signals into binary codes and vice versa. It covers their definitions, working principles, types, truth tables, and real-world applications, highlighting their roles in systems like microprocessors and communication hardware. The document concludes by emphasizing the importance of understanding these circuits for further studies in digital design and architecture.

Uploaded by

awaishs888
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)
2 views6 pages

Encoder Decoder Assignment

This assignment explores encoders and decoders, essential combinational circuits in digital electronics that convert input signals into binary codes and vice versa. It covers their definitions, working principles, types, truth tables, and real-world applications, highlighting their roles in systems like microprocessors and communication hardware. The document concludes by emphasizing the importance of understanding these circuits for further studies in digital design and architecture.

Uploaded by

awaishs888
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

ASSIGNMENT

Encoders and Decoders


Subject: Digital Logic Design
Topic: Combinational Circuits — Encoders & Decoders

Submitted by: Hy

Program: BS Bioinformatics

Course Code: CS / EE – Digital Logic

Date: June 10, 2026


1. Introduction

In digital electronics, information must often be converted from one form to another to allow
different circuits and systems to communicate efficiently. Two fundamental combinational
circuits that accomplish this task are the encoder and the decoder. An encoder converts a
set of input signals into a coded binary output, while a decoder performs the reverse
operation — translating a binary code back into its original or intended form. Both circuits
are essential building blocks in modern digital systems, including microprocessors,
communication hardware, memory addressing units, and display drivers.

This assignment provides a comprehensive study of encoders and decoders: their


definitions, working principles, truth tables, logic diagrams, types, and real-world
applications.

2. Encoder

2.1 Definition
An encoder is a combinational logic circuit that converts 2n (or fewer) input lines into an
n-bit binary output code. It accepts one active input at a time and produces a unique binary
code corresponding to that input. In simple terms, it encodes the active input line number
into its binary equivalent.

2.2 Basic Working Principle


The encoder assumes that only one input is HIGH (logic 1) at any given time. Based on
which input is active, the circuit generates the corresponding binary output. For example, a
4-to-2 encoder has 4 input lines (I0–I3) and 2 output lines (A1, A0). If input I3 is HIGH, the
output is binary 11.

2.3 Truth Table — 4-to-2 Encoder

Input I3 Input I2 Input I1 Input I0 Output A1 Output A0

0 0 0 1 0 0

0 0 1 0 0 1

0 1 0 0 1 0

1 0 0 0 1 1

Table 1: Truth table of a 4-to-2 binary encoder

2.4 Boolean Expressions


From the truth table, the Boolean expressions for the outputs are:
• A1 = I2 + I3
• A0 = I1 + I3

2.5 Types of Encoders

Type Description

Simple (Basic) Encoder Only one input active at a time; no provision for multiple simultaneous inputs.

Priority Encoder Handles multiple simultaneous inputs by giving priority to the highest-order active input.

Decimal-to-BCD Encoder Converts a decimal digit (0–9) into its 4-bit BCD (Binary-Coded Decimal) equivalent.

Octal-to-Binary Encoder Converts 8 input lines into a 3-bit binary output (8-to-3 encoder).

Table 2: Types of encoders and their descriptions

2.6 Priority Encoder (8-to-3)


A priority encoder is more practical than a simple encoder because real systems often
have more than one input active simultaneously. The 8-to-3 priority encoder accepts eight
inputs (I0–I7) and provides a 3-bit output (Y2, Y1, Y0) representing the binary index of the
highest active input. It also includes a valid output (V) to indicate that at least one input is
active.

3. Decoder

3.1 Definition
A decoder is a combinational logic circuit that converts an n-bit binary input into a
maximum of 2n unique output lines. It activates exactly one output at a time based on the
binary value present at its inputs. Decoders essentially perform the reverse function of
encoders.

3.2 Basic Working Principle


For an n-input decoder, there are 2n possible outputs, and only one output is active (HIGH)
at any given moment. For example, a 2-to-4 decoder takes a 2-bit binary input (A1, A0) and
activates one of four output lines (Y0–Y3) corresponding to the binary value.

3.3 Truth Table — 2-to-4 Decoder

Input A1 Input A0 Y0 Y1 Y2 Y3

0 0 1 0 0 0

0 1 0 1 0 0
1 0 0 0 1 0

1 1 0 0 0 1

Table 3: Truth table of a 2-to-4 binary decoder

3.4 Boolean Expressions


From the truth table, the Boolean expressions for outputs are:

• Y0 = A1' · A0'
• Y1 = A1' · A0
• Y2 = A1 · A0'
• Y3 = A1 · A0

3.5 Types of Decoders

Type Description

Binary Decoder Converts an n-bit binary code into one of 2n output lines. The most fundamental type.

BCD-to-7-Segment Decoder Converts a 4-bit BCD code into signals that drive a 7-segment LED display.

BCD-to-Decimal Decoder Converts a 4-bit BCD input into one of 10 decimal output lines (0–9).

Instruction Decoder Used in CPUs to decode machine-level opcodes into control signals for the ALU and ot

Table 4: Types of decoders and their descriptions

4. Comparison: Encoder vs Decoder

Feature Encoder Decoder

Function Converts 2n inputs → n-bit code Converts n-bit code → 2n outputs

Input/Output Many inputs, fewer outputs Fewer inputs, many outputs

Active lines One input active at a time One output active at a time

Direction Compression of data Expansion of data

Common example Keyboard encoder, priority encoder 7-segment decoder, address decoder

Gate types used OR gates primarily AND gates primarily

Enable pin Not always present Often included for chip-select

Table 5: Side-by-side comparison of encoders and decoders


5. Applications

5.1 Applications of Encoders


Keyboard Encoding: Every key on a keyboard has a unique number. When pressed,
an encoder converts the keypress into its ASCII or scan code for the processor.
Data Transmission: Encoders compress data before sending it over communication
channels, reducing bandwidth usage and transmission errors.
Rotary Encoders: Used in robotics and motor control to convert shaft rotation into
digital pulses, enabling precise position and speed measurement.
Priority Interrupt Systems: In computer systems, a priority encoder identifies the
highest-priority interrupt request among multiple simultaneous requests.

5.2 Applications of Decoders


7-Segment Display Driver: A BCD-to-7-segment decoder converts a 4-bit BCD code
into the seven individual segment signals needed to display a digit on an LED display.
Memory Address Decoding: In microprocessor systems, decoders select a specific
memory chip or I/O device based on the binary address provided on the address bus.
Demultiplexing: A decoder with an enable input can function as a demultiplexer,
routing a single data input to one of several outputs.
Instruction Decoding in CPUs: The control unit of a CPU uses an instruction decoder
to interpret opcodes and generate the appropriate control signals for execution.

6. Enable Inputs and Cascading

Many practical encoder and decoder ICs include an enable (EN) pin. When EN is inactive,
all outputs are forced to a default state (0 or 1 depending on active-low logic), regardless of
the inputs. This is particularly useful for cascading — connecting multiple smaller
decoders together to create a larger one.

For example, two 2-to-4 decoders can be cascaded using the enable pin to build a 3-to-8
decoder. The most-significant bit of the 3-bit input selects which of the two decoder ICs is
active at any moment.

7. Conclusion

Encoders and decoders are indispensable components in digital circuit design. The
encoder compresses multiple input signals into a compact binary code, while the decoder
expands a binary code back into individual output signals. Together, they enable efficient
data representation, communication, memory addressing, display driving, and interrupt
handling in modern digital systems.

Understanding these circuits lays the groundwork for studying more advanced topics such
as multiplexers, demultiplexers, arithmetic circuits, and ultimately the architecture of
microprocessors and digital communication systems.

8. References

[1] Morris Mano, M. & Ciletti, M. D. (2013). Digital Design: With an Introduction to the Verilog
HDL (5th ed.). Pearson Education.

[2] Theraja, B. L. (2006). Basic Electronics Solid State. S. Chand & Company.

[3] Floyd, T. L. (2015). Digital Fundamentals (11th ed.). Pearson Education.

[4] Roth, C. H. & Kinney, L. L. (2013). Fundamentals of Logic Design (7th ed.). Cengage
Learning.

You might also like