0% found this document useful (0 votes)
5 views27 pages

Encoder & Decoder

ghohnb;kfnboiho[ibjnvvpiusdhgirnhpiuhyusgnsnb;kjnhoiho;w;hip4wgsn

Uploaded by

Ramani Mithra
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)
5 views27 pages

Encoder & Decoder

ghohnb;kfnboiho[ibjnvvpiusdhgirnhpiuhyusgnsnb;kjnhoiho;w;hip4wgsn

Uploaded by

Ramani Mithra
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

DECODER & ENCODER

Decoder:
• A decoder is a combinational circuit that converts binary information from
n input lines to a maximum of 2^n unique output lines.
• It takes an n-bit binary input and activates only one of its 2^n outputs
corresponding to that input combination, while all other outputs remain
inactive.
•A binary code of n bits is capable of representing up to 2^n distinct elements of
coded information.
• Theirpurpose is to generate the 2^n (or fewer) minterms of n input variables.
Each combination of inputs will assert a unique output.
• The name decoder is also used in conjunction with other code converters, such
as a BCD-to-seven-segment decoder.
• As an example, consider the three-to-eight-line decoder circuit. The three
inputs are decoded into eight outputs, each representing one of the minterms of
the three input variables.
• Thethree inverters provide the complement of the inputs, and each one of the
eight AND gates generates one of the minterms.
• A particular application of this decoder is binary-to-octal conversion.

• Theinput variables represent a binary number, and the outputs represent the
eight digits of a number in the octal number system.
• However, a three-to-eight-line decoder can be used for decoding any three-bit
code to provide eight outputs, one for each element of the code.
Applications:
✓Memory address decoding in computers

✓Instruction decoding in CPUs

✓Data demultiplexing

✓Seven-segment display driving


Binary to Octal Decoder Or 3 to 8 Line Decoder
• For each possible input combination, there are seven outputs that are equal to 0 and
only one that is equal to 1.
• The output whose value is equal to 1 represents the minterm equivalent of the binary
number currently available in the input lines.
Logic diagram: 3 to 8 Line Decoder
BCD to Decimal Decoder
• A BCD to Decimal Decoder is a combinational circuit that takes a Binary-
Coded Decimal (BCD) input (4 bits) and activates one of ten outputs,
each representing a decimal digit 0 to 9. Truth Table:
BCD to Decimal Decoder:
Logic Diagram
BCD to Seven Segment Decoder
•A BCD to 7-segment decoder is a combinational logic circuit that converts
a 4-bit Binary Coded Decimal (BCD) input into the signals required to
drive a 7-segment display, enabling the display of decimal digits.
• Essentially,
it translates the binary representation of a decimal number (0-
9) into the specific combination of segments that need to be illuminated
on a 7-segment display to visually represent that number.
BCD to Seven Segment Decoder
Logic Diagram:
BCD to Seven Segment Decoder
Implement a Full adder using 3 x 8 decoder
Design a 4 x 16 decoder constructed with two 3 x 8 decoders

• Decoders with enable inputs can be connected together to form a larger


decoder circuit.
• Two 3-to-8-line decoders with enable inputs connected to form a 4-to-16-
line decoder.
• When w = 0, the top decoder is enabled and the other is disabled.

• Thebottom decoder outputs are all 0’s, and the top eight outputs generate
minterms 0000 to 0111.
• When w = 1, the enable conditions are reversed: The bottom decoder
outputs generate minterms 1000 to 1111, while the outputs of the top
decoder are all 0’s.
4 x 16 decoder constructed with two 3 x 8 decoders
Encoder:
• An Encoder is a combinational circuit that performs the reverse
operation of a Decoder.
• It
has a maximum of 2^n input lines and ‘n’ output lines, hence it
encodes the information from 2^n inputs into an n-bit code.
• It
will produce a binary code equivalent to the input, which is active High.
Therefore, the encoder encodes 2^n input lines with ‘n’ bits.
• An example of an encoder is the octal-to-binary encoder.

• It
has eight inputs (one for each of the octal digits) and three outputs that
generate the corresponding binary number.
• It is assumed that only one input has a value of 1 at any given time.

• The encoder can be implemented with OR gates whose inputs are


determined directly from the truth table.
• Output z is equal to 1 when the input octal digit is 1, 3, 5, or 7.

• Output y is 1 for octal digits 2, 3, 6, or 7, and

• output x is 1 for digits 4, 5, 6, or 7.


• These conditions can be expressed by the following Boolean output
functions:
• These conditions can be expressed by the following Boolean output
functions:
Limitation of Encoder: The encoder has limitation that only one input
can be active at any given time.
❖Iftwo inputs are active simultaneously, the output produces an undefined
combination.
❖For example, if D3 and D6 are 1 simultaneously, the output of the encoder
will be 111 because all three outputs are equal to 1.
❖The output 111 does not represent either binary 3 or binary 6.

❖To resolve this ambiguity, encoder circuits must establish an input


priority to ensure that only one input is encoded.
❖Ifwe establish a higher priority for inputs with higher subscript numbers,
and if both D3 and D6 are 1 at the same time, the output will be 110
because D6 has higher priority than D3.
• Another ambiguity in the octal-to-binary encoder is that an output with all
0’s is generated when all the inputs are 0; but this output is the same as
when D0 is equal to 1.
• The
discrepancy can be resolved by providing one more output to indicate
whether at least one input is equal to 1.
Priority Encoder:
• A priority encoder is an encoder circuit that includes the priority function.

• The operation of the priority encoder is such that if two or more inputs are
equal to 1 at the same time, the input having the highest priority will take
precedence.
• Thetruth table of a four-input priority encoder. In addition to the two
outputs x and y, the circuit has a third output designated by V ;
• Thisis a valid bit indicator that is set to 1 when one or more inputs
are equal to 1.
• If
all inputs are 0, there is no valid input and V is equal to 0. The other two
outputs are not inspected when V equals 0 and are specified as don’t-care
conditions.
• Notethat whereas X ’s in output columns represent don’t-care conditions,
the X ’s in the input columns are useful for representing a truth table in
condensed form.
• Insteadof listing all 16 minterms of four variables, the truth table uses an
X to represent either 1 or 0.
• For example, X 100 represents the two minterms 0100 and 1100.
• The higher the subscript number, the higher the priority of the input.

• InputD3 has the highest priority, so, regardless of the values of the other
inputs, when this input is 1, the output for xy is 11 (binary 3).
• D2has the next priority level. The output is 10 if D2=1, provided that
D3=0, regardless of the values of the other two lower priority inputs.
• Theoutput for D1 is generated only if higher priority inputs are 0, and so
on down the priority levels.
• The minterms for the two functions are derived. Although the table has
only five rows, when each X in a row is replaced first by 0 and then by 1,
we obtain all 16 possible input combinations.
• Forexample, the fourth row in the table, with inputs XX10, represents the
four minterms 0010, 0110, 1010, and 1110.
• Thesimplified Boolean expressions for the priority encoder are obtained
from the maps.
Maps for a Priority Encoder:
• Thecondition for output V is an OR function of all the input variables. The
priority encoder is implemented in the following Boolean functions:

You might also like