- Learn
- Engineering
- Electrical Engineering
- Digital Logic Design
- Registers and Counters
Registers and Counters
IntermediateLesson 5 of 7 in Digital Logic Design Course
What you will learn
- Explain what a register is and build registers that hold, load and clear an n-bit word on a shared clock.
- Store a word in a register of flip-flopsDescribe how a row of D flip-flops on one clock stores an n-bit word, how clock timing decides which value is stored, and how clear inputs set a known starting value.
- Control when a register loads new dataAdd a load control so a register keeps its word until it is told to take a new one, using a multiplexer at each flip-flop input instead of gating the clock, and combine load with clear.
- Store a word in a register of flip-flops
- Shift bits through a chain of flip-flops, combine shifting with loading in a universal shift register, and use shift registers for serial transfer, serial-parallel conversion and serial addition.
- Shift bits in and out of a shift registerTrace how a shift register moves its bits one place per clock, name its serial and parallel configurations, and use shifting to transfer words, delay signals and multiply or divide by 2.
- Build a universal shift registerCombine hold, shift right, shift left and parallel load in one register with mode inputs, using a multiplexer at each stage, and use it to rotate, convert and scale words.
- Use shift registers for serial data and serial additionConvert between serial and parallel data, drive many outputs from a few wires with a shift register that has an output register, and add two numbers one bit per clock with a serial adder.
- Shift bits in and out of a shift register
- Trace how a ripple counter counts, explain the delays and false states its rippling causes, and build BCD and other mod-N ripple counters.
- Trace a binary ripple counterExplain how toggling flip-flops clocked by each other count up or down, use ripple counters as frequency dividers, and work out the delays and false states that the ripple causes.
- Build BCD and other mod-N ripple countersShorten a ripple counter to any modulus by clearing it at a detected count or by changing its connections, build a decade ripple counter, and cascade decades into a multi-digit counter.
- Trace a binary ripple counter
- Build counters whose flip-flops all change on the same clock edge: binary up, down and up/down counters, counters with load, clear and enable, and BCD counters that cascade into multi-digit counters.
- Design synchronous binary up, down and up/down countersDerive the toggle conditions of a binary counter, add a count enable and carry output, build down and up/down versions, and compare their speed with ripple counters.
- Use counters with parallel load, clear and enableUse the clear, load, enable and carry functions of a synchronous counter to count to any modulus, start from any value and cascade counters into wider counters and frequency dividers.
- Design synchronous BCD counters and multi-digit countersDerive the equations of a synchronous decade counter, check its unused states, and cascade decades into multi-digit decimal and clock counters that drive displays.
- Design synchronous binary up, down and up/down counters
- Apply the design method for clocked sequential circuits to build a counter for any repeating sequence with D, T or JK flip-flops, and make sure it recovers from unused states.
- Derive flip-flop input equations for a count sequenceTurn a required count sequence into a state table, use excitation tables to find the flip-flop inputs, simplify them with Karnaugh maps and check the result.
- Make counters self-startingFind where a counter goes from each unused state, recognize lockout, and fix it by redesigning the next states or by initializing the counter.
- Derive flip-flop input equations for a count sequence
- Build shift-register counters that produce timing signals with little or no decoding, keep them out of unused states, and choose the most suitable counter for a sequencing task.
- Generate timing signals with a ring counterBuild a ring counter that passes a single 1 around a shift register, start it correctly, make it self-correcting and compare it with a binary counter and decoder.
- Build and decode a Johnson counterBuild a Johnson counter that doubles the states of a ring counter, decode each state with a two-input gate, and stop it from locking into its unused cycle.
- Choose a counter for a sequencing taskCompare ripple, synchronous binary, BCD, ring and Johnson counters on flip-flops, gates, speed, glitches and output waveforms, and pick and time the right one for a task.
- Generate timing signals with a ring counter
Registers and Counters study guide
1Store and load binary words in registers
Binary data often needs to stay available while its input lines change. A bank of flip-flops provides that storage, and a shared clock defines when a new word is captured. The useful design decisions are when to load, when to hold and how to establish a known start. Connecting those controls through the data inputs also keeps the clock consistent across the circuit, so words can pass between registers on predictable edges.
1.1 A word stored on one clock
A register stores a binary word in a group of flip-flops. Each flip-flop holds one bit, so an 8-bit register has eight flip-flops and can hold one of 256 patterns. Its outputs make every stored bit available at the same time. Input logic can add loading, clearing or shifting without changing this basic storage role.
Sampling a word
Write a four-bit word as , with the least significant bit. Four D flip-flops share one clock. At its active edge, each samples its own input:
The superscript + means the state after the edge. Rising edges are active unless a circuit says otherwise. A word does not flow through the register while the clock stays high. That would describe level-sensitive latches, whose outputs follow inputs during their enabled level.
Suppose the register holds 0101. Its inputs change to 1100 and then 1110 between rising edges. If 1110 is stable at the next edge, the outputs become 1110 after their clock-to-output delay. The intermediate input 1100 was never stored. When you trace a register, record inputs at the sampling edges, then update the whole word.
The timing window
Setup time is the interval for which data must be stable before the active edge. Hold time is the interval for which it must remain stable afterward. Clock-to-output delay is the time from the edge until the new output is valid. These describe three different parts of the transfer.
For an edge at 20 ns, a 3 ns setup requirement means data must already be stable by 17 ns. If hold time is 2 ns, it must stay stable through 22 ns. With a 5 ns clock-to-output delay, the new output is valid by 25 ns. Meeting setup alone is insufficient: a very fast change just after the edge can violate hold.
Two registers on one clock can transfer a word in parallel. Connect A's outputs to B's data inputs. At the shared edge, B takes A's old word; A's newly sampled word appears only afterward. This also allows feedback into a register's own input logic when the paths meet setup and hold timing.
Start from a known state
A clear input forces the bits to 0. An asynchronous clear acts without waiting for the clock; a synchronous clear takes effect at the next active edge. An active-low clear, written , is asserted by driving it to 0.
If a register holds 1011 and its asynchronous clear is asserted halfway through a cycle, it clears after the reset propagation delay. A synchronous clear asserted at the same instant waits for the edge. Normal data sampling still uses the clock in both cases. At power-up, the stored word is unpredictable, so a design that needs a defined starting word provides reset or preset.
A register holds one word in its flip-flops. An addressed memory array stores many words and selects among them with an address.
Key Takeaways
- One flip-flop stores one bit; an n-bit register has possible words.
- At a common active edge, each D flip-flop samples its own input.
- Meet setup before the edge and hold after it; allow clock-to-output delay.
- An asynchronous clear acts without an edge; a synchronous clear waits for one.
1.2 Load a word and keep it
A plain D register samples new data at every active edge. A parallel-load register adds a choice: take the input word or keep the stored word. One load signal controls the choice for every bit, so a complete word is loaded on one edge.
Select the data input
Place a 2-to-1 multiplexer before each D input. One path carries new input ; the other feeds back the present output . With load control :
Here + means Boolean OR and joined terms mean AND. When load is 1, the multiplexer selects the new data. When load is 0, it selects feedback. The next edge then stores the same value again, making the output hold steady even though the clock continues.
Consider a register holding 0110 with input 1011. At edge 1, load is 0, so the word stays 0110. At edge 2, load is 1, so it becomes 1011. Before edge 3, the input changes to 0001 but load returns to 0. The stored word remains 1011. Holding does not clear the word or disconnect its outputs.
Load is sampled with the data. A load pulse that rises and falls entirely between two active edges captures nothing. To load once, make data and load meet the timing requirements around one edge, then remove load before the next sampling edge.
Give clear priority
With an active-high synchronous clear , clear can override load:
| Clear | Load | Action at the edge |
|---|---|---|
| 1 | Either | Clear all bits |
| 0 | 1 | Load input word |
| 0 | 0 | Hold stored word |
For example, if clear and load are both 1 with data 1111, the next word is 0000. The priority is part of the circuit's function. An asynchronous clear instead connects to the flip-flops' clear pins and can override storage between clock edges.
Keep ordinary gates out of the clock path
ANDing load with the clock looks like a way to skip unwanted edges. It also delays that clock relative to other registers and can create an extra rising edge if load changes while the clock is high. That delay difference is clock skew. The input-multiplexer design leaves a shared clock intact and makes the choice in the data path. Purpose-built clock-gating circuits handle clock switching in chips that need it.
JK flip-flops can implement the same load behavior with:
Load 0 gives 00, the JK hold input. Load 1 gives 10 for a data 1 and 01 for a data 0. These are set and reset, respectively.
An output register can keep eight indicator states while shared data lines carry other words. Each destination register has its own load signal. On an edge, only the selected destination captures the bus, so the processor can reuse the lines without changing earlier outputs.
Key Takeaways
- Load selects new data or feedback at each D input.
- A synchronous load happens at the clock edge while load is active.
- With clear priority, clear overrides both load and hold.
- Ordinary logic in a clock path can introduce skew and extra edges.
- JK load inputs are and .
2Move data through shift registers
A shift register moves a word through a small number of data connections over several clock cycles. Tracing each edge reveals both the bit order and the time needed to complete a transfer. Selecting among shift, hold and load paths turns the same storage into a flexible converter. With a full adder and a stored carry, the moving operands can also take part in arithmetic, processing one bit pair at a time.
2.1 Move each bit one position
A shift register links the output of each flip-flop to the next stage's input. All stages share the clock. Each edge moves the stored bits one position, admits a serial input bit, and removes the bit at the far end.
Trace old values across an edge
With the word written , shifting right means moving toward the least significant bit:
The old is the outgoing bit. Every right-hand value is from before the edge. Do not update a stage and then use its new value to update the next stage: that would move a bit through several positions on one clock.
Starting at 0000 with serial inputs 1, 1, 0, 1 gives 1000, 1100, 0110, 1011. The first input bit has reached the last stage after four edges. A shift left reverses the internal connections and inserts the new bit at . A real chip's function table defines its direction labels.
The common-edge operation depends on timing. A receiving stage must keep seeing the old data throughout its hold interval. The earliest possible new data arrival is the sending flip-flop's minimum clock-to-output delay plus minimum path delay. This total must cover hold time plus positive clock skew, where positive skew means the receiving clock arrives later.
Choose the input and output form
| Configuration | Data enters | Data leaves | Main job |
|---|---|---|---|
| SISO | Serially | Serially | Delay a bit stream |
| SIPO | Serially | In parallel | Assemble a word |
| PISO | In parallel | Serially | Send a word |
| PIPO | In parallel | In parallel | Store or transfer a word |
An n-stage SISO register delays a bit stream by n clock cycles, measured between corresponding input and output positions. At 1 MHz, an eight-stage delay line gives an 8 µs delay.
Use shifting for arithmetic
A zero-filled left shift multiplies an unsigned word by 2 if no significant 1 is lost. For example, 0011 becomes 0110. A zero-filled right shift divides by 2 and discards the remainder: 1011 becomes 0101, so 11 becomes 5. The discarded bit carries the remainder.
A fixed-width register can lose information. Shifting 1011 left gives 0110 because the leading 1 falls out; 22 cannot fit in four unsigned bits. An arithmetic right shift of a two's-complement word copies the sign bit into the left end. Thus 1100, representing −4, becomes 1110, representing −2.
Transfer a complete word serially
Feed A's right-end output into B's left-end serial input. Recirculate A's outgoing bit into its own left end to preserve A over a full word transfer. With A = 1011 and B = 0010, successive pairs are:
- A = 1101, B = 1001.
- A = 1110, B = 1100.
- A = 0111, B = 0110.
- A = 1011, B = 1011.
Exactly four enabled shifts copy the word. Three leave mixed data in B; a fifth starts moving the completed word again.
Key Takeaways
- Each stage samples its neighbor’s old bit on the same edge.
- Right shifts insert at the most significant end and remove the old least significant bit.
- Serial and parallel input/output choices give SISO, SIPO, PISO and PIPO.
- Zero-filled shifts scale unsigned numbers only within the register’s width.
- An n-bit serial transfer needs exactly n enabled shifts.
- Use minimum delays when checking hold timing.
2.2 Select hold, shift or load
A universal shift register combines hold, right shift, left shift and parallel load. Two mode inputs choose the operation for the whole word at each clock edge. Parallel outputs remain available in every mode, and clear provides a known start.
Route four possible inputs
Use this mode table:
| Mode | Operation | Input selected at stage i |
|---|---|---|
| 00 | Hold | Own output |
| 01 | Shift right | More significant neighbor |
| 10 | Shift left | Less significant neighbor |
| 11 | Parallel load | External data bit |
A 4-to-1 multiplexer before each D input selects the appropriate source. At an interior stage, right shift selects and left shift selects . At the ends there is no neighbor, so right shift takes its serial input at and left shift takes its separate serial input at .
All multiplexers use the same mode controls. A mode change selects a new data route, but the stored word changes only at the next active edge. Hold mode keeps the clock running and selects each stage's feedback path. Universal registers on sale can use different mode assignments, so read their function tables before wiring controls.
Work through several modes
Start with 1011. First select 01 and put 0 on the right-shift serial input. The next word is 0101: a 0 enters at the left and the old rightmost 1 leaves. Next select 10 with left-shift serial input 1. The next word is 1011. Mode 00 then holds 1011. Finally mode 11 with parallel inputs 0110 stores 0110 in one edge.
Only the serial input selected by the current direction matters. Putting 1 on the left-shift serial input does not insert a 1 during a right shift. Drawing one arrow into the receiving end before tracing a word helps fix which input is in use.
Rotate instead of discarding
A rotation returns the outgoing bit to the entering end. For a right rotation, connect back to the input feeding . For a left rotation, connect to the input feeding . The number of 1s stays the same because no bit is discarded or newly introduced.
Right-rotating 1011 once gives 1101. Further right rotations give 1110, 0111 and then 1011. Four rotations of any four-bit word restore it, although a pattern with repeated bits can repeat sooner. A zero-filled shift and a rotation therefore need different feedback connections.
The same hardware can load a word and serialize it, collect a serial word and hold it for parallel reading, or perform left and right arithmetic shifts. For unsigned scaling, choose a zero serial input; for an arithmetic right shift, feed the sign bit into the entering end. The mode controls specify movement, while the serial-input wiring specifies which bit fills the gap.
Key Takeaways
- Four input paths per stage provide hold, right shift, left shift and load.
- The mode is sampled through the selected data path at the edge.
- The selected direction determines which end accepts serial data.
- Rotation feeds the outgoing bit back into the entering end.
2.3 Send words and add one pair of bits at a time
Serial circuits reuse a small data path over several clocks. A parallel transfer moves a whole word at once; a serial transfer sends one bit each cycle. The choice trades wires and arithmetic hardware against transfer time.
Convert between serial and parallel
An eight-bit parallel link uses eight data lines and can transfer a word in one cycle. A serial link uses one data line plus clocking and takes eight shift cycles. At 1 MHz these times are 1 µs and 8 µs. A transmitter can parallel-load a PISO register while a SIPO receiver collects the outgoing bits. Both ends must use the same bit order and sampling timing.
A plain SIPO register exposes its changing intermediate words at the outputs. To update a bank of outputs only after the word is complete, place a separate storage register after it. The 74HC595 is an example: its shift clock moves serial data, while a separate storage-clock edge copies the completed word to the outputs. While new bits shift in, the old output word stays steady.
Chain one chip's serial output into the next to expand the word. Two eight-bit chips need 16 shift clocks and then one storage-clock edge to update 16 outputs using the same serial data, shift clock and storage clock signals. Clearing the shift stages alone does not load their cleared word into the output storage register.
Reuse one full adder
A serial adder uses two shift registers, one full adder, and one carry flip-flop. Register A holds one operand and receives the sum; B holds the other operand. At each edge, the adder processes the old least significant bits and the old carry. Its sum enters A at the most significant end as A shifts right. The carry-out is stored for the next pair.
Addition begins at the least significant pair because a carry affects the next higher position. Clear the carry flip-flop before a new addition. For 0101 + 0111:
| Pair processed | A bit | B bit | Carry in | Sum | Carry out |
|---|---|---|---|---|---|
| Bit 0 | 1 | 1 | 0 | 0 | 1 |
| Bit 1 | 0 | 1 | 1 | 0 | 1 |
| Bit 2 | 1 | 1 | 1 | 1 | 1 |
| Bit 3 | 0 | 0 | 1 | 1 | 0 |
The sum bits are produced in the order 0, 0, 1, 1. Right shifting places them into their final positions, leaving A = 1100 after four edges. The final carry is 0, so the unsigned sum 12 fits in four bits. A stale initial carry of 1 would add an unwanted extra 1 and produce 1101.
Choose the arithmetic hardware
For an n-bit word, serial addition uses one full adder repeatedly over n cycles, together with operand storage and a carry flip-flop. A parallel adder uses n full adders and can produce the sum within one cycle, whose duration must allow its carry logic to settle. Serial addition suits hardware-limited designs when several cycles are available; parallel addition suits a datapath that needs a result each cycle.
Key Takeaways
- Serial conversion saves data lines and takes one shift per bit.
- A separate storage register hides intermediate shifting patterns from outputs.
- Serial addition processes least significant bits first.
- Clear carry before each independent addition.
- The sum bit and carry-out are stored at each edge.
- A serial adder reuses one full adder over n cycles.
3Analyze and build ripple counters
A chain of toggling flip-flops can count without a separate next-state logic network. The clock transition passes from one stage to the next, giving simple frequency division but also a delay before the full count is ready. Shortening the binary cycle adds reset logic and changes the output waveforms. Reading the clock edges, transient words and reset boundary together makes these counters much easier to analyze.
3.1 Follow a count as it ripples
A counter stores a state and steps through a repeating sequence when clock pulses arrive. Its modulus is the number of states in that cycle. An n-bit binary up counter visits 0 through , then returns to 0; four stages give 16 states.
Let each stage clock the next
In a ripple counter, only the first flip-flop receives the external clock. Each later stage receives a clock from the preceding stage's output. Every stage toggles at its own active edge. T flip-flops use T = 1, JK flip-flops use J = K = 1, and D flip-flops use complemented feedback.
To count up, a higher bit must toggle when the lower bit falls from 1 to 0. The wiring therefore depends on the active edge:
| Flip-flop edge | Clock next stage from | Direction |
|---|---|---|
| Rising | Complemented output | Up |
| Rising | Uncomplemented output | Down |
| Falling | Uncomplemented output | Up |
| Falling | Complemented output | Down |
For example, rising-edge flip-flops clocked from uncomplemented outputs count down. From 0000, the first pulse makes the settled word 1111. Always check both the edge symbol and the chosen output before tracing a ripple counter.
Divide frequency
The least significant stage toggles on every input pulse, so one full output cycle takes two input pulses. Each later stage divides the previous frequency by 2:
With a 1 MHz input, the four outputs run at 500, 250, 125 and 62.5 kHz. Each binary-divider output has a 50% duty cycle. A 15-stage divider turns 32,768 Hz into 1 Hz because .
Allow the count to settle
Clock events reach successive stages only after earlier outputs change. In a four-bit up counter with a 10 ns delay per stage, the transition from 0111 to 1000 passes through:
- At 10 ns: 0110, after the first stage falls.
- At 20 ns: 0100, after the second stage falls.
- At 30 ns: 0000, after the third stage falls.
- At 40 ns: 1000, after the last stage rises.
The intermediate words are transient states, not extra stable counts. A decoder for 0000 can still produce a short pulse during this transition. A control input that reacts to such a pulse can be triggered even though the intended settled count was never 0000.
If a decoder needs another 5 ns, allow 45 ns from the input pulse for its result. Requiring a valid decoded result before the next pulse gives a maximum input frequency of about 22.2 MHz. This is a settled-reading limit; the individual toggle stages have their own timing limits.
Ripple counters need little interstage logic and later stages switch less often. They are useful frequency dividers and event counters when readings are taken after settling. They are a poor choice for directly generating decoded control pulses during count transitions.
Key Takeaways
- Ripple stages are clocked by preceding outputs.
- The active edge and choice of Q or its complement determine direction.
- Binary stage i divides the input frequency by .
- Worst-case ripple settling grows with the number of stages.
- A transient word can produce an unwanted decoder pulse.
3.2 Stop a ripple count at the chosen modulus
A full binary counter uses all its bit patterns. To build a mod-N counter, shorten the sequence to N states. First choose the smallest width whose pattern count is at least N. A mod-6 counter needs three bits; a mod-10 or mod-12 counter needs four.
Clear at the first unwanted count
The reset method connects a count-detection gate to every flip-flop's asynchronous clear. Detect N, the first value outside the desired sequence, and let clear return the word to 0 immediately.
For a decade counter, the stable sequence is 0000 through 1001. The next pulse briefly creates 1010, decimal 10. Both and are then 1, so a NAND gate on those bits asserts an active-low clear. The other bits need no tests: no earlier value from 0 through 9 has both selected bits high.
The same reasoning gives detectors for mod-6 and for mod-12. These partial detectors work along the intended count sequence. They can also respond to some unused states, so they do not replace a full recovery check.
Detecting 9 instead of 10 in an asynchronously cleared decade removes 9 almost as soon as it appears. The stable cycle becomes 0 through 8, which is mod-9. A synchronous clear uses a different boundary because its action waits for the next edge.
Account for the reset pulse
The unwanted count N exists briefly before reset propagates. A decoder can see it. Also, the reset pulse ends when enough outputs clear to release the detector. If one flip-flop clears slowly, that short pulse may fail to clear every stage. A synchronous clear can make the wrap a normal clocked transition and avoid this self-ending asynchronous pulse.
A decade ripple counter can also be built by changing JK connections. With falling-edge flip-flops named by weights 8, 4, 2 and 1, the weight-1 stage toggles from the input clock. The weight-2 stage is clocked by weight 1 and uses J equal to the complement of weight 8, K = 1. Weight 4 toggles from weight 2. Weight 8 is clocked by weight 1 with J equal to the AND of weights 2 and 4, K = 1. At 9, the high weight-8 bit prevents weight 2 from setting while weight 8 resets, giving the return to 0 without a decoded reset.
Read frequency and duty cycle separately
A reset-method decade's top output repeats every ten pulses, but it is high only at counts 8 and 9. Its duty cycle is 20%, not 50%. A mod-6 top bit is high for counts 4 and 5, or one third of its cycle. A mod-5 stage followed by a toggle flip-flop can give a 50% waveform at one tenth of the original frequency.
Cascade reset-method decades by using the units top bit's falling edge at 9-to-0 to clock a falling-edge tens decade. Two digits count 00 through 99; three count 000 through 999. Each four-bit BCD digit can feed its own seven-segment decoder. This cascade still ripples, so allow the full display value to settle.
Key Takeaways
- Choose enough bits for N states.
- For reset-method ripple counting, detect N and clear asynchronously.
- The first unwanted count appears briefly before clear takes effect.
- A decade top bit repeats at one tenth of the clock with 20% duty cycle.
- Decade ripple stages can clock later decades on the 9-to-0 transition.
- Changing JK connections can implement a decade without decoded reset.
4Design synchronous counters
Sharing one clock among every counter stage moves the counting decision into the data path. Toggle conditions explain binary up and down counting, while load, clear and enable make the sequence useful in a larger circuit. The same approach handles decimal digits and wider counters. A correct design must prepare every control before the edge and give carry the right role when several blocks advance together.
4.1 Toggle the bits that need to change
A synchronous counter sends one clock to every flip-flop. Logic computes the required bit changes before the active edge. The outputs respond to that common edge, removing the stage-by-stage ripple through clock inputs.
Find the toggle condition
In binary up counting, a bit changes when all lower bits are 1. With T flip-flops:
At 0111, all four inputs are 1, so all bits toggle to give 1000. At 0101, only the two lowest bits toggle, producing 0110. Calculate every toggle input from the old word before changing any output.
A count enable multiplies every toggle condition, including the least significant one. For example, . Enable 0 makes every T input 0, so the counter holds. For JK storage, use . For D storage, use:
XOR leaves the bit unchanged when T is 0 and complements it when T is 1. Thus the same toggle reasoning supports all three flip-flop types.
Count down or select a direction
A bit in a down counter toggles when all lower bits are 0. Its four T inputs are 1, the complement of , the AND of the two lowest complements, and the AND of the three lowest complements. From 0000, all bits toggle to 1111; the next edge produces 1110.
For an up/down control , with 1 meaning up and 0 meaning down, select between these conditions. The third bit uses:
The least significant bit always toggles when counting is enabled. Changing direction before an edge changes which condition that edge uses; it does not alter the stored count between edges.
Prepare a carry for another stage
A four-bit up counter's enabled terminal-count output is:
It is high while the enabled low block holds 1111, preparing the next block to advance on the same edge that wraps the low block. Including enable prevents a disabled low counter parked at 1111 from repeatedly advancing a higher block.
Budget the data-path delay
The clock period must cover clock-to-output delay, combinational input-logic delay and setup time. With 10 ns, 5 ns and 5 ns, the minimum is 20 ns, corresponding to 50 MHz. A chain of two-input AND gates can build toggle conditions cheaply, but its total gate delay increases with width. Wider parallel gates can reduce that depth.
Synchronous describes the clocking, not the absence of all carry logic. It also does not guarantee perfectly simultaneous pin transitions. A binary-output decoder can glitch when several outputs change with slightly different delays. Register decoded control signals when an unwanted pulse could cause an action.
Key Takeaways
- Up-counting bits toggle when every lower bit is 1; down-counting bits use lower zeros.
- Enable must gate every toggle condition.
- Use for JK storage or for D storage.
- Enabled terminal count drives a higher block’s count enable.
- The period must cover clock-to-output, input logic and setup time.
- Common clocking removes accumulated ripple delay; binary decoding can still glitch.
4.2 Load, clear and cascade a counter
A practical synchronous counter needs more than a next-count function. Load chooses a starting word, clear establishes zero, and enable controls when counting runs. Input multiplexers select among these actions while the flip-flops keep one shared clock.
Read the control priority
A common priority is clear, load, count, hold. For a synchronous clear:
- If clear is active, the next word is zero.
- Otherwise, if load is active, the next word is the parallel input.
- Otherwise, if enable is active, the word increments.
- Otherwise, the word holds.
Clear and load can therefore act even when count enable is 0. At each D input, the selected source is 0, the external data bit, the count next-state bit, or feedback. A specific chip's function table determines its control polarities and priority. The 74HC161 clears asynchronously, while the 74HC163 clears synchronously; both count and parallel-load on rising edges and provide two count enables and terminal count.
Wrap after the last wanted state
To count 0 through 5 synchronously, detect 5 and use that result as clear at the next edge. Among these six states, detects 0101. The word remains 5 for a full period, then becomes 0. For a mod-N count starting at 0, the synchronous detector is N − 1.
If synchronous clear instead detects 6, the word remains 6 for a full period before clearing. That produces seven stable states, 0 through 6. With an asynchronous clear, detecting 6 produces the six-state cycle because clear acts as soon as 6 appears.
Load can wrap to a nonzero start. To count 3 through 9, detect 9 and load 3 at the next edge. Count the states inclusively: 3, 4, 5, 6, 7, 8, 9 is mod-7. Another method for a four-bit counter loads whenever terminal count is reached. Loading 10 at 15 produces 10 through 15, six states.
Expand the width without a ripple clock
For an eight-bit counter made of two four-bit blocks, connect both clocks to the system clock. Enable the low block from the system control and the high block from the low block's enabled carry. At 0000 1111, that carry is high before the edge; both blocks then change to give 0001 0000.
Carry is a data-path control signal. Using it as the high block's clock creates another clock path and brings back ripple behavior. Cascaded carry logic must still settle soon enough to meet the higher block's enable timing.
Generate a periodic tick
A 50 MHz clock needs 50,000,000 periods per second. A counter from 0 through 49,999,999 therefore produces a 1 Hz tick. Twenty-five bits provide only 33,554,432 patterns; twenty-six provide 67,108,864, so 26 flip-flops are needed. Decode the final count and synchronously clear on the following edge. The final-count signal lasts one input period, or 20 ns. It is a one-second repeating tick, not a 50% duty-cycle 1 Hz square wave.
Key Takeaways
- Control priority determines the result when several inputs are active.
- A synchronous mod-N wrap detects N − 1.
- A loaded range includes both its starting and final counts.
- Synchronous blocks cascade through enables while sharing the clock.
- A periodic terminal-count tick can be much narrower than half its repetition period.
4.3 Count decimal digits on a common clock
A BCD counter stores one decimal digit in four bits, using 8421 weights. Its valid states are 0000 through 1001. The next edge after 9 returns the digit to 0, so the six patterns for decimal values 10 through 15 are unused.
Change the binary toggle rules at 9
A four-bit T implementation can use:
The least significant bit toggles each count. The complement of the top bit in the second equation prevents bit 1 from setting during 1001-to-0000. The extra term toggles the top bit off at 9.
Check two important transitions. At 0111, every T input is 1, producing 1000. At 1001, the toggle word is 1001: only the top and bottom bits toggle, giving 0000. A binary counter would toggle the bottom two bits at 9 and produce 1010, which is not a BCD digit.
For a disabled digit, gate every T input with its digit enable. Its carry is:
Within valid BCD states, the two selected bits identify 9. Enable belongs in carry as well as in the toggle logic. A disabled digit sitting at 9 must not keep advancing the next digit.
Cascade decimal digits
Connect all digits to one clock. The units digit counts on the system enable; its carry enables the tens digit, and the tens carry enables the hundreds. At 39, the units digit is 9, so its carry is high. At the next edge, units wraps to 0 while tens advances from 3 to 4, giving 40. At 99, both digits wrap to 0 together and the tens carry can advance a hundreds digit.
A mod-60 seconds counter combines units 0 through 9 with tens 0 through 5. Tens advances only when units is enabled at 9. When the displayed count is 59, the next edge wraps units and clears tens, yielding 00. Clearing tens merely because it is 5 would lose the counts 50 through 59; the clear condition must include the units carry.
Each digit can feed a BCD-to-seven-segment decoder directly. Three BCD digits need 12 flip-flops, while an eight-bit binary counter needs eight and represents 0 through 255. The binary form saves storage, but decimal display then needs binary-to-decimal conversion.
Check the unused codes
The simplified equations also specify behavior outside 0 through 9. They send 1010 to 1011 to 0110, 1100 to 1101 to 0100, and 1110 to 1111 to 0010. Every unused state reaches a valid digit within two enabled clocks, making this design self-starting.
The short carry detector also responds to unused codes 1011, 1101 and 1111. During recovery it can enable a higher digit unexpectedly. Reset the full counter to a valid start, and assess recovery outputs as well as recovery of the stored digit when the count controls other circuitry.
Key Takeaways
- BCD uses four bits for the ten digits 0 through 9.
- The 9-to-0 transition needs different toggles from binary counting.
- Carry includes enable and identifies 9 within the valid BCD sequence.
- All synchronous decimal digits share a clock and advance through enables.
- A mod-60 tens clear depends on both tens = 5 and the units carry.
- Check carry behavior as well as state recovery in unused codes.
5Design a counter for any count sequence
A required sequence may skip values or use a code that differs from binary order. Its state table gives the starting point for a systematic design with D, T or JK flip-flops. Simplifying the input logic can save gates, but also decides what happens in words outside the intended sequence. Checking those extra transitions turns a circuit that counts correctly after reset into one whose recovery behavior is understood.
5.1 Turn a sequence into input equations
A counter can follow any repeating sequence of distinct states. The design task is to make its flip-flop inputs produce each required next word. Start with the state table, then use the chosen storage element's excitation rules.
Write the transitions first
Choose enough output bits to represent the specified count values. A sequence containing 0 and 4 needs three output bits even though it has only two states. If you are free to assign internal state codes, choose the smallest width with at least as many patterns as states.
For the sequence 0, 1, 2, 3, 4, use three bits and write 000→001, 001→010, 010→011, 011→100, 100→000. The remaining words 101, 110 and 111 can be don't-cares during simplification, but their resulting transitions need checking afterward.
Use the correct excitation rule
| Present bit | Next bit | D | T | J | K |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | X |
| 0 | 1 | 1 | 1 | 1 | X |
| 1 | 0 | 0 | 1 | X | 1 |
| 1 | 1 | 1 | 0 | X | 0 |
X means either input value works for that transition. D stores the desired next bit. T indicates whether the bit changes. JK inputs depend on both the present and next bit, leaving one input free on each row. Copying a next-state column directly into T inputs would confuse the desired value with the instruction to toggle.
Derive a mod-5 D counter
For the five transitions above, the next top bit is 1 only at 011. Grouping that minterm with unused 111 in a Karnaugh map gives:
The middle next bit is 1 at 001 and 010. Grouping each with its unused top-bit counterpart gives:
The bottom next bit is 1 at 000 and 010:
At 011 these equations give 100; at 100 they give 000.
For T storage, compute each input using . The required toggle words are 001, 011, 001, 111 and 100. Simplification gives , and .
Use JK don't-cares
For the sequence 0, 1, 2, 4, 5, 6 with bits ABC, the row 010→100 requires J for A to be 1, K for B to be 1, and J for C to be 0. Their companion inputs are X. Filling and simplifying the table gives , , , and .
D offers direct next-state design, T makes toggle conditions easy to see, and JK offers extra simplification choices. After drawing the logic, substitute every valid and unused state into the final equations.
Key Takeaways
- Write the required present-to-next transitions before deriving inputs.
- Specified binary output values can require more bits than freely assigned state codes.
- D equals the next bit; T equals present XOR next.
- JK excitation entries contain useful input don’t-cares.
- Simplify each input separately, then verify every possible state.
5.2 Find and remove lockout
A counter's flip-flops can store more patterns than its intended sequence uses. A design with n bits and M valid states has unused states. Power-up, noise or a timing fault can put the hardware into one of them, so the design must account for their next states.
Follow every unused path
A self-starting counter reaches its intended cycle from every unused state after finitely many clocks. Lockout occurs when an unused state holds forever or unused states form a separate cycle. A counter can generate every correct transition in its main cycle and still suffer lockout elsewhere.
Use the final equations to calculate each unused state's successor. Mark which successors are valid, then follow any path that remains unused until it reaches the main cycle or repeats a state. A repeated unused state proves a trapped cycle. This is a graph check over all possible words, not an assumption about likely power-up values.
For the mod-5 D counter with , and , substitute 101. The next top bit is 0, the middle bit is 1, and the bottom bit is 0, giving 010. Similarly, 110 goes to 010 and 111 goes to 100. All three enter valid states in one clock.
The mod-5 T design has the same valid cycle but different recovery paths: 101→011, 110→010 and 111→001. Unused states do not need to match across implementations. They need to reach the required sequence.
Recognize a trapped ring
A three-bit right-rotating ring is intended to follow 100→010→001→100. Rotation preserves the number of 1s. Thus 000 remains 000, 111 remains 111, and the two-1 patterns follow 011→101→110→011. None can reach a one-hot word through rotation alone.
This explains why merely clearing a ring counter to zero fails. It needs a valid one-hot initialization or feedback that can insert and remove 1s. The complete state diagram exposes the problem even though the three intended transitions are correct.
Choose how to recover
| Method | Effect | Design cost |
|---|---|---|
| Assign unused-state successors | Steers every unused word toward a valid state | May need more gates |
| Add correction feedback | Restores the sequence during operation | Adds detection or feedback logic |
| Reset or preset | Forces a chosen starting word when asserted | Needs a reset path and control |
Leaving unused rows as don't-cares can simplify gates, but the resulting transitions still have definite values. If those values create lockout, change the assignments and simplify again.
A reset establishes a valid start. Recovery logic also handles a later departure from the sequence when reset is not asserted. Even with self-correction, decoded outputs can be wrong on the clocks before recovery completes. If those outputs initiate operations, check their behavior along recovery paths and control when they are accepted.
Key Takeaways
- A counter has unused states.
- Every unused state must reach the main cycle for self-starting operation.
- A fixed unused state and a separate unused cycle are both lockout.
- Don’t-care choices become definite transitions in the finished circuit.
- Reset initializes; correction feedback can recover during normal operation.
6Sequence operations with ring and Johnson counters
Sequencing circuits often need a separate signal for each phase of an operation. Ring and Johnson counters make those signals available with little decoding, using more flip-flops than a compact binary count. Their useful cycles also require the right starting conditions. Comparing storage cost, waveform shape and output timing helps select a counter for phase control, event totals, serial word transfers or clock division.
6.1 Circulate a one-hot timing pulse
A ring counter recirculates a word with exactly one 1. The single 1 moves one position each clock, making each flip-flop output a timing signal for one step. An n-stage ring has n valid states, even though its storage can hold many more patterns.
Read the timing sequence
A four-bit right-shifting ring follows 1000→0100→0010→0001→1000. Connect the old back into the input for . The other stages take their more significant neighbor's old value.
Each output is high for one clock period in every four. At a clock frequency f, each pulse train repeats at f/4 with 25% duty cycle. The outputs describe four logical one-at-a-time phases. They do not represent the binary values 0, 1, 2 and 3; read as unsigned words, they are 8, 4, 2 and 1.
No state decoder is required because each output already identifies one phase. This avoids decoding-gate glitches. A four-phase wave-drive stepper sequence can use the four phases to select one coil at a time, with appropriate output-driving circuitry.
Initialize one 1
Preset one flip-flop and clear the others at start-up. Clearing every stage to zero gives 0000, which simply rotates to itself. Starting with two 1s circulates two active phases, so initialization must establish the correct number of 1s as well as the starting position.
Four flip-flops have 16 patterns but only four valid one-hot words. The other 12 are unused. A plain rotation cannot repair them because rotation preserves the number of 1s. A reset can restore a valid start, but it must be asserted when restoration is needed.
Add self-correcting feedback
For a four-stage right-moving ring, replace the direct feedback with:
The other three shift connections stay the same. The NOR excludes the outgoing last stage. During the first three one-hot states, one of its inputs is 1, so it inserts 0. At 0001 all its inputs are 0, so it inserts 1 and returns to 1000.
From 0000 it inserts a 1 immediately. From 1111 the trace is 0111→0011→0001, reaching the valid cycle within three clocks. Checking all 12 unused patterns shows that three clocks is the worst recovery time. Correction changes the number of 1s when needed while preserving the intended four-state sequence.
Compare storage with decoding
A two-bit binary counter and a 2-to-4 decoder also produce four phase signals. They use two flip-flops instead of four, but add state-decoding gates. When both binary bits change, unequal delays can briefly select a wrong decoded phase. A ring uses more storage and simpler outputs; a binary counter is more compact as the number of phases grows. The choice depends on available flip-flops, decoding cost and how the phase signals are used.
Key Takeaways
- An n-stage one-hot ring has n valid states.
- Each output is high for one clock in every n clocks.
- Initialize exactly one 1; clearing every stage locks a plain ring at zero.
- NOR feedback can preserve the valid cycle and correct unused patterns.
6.2 Fill and empty a Johnson counter
A Johnson counter, also called a twisted-ring counter, feeds the complement of its last bit into its first stage. For a right-moving four-stage register, the first input is . The other bits shift right normally.
Trace the valid cycle
Starting from zero gives:
0000→1000→1100→1110→1111→0111→0011→0001→0000.
The register fills with 1s, then with 0s. An n-stage Johnson counter has 2n states in its intended cycle: four stages give eight states. Only one bit changes at each transition, including the return to zero.
Each flip-flop stays high for n clocks and low for n clocks. Its frequency is and its duty cycle is 50%. A four-stage Johnson counter therefore divides the clock by eight, with differently phased outputs.
Decode a state with two bits
A valid word's boundary between 1s and 0s identifies its position in the sequence. The following terms select the eight four-bit states:
| State | Decoder term |
|---|---|
| 0000 | |
| 1000 | |
| 1100 | |
| 1110 | |
| 1111 | |
| 0111 | |
| 0011 | |
| 0001 |
For example, 1100 has the lower-middle boundary 1 then 0, so is 1. It is 0 for the other seven valid states. Four-input exact-word decoding would work but use wider gates. Since valid transitions change one bit, these simple state decoders avoid the multibit-transition glitches of a binary decoder.
Check the other cycle
Four bits have 16 possible words. Eight are outside the intended cycle, and ordinary Johnson feedback sends them around a separate loop:
0010→1001→0100→1010→1101→0110→1011→0101→0010.
A counter started in that loop never reaches 0000. The short decoder terms are unique only within the valid cycle; unused patterns can give misleading decoded outputs. Clear the register to start it in the intended sequence.
For recovery during operation, replace the input to stage with:
Keep , and . The valid cycle remains unchanged, while every unused state reaches it within five clocks. One longest path is 1010→1101→0110→1011→0101→0000.
For eight timing states, Johnson uses four flip-flops and eight two-input decoding gates. A ring uses eight flip-flops and no decoder; binary uses three flip-flops and a 3-to-8 decoder. Johnson sits between them in storage cost and keeps decoding simple.
Key Takeaways
- An n-stage Johnson counter has 2n valid states.
- Complemented last-stage feedback fills the register with 1s and then 0s.
- Each stage gives a 50% waveform at .
- Two-bit terms identify states within the valid Johnson cycle.
- Ordinary Johnson feedback can lock into an unused-state cycle.
- Reset or correction logic is needed to establish valid operation.
6.3 Match the counter to the job
Choose a counter from the required sequence and outputs. A numeric total, a decimal display, a clock divider and a set of phase signals place different demands on storage, decoding, timing and initialization.
Compare the hardware
| Architecture | For eight states or phases | Main tradeoff |
|---|---|---|
| Synchronous binary | 3 flip-flops plus 3-to-8 decoder for phases | Compact storage; decoding may glitch |
| Ring | 8 flip-flops | Direct one-hot phase outputs |
| Johnson | 4 flip-flops plus eight 2-input gates | Simple phase decoding |
| Ripple binary | 3 flip-flops | Simple divider; count settles in stages |
For long sequences, binary storage saves many flip-flops. A thousand states need ten binary bits, five hundred Johnson stages or a thousand ring stages. A ring can still be attractive for a short sequence whose individual phases must be directly available.
Specify the waveform
A full binary counter's stages divide the clock by powers of two and have 50% duty cycles. A reset-truncated mod-N count usually gives a different duty cycle at its outputs. A Johnson stage gives a 50% waveform at . A ring stage gives a one-clock pulse at with duty cycle .
A terminal-count tick and a square-wave clock can have the same repetition frequency but different high times. For a large or programmable division ratio, use a synchronous counter with clear or load. Choose the particular output based on whether the receiving circuit needs a tick, a level or an edge.
Time a word transfer
A four-bit serial transfer needs exactly four enabled shifts. Let a control flip-flop S enable the shift registers and a two-bit counter. A start operation sets S and establishes count 00 before shifting begins.
During the four enabled edges, the old counts are 00, 01, 10 and 11. At the fourth edge the registers still see S = 1, so they perform the final shift. On that same edge the count returns to 00 and S clears. The next edge sees S = 0 and holds the registers. Clearing S before the edge for old count 11 would lose the fourth bit.
Count events once and show decimal totals
For a sensor event counter, synchronize the sensor signal and detect its transition to create a one-clock enable pulse. Synchronization alone can leave the enable high for several edges, causing several counts for one event. Synchronous BCD decades then advance once per event and feed decimal display decoders without binary-to-decimal conversion.
A four-phase operation can use a ring's one-hot outputs directly, or a binary counter and decoder when storage is scarce. A ripple counter's transient states make direct decoded control risky. Synchronous binary removes accumulated ripple clock delay, but its decoder can still glitch when several bits change. Registered decoder outputs or an appropriate ring or Johnson sequence provide cleaner control signals.
Check the start state and all unused-state paths before accepting the design. A clean waveform during the intended cycle does not correct a locked-out counter.
Key Takeaways
- Choose from the required state sequence, waveform and output timing.
- Binary counters use storage efficiently for long sequences.
- Ring outputs are one-clock phase pulses; Johnson stage outputs have 50% duty cycle.
- A word-time counter must allow the last shift before disabling movement.
- A sensor event needs a one-clock counting pulse, not only synchronization.
- Clean control outputs require attention to decoding and recovery.
Registers and Counters examples
1Capture a word, then control its load
12 steps
- 1IntroductionDecide what one edge stores
A register makes a binary word available after the input lines have moved on. Each flip-flop stores one bit, and a shared clock chooses when the whole word is captured.
We will trace a four-bit word, check the data-stability window and add controls that choose whether the next edge holds, loads or clears it.
- 2ExplanationSample the four inputs together
Write the stored word with its most significant bit on the left. Four D flip-flops each have one data input and share the active rising edge.
At that edge, each takes its own input value. The new outputs appear after clock-to-output delay. Input changes between edges do not pass through the register as they would through enabled level-sensitive latches.
- 3ExampleIgnore an input that missed the edge
The register starts at 0101. Between rising edges, the input first becomes 1100 and later settles at 1110.
The next edge captures 1110. No edge sampled 1100, so it never became the stored word. The old output stays 0101 until the edge’s result propagates to the outputs..
- 4ExampleLocate the timing window
Suppose the rising edge is at 50 ns, setup time is 3 ns and hold time is 2 ns.
The input must be stable by 47 ns and remain stable through 52 ns. With a 5 ns clock-to-output delay, the new output is valid by 55 ns. The stability requirement concerns the input; the later output-valid time describes the result of sampling it.
- 5ChallengeCheck a late input change
A rising-edge register has setup time 4 ns and hold time 1 ns. Its edge occurs at 60 ns. Data changes at 58 ns, then stays stable through 64 ns. Is this transfer guaranteed to meet timing?
---reveal---
No. Data needed to be stable by 56 ns, so the change at 58 ns violates setup. Remaining stable after the edge meets hold but cannot repair the missing setup interval.
- 6Key InsightCopy the sender’s old word
When A feeds B and both use the same edge, B samples A’s old output. A’s new output appears only after its own clock-to-output delay.
This lets a word advance one storage boundary per edge. Check both setup and hold on that inter-register path.
- 7ExplanationChoose data or feedback
A load-controlled register places a multiplexer before every D input. Load 1 selects the external bit; load 0 selects the flip-flop’s own output.
Feedback stores the same bit again at each edge, giving hold while the clock keeps running. Load is a data selection, so asserting it between edges does not itself capture a word.
- 8ExampleApply three load decisions
Start with 0110 and external input 1011. At the first edge, load is 0, so the word remains 0110. At the second, load is 1, so the word becomes 1011.
Now change the input to 0001 and set load to 0 for the third edge. The word stays 1011.
- 9TipKeep selection out of the clock
An ordinary AND gate in the clock path can delay this register’s edge relative to other registers. If load changes while the clock is high, the gated output can also create a new rising edge.
Use the D-input multiplexers to choose hold or load. Dedicated clock-gating circuits exist for chips that intentionally switch clocks, but a plain data-control gate does not provide their behavior.
- 10ChallengeCombine clear with load
A register holds 1101. At the next edge, synchronous clear is 1, load is 1 and input is 0010. Clear has priority. What word follows the edge, and what if clear had been 0?
---reveal---
With clear 1, the word becomes 0000 because clear overrides load. With clear 0, active load captures 0010. Both are clocked actions; the controls select which value the edge stores.
- 11ChallengeTrace a two-register pipeline
A and B share rising edges, with A feeding B. Initially A = 1000 and B = 0001. At the next edge A is enabled to load external 0111 and B is enabled to load A. What are their new words?
---reveal---
A becomes 0111, while B becomes 1000. B captures A’s old output at the edge, before A’s loaded value propagates.
- 12RecapRead timing and control together
First identify the active edge and the word present within its setup-and-hold window. Then apply clear and load priority to decide what is stored.
Feedback makes a running-clock register hold; a selected input makes it load. Asynchronous clear can act between edges, while synchronous clear waits for one. Allow propagation delay before treating the new output word as valid.
2Move and add words one bit at a time
16 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionWatch the old bits move
- 2ExplanationFix the direction first
- 3ExampleCollect four arriving bits
- 4ConnectionConnect serial and parallel forms
- 5ChallengePredict a shifted word
- 6TipChoose the right fill bit
- 7ExplanationGive each stage four paths
- 8ExampleSwitch the route between edges
- 9ChallengeRotate, then load
- 10ExplanationSeparate shifting from output updates
- 11ExampleSet up a serial addition
- 12ExampleProcess the first two pairs
- 13ExampleFinish the higher pairs
- 14ChallengeFind the effect of a stale carry
- 15ChallengeChoose a complete output update
- 16RecapTrack bits, modes and carry
3Trace the delays in a ripple count
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionCount with a chain of clocks
- 2ExplanationChoose Q or its complement
- 3ExampleDivide the input repeatedly
- 4ExampleStart a carry at the low bit
- 5ExampleWait for the full word
- 6ChallengeBudget a settled reading
- 7ExplanationChoose the first unwanted count
- 8ExampleDecode a decade reset
- 9ChallengeBuild a mod-12 reset
- 10Key InsightSeparate period from high time
- 11ChallengeChoose a useful output
- 12RecapUse ripple where settling is acceptable
4Design a shared-clock decimal timer
17 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionPrepare the change before the edge
- 2ExplanationIdentify the bits that toggle
- 3ExampleApply the rule to 0101
- 4ConnectionUse D or JK storage
- 5ChallengeReverse the count
- 6TipAllow logic time without a ripple clock
- 7ExplanationApply control priority
- 8ExampleMake six full count periods
- 9ExampleReload a nonzero start
- 10ChallengeCombine load and priority
- 11ConnectionCarry enables the high block
- 12ExplanationChange the wrap for one decimal digit
- 13ExampleCheck the BCD equations at 9
- 14ChallengeAdvance decimal digits together
- 15ExampleWrap seconds at 59
- 16ChallengeCalculate a periodic tick
- 17RecapKeep every decision tied to the old count
5Derive a sequence and check every state
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionDesign the transitions you need
- 2ExplanationChoose bits from the required outputs
- 3ExampleList all five required rows
- 4ExampleSimplify the high next-state bit
- 5ExampleFinish the other two inputs
- 6ChallengeDerive toggle inputs from a row
- 7ConnectionUse JK excitation choices
- 8ExplanationTest the unused words with final logic
- 9ExampleRecover from 101
- 10ChallengeFind the trapped cycle
- 11Key InsightReset and correction do different jobs
- 12ChallengeJudge a compact implementation
- 13RecapVerify more than the main loop
6Build phases and choose a sequence generator
17 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionChoose the output you need
- 2ExplanationMove one 1 around a ring
- 3ExampleRead the pulse width and rate
- 4ChallengeInitialize the phase pattern
- 5ExplanationMake the ring repair itself
- 6ChallengeFollow correction from extra 1s
- 7ExplanationComplement the last bit instead
- 8ExampleUse the boundary to decode
- 9ChallengeFind a phase detector
- 10Key InsightRead a Johnson square wave
- 11TipCheck the unused Johnson loop
- 12ConnectionCompare eight phase outputs
- 13ChallengeChoose the divider
- 14ExplanationEnd a transfer after the final shift
- 15ChallengeCount one sensor event once
- 16ChallengeFit the output requirements
- 17RecapMatch the cycle and its signals
Registers and Counters practice questions
Set 1: Trace ripple and synchronous counts10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Capture, hold and move binary words10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Build controlled counts and verify recovery10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Generate phases and choose a counter10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Apply timing, state and output requirements10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Active clock edge
Active-low control
Architecture tradeoff
Arithmetic right shift
Asynchronous clear
B
BCD counter
Bidirectional shift register
Bit order
Boundary decoding
C
Carry flip-flop
Carry output
Clock skew
Clock-to-output delay
Control priority
Correction feedback
Count enable
Counter
Critical timing path
D
Decade cascade
Decimal carry
Don’t-care entry
Duty cycle
E
Edge detector
Excitation table
F
Feedback path
Frequency divider
H
Hold time
J
Johnson counter
K
Karnaugh map
L
Load enable
Lockout
M
Mod-60 counter
Mode inputs
Modulus
O
One-bit transition
One-hot code
Output storage register
P
Parallel load
Phase signal
PIPO
PISO
Presettable counter
R
Recovery path
Register
Registered decoding
Reset-method counter
Ring counter
Ripple counter
Rotation
S
Self-starting counter
Serial adder
Serial input
Serial transfer
Settling time
Setup time
Seven-segment decoder
Shift register
SIPO
SISO
State encoding
State table
Storage clock
Synchronous clear
Synchronous counter
T
Terminal count
Tick pulse
Toggle condition
Transient state
U
Universal shift register
Unused state
Unused-state cycle
Up/down control
W
Word-time control
#
8421 BCD
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.