ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Digital Logic and Design
    PHYS4129
    Progress0 / 20 topics
    Topics
    1. Review of Number Systems: Binary, octal and hexadecimal number system their inter conversion2. Basic logic gates3. Different codes: BCD, ASCII, Gray etc.4. Parity in codes5. Boolean Algebra: Demorgan theorems6. Simplification of Boolean expression by Boolean postulates and theorem7. SOP and POS conversions8. K maps and their uses9. Don't care condition10. Combinational Logic Circuit: Logic circuits based on AND-OR, OR-AND, NAND, NOR Logic gates design11. Addition, subtraction, 2's compliments12. Half adder, full adder13. Half subtractor, full subtractor14. Encoder, decoder15. Multiplexer and demultiplexer16. Sequential Logic Circuit: Latches17. Flip-flops: S-R, J-K, T and D flip flops18. Master-slave flip-flops19. IC Logic Families: Basic characteristics (Propagation delay time, dissipation, noise margins etc.)20. Different logic based IC families: DTL, RTL, TTL, CMOS
    PHYS4129›Encoder, decoder
    Digital Logic and DesignTopic 14 of 20

    Encoder, decoder

    5 minread
    914words
    Intermediatelevel

    Encoder and Decoder

    In digital systems, encoders and decoders are essential components used for converting data between different formats, particularly in communication systems, data processing, and memory addressing. These components are primarily used to convert information from one format to another in a way that reduces redundancy and increases efficiency. Let’s explore encoders and decoders in detail.


    1. Encoder

    An encoder is a combinational circuit that converts n input lines into a smaller number of output lines, effectively reducing the number of bits required to represent the information. Encoders are used to encode data into a more compact form.

    Types of Encoders:

    • Binary Encoder
    • Priority Encoder

    Binary Encoder:

    A binary encoder converts n input lines into log2(n) output lines. For example, an 8-input encoder will produce a 3-bit output, as 3 bits are required to represent 8 possible states (2³ = 8).

    Truth Table for 4-to-2 Binary Encoder:

    Input A3 Input A2 Input A1 Input A0 Output Y1 Output Y0
    0 0 0 0 0 0
    0 0 0 1 0 1
    0 0 1 0 1 0
    0 0 1 1 1 1
    0 1 0 0 1 0
    0 1 0 1 1 1
    1 0 0 0 1 0
    1 0 0 1 1 1
    • Inputs A3, A2, A1, A0: Four input lines.
    • Outputs Y1, Y0: Two output lines representing the binary equivalent of the active input.

    The output produces a binary number corresponding to the active input, where only one input is active at a time. This simplifies multiple input values into fewer output bits.

    Priority Encoder:

    A priority encoder is similar to a binary encoder but with an important difference: it has a priority rule, where if multiple inputs are active at the same time, the highest-priority input is considered. It also typically generates an output for validity (often referred to as "V").

    Truth Table for 4-to-2 Priority Encoder:

    Input I3 Input I2 Input I1 Input I0 Output Y1 Output Y0 Valid (V)
    0 0 0 0 0 0 0
    0 0 0 1 0 1 1
    0 0 1 0 1 0 1
    0 0 1 1 1 1 1
    0 1 0 0 1 0 1
    0 1 0 1 1 1 1
    1 0 0 0 1 0 1
    1 0 0 1 1 1 1
    • Inputs I3, I2, I1, I0: Four input lines.
    • Outputs Y1, Y0: Two output lines representing the binary number corresponding to the highest active input.
    • Valid (V): This output indicates whether any input is active.

    The priority encoder always considers the highest active input, providing the binary code for that input and a valid output indicating that an active input is present.


    2. Decoder

    A decoder is a combinational circuit that takes an n-bit binary input and converts it into one of 2ⁿ possible output lines. In essence, decoders are used to select a particular output line based on a binary input.

    Types of Decoders:

    • Binary Decoder
    • Priority Decoder

    Binary Decoder:

    A binary decoder converts n input bits into 2ⁿ output lines. For example, a 3-to-8 decoder has 3 inputs and 8 outputs, and only one output is active at a time based on the binary value of the inputs.

    Truth Table for 3-to-8 Binary Decoder:

    Input A2 Input A1 Input A0 Output Y7 Output Y6 Output Y5 Output Y4 Output Y3 Output Y2 Output Y1 Output Y0
    0 0 0 1 0 0 0 0 0 0 0
    0 0 1 0 1 0 0 0 0 0 0
    0 1 0 0 0 1 0 0 0 0 0
    0 1 1 0 0 0 1 0 0 0 0
    1 0 0 0 0 0 0 1 0 0 0
    1 0 1 0 0 0 0 0 1 0 0
    1 1 0 0 0 0 0 0 0 1 0
    1 1 1 0 0 0 0 0 0 0 1
    • Inputs A2, A1, A0: Three input lines.
    • Outputs Y7, Y6, ..., Y0: Eight output lines corresponding to the 8 possible combinations of the input bits.

    The output that is active (1) depends on the value of the input binary number. Only one output line is active at a time.

    Priority Decoder:

    A priority decoder is similar to a binary decoder, but it has a priority rule for handling multiple active inputs. The highest-priority input is decoded first, and it generates an output corresponding to the highest active input.


    3. Applications of Encoders and Decoders

    • Encoders:

      • Data compression: Reducing the number of bits used to represent data.
      • Keypad encoding: In a keypad, pressing a key generates a binary code which is then encoded by the encoder circuit.
      • Multiplexing: Selects one of several inputs to send to an output based on encoded control signals.
    • Decoders:

      • Memory addressing: Decoding the memory address from the CPU to access specific locations in memory.
      • 7-segment displays: Decoding binary input to control the segments of a display.
      • Instruction decoding: In CPUs, decoding the operation code (opcode) to execute specific instructions.

    Conclusion

    • Encoder: Converts multiple input lines into fewer output lines. It's used for compactly representing multiple data states in a smaller bit-width.
    • Decoder: Converts binary input into a large number of output lines. It's used to activate specific lines based on the binary input.

    Both encoders and decoders are fundamental in digital systems, data communication, and logic design for performing efficient data representation and processing.

    Previous topic 13
    Half subtractor, full subtractor
    Next topic 15
    Multiplexer and demultiplexer

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time5 min
      Word count914
      Code examples0
      DifficultyIntermediate