Lab 04
Lab 04
EXPERIMENT # 04
Design of Encoder and Decoder
Goals: The goal of this experiment is to introduce combinational circuits i.e., decoders and encoders
and study its Verilog Programming.
Pre LAB
Discussion
ENCODER:
An encoder is a digital circuit that performs inverse operation of a decoder. An encoder has 2 n input
lines and n output lines. In encoder the output lines generate the binary code corresponding to the input
value. In octal to binary encoder, it has eight inputs, one for each octal digit and three output that
generate the corresponding binary code. In encoder it is assumed that only one input has a value of one
at any given time otherwise the circuit is meaningless.
DECODER:
A decoder is a multiple input multiple output logic circuits which converts coded input into coded output
where input and output codes are different. The input code generally has fewer bits than the output code.
Each input code word produces a different output code word i.e., there is one to one mapping can be
expressed in truth table. In the block diagram of decoder circuit, the encoded information is present as
n input producing 2n possible outputs. 2n output values are from 0 through out 2n – 1.
1|Page
Engr Muhammad Hammad
In LAB
• f(a, b, c)
= SPECIFIED BY THE LAB INSTRUCTOR
• g(w, x, y, z) = SPECIFIED BY THE LAB INSTRUCTOR
(You may have to expand the equation to obtain minterms containing all the input variables.)
5. Represent the two functions in truth table and minterms list form. For the three-input
function , obtain a schematic diagram using one 3x8 decoder while two 3x8 decoders will
be needed for the four-input function.
2|Page
Engr Muhammad Hammad
3|Page
Engr Muhammad Hammad
8. Complete the Top-level module and implement cascaded 3x8 decoder using 2 2x4 decoders as
shown in the above figure.
9. Test the behavior of the designed Verilog model.
4|Page
Engr Muhammad Hammad
5|Page