Introduction to Logic Circuit Design (University of Utah) - Counters (Lecture 18)
Overview
The lecture develops sequential logic designs from edge-triggered flip-flops to practical counters. It explains active-low asynchronous preset and clear, T and JK flip-flop behavior, serial shift registers, and the timing tradeoff between ripple counters and synchronous counters. It then derives a 3-bit synchronous up counter and shows how to adapt counter logic for D flip-flops, enable and parallel load, and a modulo-6 sequence that detects state 5 and returns to zero.
Key takeaways
- Active-low asynchronous preset_n and clear_n force Q to 1 and 0 respectively without waiting for a clock edge, while synchronous clear changes Q only at the active edge.
- A T flip-flop can be built from a D flip-flop using D = T XOR Q, making T = 0 a hold condition and T = 1 a toggle condition.
- A 3-bit asynchronous counter cascades clock signals through its stages and divides the input frequency by 2, 4, and 8 at Q0, Q1, and Q2.
- A synchronous 3-bit up counter shares one clock and uses T0 = 1, T1 = Q0, and T2 = Q1·Q0 to generate the binary count sequence.
- A modulo-6 counter needs to detect state 5, binary 101, and arrange for the next state to be zero rather than continuing through the full modulo-8 sequence.
Chapters
- The negative-edge D flip-flop uses two D latches, with the clock and its inverse controlling successive stages.
- The edge-triggered symbol marks a falling-edge response, distinguishing the flip-flop from a level-sensitive latch.
- Preset_n and clear_n are active-low controls: preset_n = 0 forces Q = 1, while clear_n = 0 forces Q = 0.
- Because asynchronous controls act independently of the clock edge, they can set or clear the stored bit immediately.
- The circuit routes preset and clear signals through additional NAND-gate logic to preserve complementary Q and Q-bar outputs during normal control conditions.
- The NAND-gate analysis tests whether Q and Q-bar could both become 1 while preset_n = 0 and clear_n = 1.
- The added preset connection constrains the circuit so the outputs do not take the same value under the analyzed preset condition.
- The corresponding positive-edge flip-flop can use a similar preset and clear arrangement.
- A synchronous clear makes the next Q value zero when clear_n is asserted, but only at the next active clock edge.
- Unlike asynchronous clear, synchronous clear does not change the stored output immediately between clock edges.
- The distinction is timing: asynchronous control is independent of the clock, while synchronous control is sampled with it.
- The T flip-flop holds its state when T = 0 and complements its state when T = 1 at the active clock edge.
- A D flip-flop can implement T behavior with D = T XOR Q, equivalently D = T·Q-bar + T-bar·Q.
- The timing example shows that changes to T affect Q at clock edges, not continuously between them.
- The JK flip-flop has two control inputs, J and K, and responds to the active clock edge.
- Its standard operation is hold for J = K = 0, reset for J = 0 and K = 1, set for J = 1 and K = 0, and toggle for J = K = 1.
- The lecture contrasts JK and T devices with the single-input D flip-flop.
- Connecting each D flip-flop output to the next stage's input creates a shift register, with each flip-flop storing one bit.
- In the four-stage example, a serial input bit advances one output stage per clock edge.
- The final output appears only after the input has shifted through the stages, creating a delay of several clock cycles.
- Tapping each flip-flop output provides parallel access to the stored bits instead of observing only the final stage.
- A multiplexer and control signal can select between serial shifting and parallel data loading.
- The selected input path determines whether the register advances a serial sequence or loads multiple bits at once.
- The 3-bit ripple counter uses T flip-flops with T held at 1 so each stage toggles on its triggering edge.
- Each flip-flop after the first is clocked by the preceding stage's output, rather than by one shared clock.
- The described down-count sequence runs from 7 to 0, using three stored bits.
- The least significant output Q0 toggles on successive clock edges, so its frequency is half the input clock frequency.
- The next stages divide further: Q1 is one-quarter of the input frequency and Q2 is one-eighth.
- The changing bit patterns across Q2, Q1, and Q0 represent the counter's binary states.
- In an asynchronous counter, a state change must propagate through successive flip-flops, accumulating propagation delay.
- The lecture notes that this accumulated delay becomes increasingly problematic in wider counters, such as 32-bit or 64-bit designs.
- A synchronous counter connects all flip-flops to the same clock, reducing the staged clock-to-clock delay while retaining gate propagation delay.
- For a 3-bit up counter, T0 = 1, T1 = Q0, and T2 = Q1·Q0; the higher bit toggles when all lower bits are 1.
- All three flip-flops share one clock, while their T inputs encode the conditions for advancing through binary states.
- To implement the same counter with D flip-flops, use D = T XOR Q, giving D0 = Q0-bar and D1 = Q1 XOR Q0.
- An enable can suppress toggling, and a multiplexer can select between counting and parallel-load data.
- A modulo-6 up counter cycles through 0, 1, 2, 3, 4, and 5, then returns to 0; a standard 3-bit counter instead has modulo 8.
- State 5 is binary 101, so the design detects the relevant high bits and uses that condition to initiate the return to zero.
- The lecture distinguishes synchronous reset, which loads the reset state on a clock edge, from asynchronous active-low reset, which acts without waiting for a clock.
Transcript excerpt
1:41 Monday Exactly so the period of time that clock is on of time. the negative edge D flip-flop
3:01 looks like. We talked about that in last session. What is positive edge flip-flop? The circuit topology of that, how it works, all of that are important. Now if you remember this was the structure, this was the structure of a negative edge D flip-flop. Okay? If you remember that's what we analyzed. So this is our D latch. This is the other D latch. And if you remember we have this clock. Okay? That can you remember that when we analyzed that the clock goes to the first latch and the negative of that goes to the second latch. Okay? So this is the general structure of a negative D flip-flop that we
3:49 analyzed yesterday. Now we want to see how can we add asynchronous clear and preset to that. Okay? So this is this part. Okay? ایز آر نرمال نگاتیو ایج دی فلیپ فلاپ اوکی؟ اگین جاست تو ریممبر دیس ایز د سیمبل آف فلیپ فلاپ دت ایز بسیکلی ایت ایز سنستیو تو ایج اند دیس سرکل هیر دت مینز دت ایت ایز نگاتیو ایج [گلویش را صاف میکند] اوکی فالینگ ایج اور نگاتیو ایج اوکی وین وی هاوینگ دیس سیمبلز اوکی هیر وی هاو پریست ان اند وی هاو دیس اگین د
4:38 نگاتیو اور اینورتد اور دت سرکل سیمبل اوکی دت مینز دت وین دیس سیگنال ایز زیرو وین پریست ان وین پریست ان ایز زیرو دن آی دت مینز دت کیو شود بی وان اوکی دیس ایز د مینینگ آف دت وین پریست ان ایز زیرو اوکی سو دیس سیمبل ایز فور شوینگ دت دیس ایز کالد اکتیو لو دیس مینز دیس پریست ان ایز اکتیو لو دت مینز دت وین ایت ایز زیرو ایت ایت میکس د کیو تو بی وان
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, MEDAL-Research.