0% found this document useful (0 votes)
9 views31 pages

Lecture 12

The document discusses encoders and decoders, explaining their functions and differences, including various types such as 4 to 2 line encoders and 2 to 4 line decoders. It also covers propagation delay in flip-flops, race around conditions, and solutions like edge-triggered and master-slave JK flip-flops. Additionally, it highlights the applications of encoders and decoders in binary operations and networking.
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)
9 views31 pages

Lecture 12

The document discusses encoders and decoders, explaining their functions and differences, including various types such as 4 to 2 line encoders and 2 to 4 line decoders. It also covers propagation delay in flip-flops, race around conditions, and solutions like edge-triggered and master-slave JK flip-flops. Additionally, it highlights the applications of encoders and decoders in binary operations and networking.
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
You are on page 1/ 31

DLD Lecture-12

Encoders
• The combinational circuits that change the binary information into N
output lines are known as Encoders.
• The binary information is passed in the form of 2N input lines. The
output lines define the N-bit code for the binary information.
• In simple words, the Encoder performs the reverse operation of
the Decoder.
4 to 2 line Encoder
• 4 to 2 line encoder, there are total of four inputs, i.e., D0, D1, D2, and
D3, and two outputs, i.e., A and B. In 4-input lines, one input-line is set
to true at a time to get the respective binary code in the output side.
4 to 2 line Encoder
8 to 3 line Encoder:
Decimal to BCD Encoder
• The Decimal to BCD Encoder ten inputs,
i.e., D0, D1, D2, D3, D4, D5, D6, D7, D8, and
D9 and four outputs, i.e., A, B, C, and D. In
10-input lines, one input-line is set to true
at a time to get the respective BCD code in
the output side.
Applications of Encoders:
• Encoders are used to convert a decimal number into the binary
number. The objective is to perform a binary operation such as
addition, subtraction, multiplication, etc.
Decoder
• The combinational circuit that change the binary information into
2N output lines is known as Decoders.
• The output lines define the 2N-bit code for the binary information. At
a time, only one input line is activated for simplicity. The produced
2N-bit output code is equivalent to the binary information.
2 to 4 line decoder
• In the 2 to 4 line decoder, there is a total of three inputs, A0, and
A1 and E and four outputs, Y0, Y1, Y2, and Y3.
• For each combination of inputs, when the enable 'E' is set to 1, one
of these four outputs will be 1.
2 to 4 line decoder
3 to 8 line decoder:
• The 3 to 8 line decoder is also known as Binary to Octal Decoder.
• In a 3 to 8 line decoder, there is a total of eight outputs, i.e., Y0, Y1, Y2,
Y3, Y4, Y5, Y6, and Y7 and three outputs, i.e., A0, A1, and A2.
• This circuit has an enable input 'E'.
3 to 8 line decoder:
3 to 8 line decoder:
4 to 16 line Decoder
• In the 4 to 16 line decoder, there is a total of 16 outputs, i.e., Y0, Y1,
Y2,……, Y16 and four inputs, i.e., A0, A1, A2, and A3.
4 to 16 line Decoder
4 to 16 line Decoder
• The 3 to 16 line decoder can be
constructed using either 2 to 4 decoder
or 3 to 8 decoder.
• When E= 0, the bottom decoder is
enabled and top is disabled. The if A2 A1
A0 = 100, we will get output 1 in Y4.
• When E= 1, the top decoder is enabled
and bottom is disabled. The if A2 A1 A0
= 100, we will get output 1 in Y12.
Difference between a Decoder and a DEMUX
• A decoder changes the format of an encrypted input stream. In contrast, a DEMUX is
utilized to build general-purpose logic which routes the single input signal into one of the
various output signals.
• Decoders are commonly classified into three categories, 2 to 4, 3 to 8, and 4 to 16
decoders. In contrast, the DEMUX is divided into 1-4, 1-8, and 1-16 DEMUX.
• A decoder takes n input lines and generates 2n output lines, which is then inverse of what
an encoder does. In contrast, the DEMUX sends data from one line to 2 possible output
lines.
• Decoders are the inverse function of encoders. In contrast, a DEMUX does the exact
opposite of what a multiplexer.
• The decoder doesn't contain select lines. On the other hand, the DEMUX includes single
lines.
• DEMUX is widely utilized in networking applications. On the other hand, decoding is
utilized in data-intensive applications where data must be changed into another format.
Propagation Delay and Race Around Condition

Propagation Delay in Flip-Flops (FF)


• Propagation delay in a flip-flop is the time taken for a change in the input to reflect at the output
after the triggering clock edge.
• The race around condition occurs in level triggered JK FF when both inputs J = 1 and K = 1, and the
pulse duration is longer than the propagation delay of the flip-flop. This causes the output to
toggle continuously (race) during the clock pulse, leading to unpredictable or unstable output.
Solutions to Avoid Race Around Condition:
• Use Edge-Triggered JK Flip-Flop:
• Only toggles on the rising or falling edge of the clock.
• Prevents toggling during the entire clock high duration.
• Use Master-Slave JK Flip-Flop:
• Breaks the flip-flop into two stages.
• Master captures input on the rising edge.
• Slave updates output on the falling edge.
• Keep Clock Pulse Width Shorter than the propagation delay of the flip-flop.
Master-Slave JK Flip-Flop
• A Master-Slave JK Flip-Flop consists of two JK flip-flops connected in
series.
• The Master flip-flop is active when the clock is HIGH. The Slave
flip-flop is active when the clock is LOW.
• This ensures that the output (Q) changes only once per clock cycle,
solving the race around condition problem found in level-triggered JK
flip-flops.
Step-by-Step Working Principle:
• Clock = HIGH:
• The master flip-flop becomes active and responds to the J and K inputs.
• Depending on the input:
• J = 0, K = 0 → No change
• J = 1, K = 0 → Set
• J = 0, K = 1 → Reset
• J = 1, K = 1 → Toggle
• The slave flip-flop is inactive, so the output Q does not change yet.
• Clock = LOW:
• The master is now disabled (latches its state).
• The slave flip-flop becomes active and copies the state from the master.
• The final output Q is updated.
• This ensures that input changes during the clock cycle do not affect the output
immediately, avoiding the race condition.
Registers and Counters
Thank You

You might also like