Registers and Counters

Learn how digital circuits store, move and count binary words with groups of flip-flops. Build registers that load and clear on command, shift registers for serial data and serial addition, ripple counters and synchronous binary and BCD counters, and ring and Johnson counters that produce timing signals. Design a counter for any count sequence from D, T or JK flip-flops, check that it recovers from unused states, and choose the right counter for a sequencing task.

IntermediateLesson 5 of 7 in Digital Logic Design Course

What you will learn

  1. 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-flops
      Describe 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 data
      Add 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.
  2. 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 register
      Trace 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 register
      Combine 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 addition
      Convert 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.
  3. 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 counter
      Explain 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 counters
      Shorten 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.
  4. 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 counters
      Derive 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 enable
      Use 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 counters
      Derive the equations of a synchronous decade counter, check its unused states, and cascade decades into multi-digit decimal and clock counters that drive displays.
  5. 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 sequence
      Turn 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-starting
      Find where a counter goes from each unused state, recognize lockout, and fix it by redesigning the next states or by initializing the counter.
  6. 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 counter
      Build 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 counter
      Build 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 task
      Compare 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.

Registers and Counters study guide

6 chapters

1

Store 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 Q3Q2Q1Q0, with Q0 the least significant bit. Four D flip-flops share one clock. At its active edge, each samples its own input:

Qi+=Ii

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 CLR‾, 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 2n 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 Ii; the other feeds back the present output Qi. With load control L:

Di=LIi+L‾Qi

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 C, clear can override load:

Di=C‾(LIi+L‾Qi)
ClearLoadAction at the edge
1EitherClear all bits
01Load input word
00Hold 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:

Ji=LIi,Ki=LIi‾

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 Ji=LIi and Ki=LIi‾.
2

Move 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 Q3Q2Q1Q0, shifting right means moving toward the least significant bit:

Q3+=SI,Q2+=Q3,Q1+=Q2,Q0+=Q1

The old Q0 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 Q0. 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
ConfigurationData entersData leavesMain job
SISOSeriallySeriallyDelay a bit stream
SIPOSeriallyIn parallelAssemble a word
PISOIn parallelSeriallySend a word
PIPOIn parallelIn parallelStore 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:

  1. A = 1101, B = 1001.
  2. A = 1110, B = 1100.
  3. A = 0111, B = 0110.
  4. 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:

ModeOperationInput selected at stage i
00HoldOwn output
01Shift rightMore significant neighbor
10Shift leftLess significant neighbor
11Parallel loadExternal data bit

A 4-to-1 multiplexer before each D input selects the appropriate source. At an interior stage, right shift selects Qi+1 and left shift selects Qi−1. At the ends there is no neighbor, so right shift takes its serial input at Q3 and left shift takes its separate serial input at Q0.

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 Q0 back to the input feeding Q3. For a left rotation, connect Q3 to the input feeding Q0. 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 processedA bitB bitCarry inSumCarry out
Bit 011001
Bit 101101
Bit 211111
Bit 300110

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.
3

Analyze 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 2n−1, 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 edgeClock next stage fromDirection
RisingComplemented outputUp
RisingUncomplemented outputDown
FallingUncomplemented outputUp
FallingComplemented outputDown

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:

fQi=fin2i+1

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 215=32,768.

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:

  1. At 10 ns: 0110, after the first stage falls.
  2. At 20 ns: 0100, after the second stage falls.
  3. At 30 ns: 0000, after the third stage falls.
  4. 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 2i+1.
  • 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 Q3 and Q1 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 Q2Q1 for mod-6 and Q3Q2 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.
4

Design 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:

T0=1,T1=Q0,T2=Q1Q0,T3=Q2Q1Q0

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 EN multiplies every toggle condition, including the least significant one. For example, T2=EN Q1Q0. Enable 0 makes every T input 0, so the counter holds. For JK storage, use Ji=Ki=Ti. For D storage, use:

Di=Qi⊕Ti

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 Q0, 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 U, with 1 meaning up and 0 meaning down, select between these conditions. The third bit uses:

T2=UQ1Q0+U‾ Q1‾ Q0‾

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:

C=EN Q3Q2Q1Q0

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 Ji=Ki=Ti for JK storage or Di=Qi⊕Ti 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:

  1. If clear is active, the next word is zero.
  2. Otherwise, if load is active, the next word is the parallel input.
  3. Otherwise, if enable is active, the word increments.
  4. 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, Q2Q0 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 16−N 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:

T0=1 T1=Q3‾Q0 T2=Q1Q0 T3=Q3Q0+Q2Q1Q0

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 Q3Q0 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:

y=EN Q3Q0

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.
5

Design 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 bitNext bitDTJK
00000X
01111X
1001X1
1110X0

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:

D2=Q1Q0

The middle next bit is 1 at 001 and 010. Grouping each with its unused top-bit counterpart gives:

D1=Q1‾Q0+Q1Q0‾=Q1⊕Q0

The bottom next bit is 1 at 000 and 010:

D0=Q2‾ Q0‾

At 011 these equations give 100; at 100 they give 000.

For T storage, compute each input using Ti=Qi⊕Qi+. The required toggle words are 001, 011, 001, 111 and 100. Simplification gives T2=Q2+Q1Q0, T1=Q0 and T0=Q2‾.

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 JA=KA=B, JB=C, KB=1, JC=B‾ and KC=1.

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 2n−M 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 D2=Q1Q0, D1=Q1⊕Q0 and D0=Q2‾ Q0‾, 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
MethodEffectDesign cost
Assign unused-state successorsSteers every unused word toward a valid stateMay need more gates
Add correction feedbackRestores the sequence during operationAdds detection or feedback logic
Reset or presetForces a chosen starting word when assertedNeeds 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 2n−M 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.
6

Sequence 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 Q0 back into the input for Q3. 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:

Q3+=Q3+Q2+Q1‾

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 Q0‾. 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 f/(2n) 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:

StateDecoder term
0000Q3‾ Q0‾
1000Q3Q2‾
1100Q2Q1‾
1110Q1Q0‾
1111Q3Q0
0111Q3‾Q2
0011Q2‾Q1
0001Q1‾Q0

For example, 1100 has the lower-middle boundary 1 then 0, so Q2Q1‾ 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 Q1 with:

Q1+=(Q3+Q1)Q2

Keep Q3+=Q0‾, Q2+=Q3 and Q0+=Q1. 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 f/(2n).
  • 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
ArchitectureFor eight states or phasesMain tradeoff
Synchronous binary3 flip-flops plus 3-to-8 decoder for phasesCompact storage; decoding may glitch
Ring8 flip-flopsDirect one-hot phase outputs
Johnson4 flip-flops plus eight 2-input gatesSimple phase decoding
Ripple binary3 flip-flopsSimple 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 f/(2n). A ring stage gives a one-clock pulse at f/n with duty cycle 1/n.

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

6 Walkthroughs

1

Capture a word, then control its load

12 steps
Trace what a common clock captures, check the timing window and add clear and load controls.
  1. 1
    IntroductionDecide 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.

  2. 2
    ExplanationSample 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.

  3. 3
    ExampleIgnore 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..

  4. 4
    ExampleLocate 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.

  5. 5
    ChallengeCheck 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.

  6. 6
    Key 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.

  7. 7
    ExplanationChoose 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.

    Di=LIi+L‾Qi

    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.

  8. 8
    ExampleApply 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.

  9. 9
    TipKeep 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.

  10. 10
    ChallengeCombine 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.

  11. 11
    ChallengeTrace 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.

  12. 12
    RecapRead 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.

2

Move and add words one bit at a time

16 steps
Trace right and left shifts, select universal modes, transfer a serial word and follow a serial addition.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionWatch the old bits move
  2. 2
    ExplanationFix the direction first
  3. 3
    ExampleCollect four arriving bits
  4. 4
    ConnectionConnect serial and parallel forms
  5. 5
    ChallengePredict a shifted word
  6. 6
    TipChoose the right fill bit
  7. 7
    ExplanationGive each stage four paths
  8. 8
    ExampleSwitch the route between edges
  9. 9
    ChallengeRotate, then load
  10. 10
    ExplanationSeparate shifting from output updates
  11. 11
    ExampleSet up a serial addition
  12. 12
    ExampleProcess the first two pairs
  13. 13
    ExampleFinish the higher pairs
  14. 14
    ChallengeFind the effect of a stale carry
  15. 15
    ChallengeChoose a complete output update
  16. 16
    RecapTrack bits, modes and carry
3

Trace the delays in a ripple count

12 steps
Determine count direction, compute divided frequencies and shorten a ripple sequence with asynchronous clear.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionCount with a chain of clocks
  2. 2
    ExplanationChoose Q or its complement
  3. 3
    ExampleDivide the input repeatedly
  4. 4
    ExampleStart a carry at the low bit
  5. 5
    ExampleWait for the full word
  6. 6
    ChallengeBudget a settled reading
  7. 7
    ExplanationChoose the first unwanted count
  8. 8
    ExampleDecode a decade reset
  9. 9
    ChallengeBuild a mod-12 reset
  10. 10
    Key InsightSeparate period from high time
  11. 11
    ChallengeChoose a useful output
  12. 12
    RecapUse ripple where settling is acceptable
4

Design a shared-clock decimal timer

17 steps
Derive toggle conditions, choose load and clear boundaries, and coordinate decimal digits on one clock.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionPrepare the change before the edge
  2. 2
    ExplanationIdentify the bits that toggle
  3. 3
    ExampleApply the rule to 0101
  4. 4
    ConnectionUse D or JK storage
  5. 5
    ChallengeReverse the count
  6. 6
    TipAllow logic time without a ripple clock
  7. 7
    ExplanationApply control priority
  8. 8
    ExampleMake six full count periods
  9. 9
    ExampleReload a nonzero start
  10. 10
    ChallengeCombine load and priority
  11. 11
    ConnectionCarry enables the high block
  12. 12
    ExplanationChange the wrap for one decimal digit
  13. 13
    ExampleCheck the BCD equations at 9
  14. 14
    ChallengeAdvance decimal digits together
  15. 15
    ExampleWrap seconds at 59
  16. 16
    ChallengeCalculate a periodic tick
  17. 17
    RecapKeep every decision tied to the old count
5

Derive a sequence and check every state

13 steps
Build a mod-5 counter from its transition table, compare storage types and trace unused-state recovery.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionDesign the transitions you need
  2. 2
    ExplanationChoose bits from the required outputs
  3. 3
    ExampleList all five required rows
  4. 4
    ExampleSimplify the high next-state bit
  5. 5
    ExampleFinish the other two inputs
  6. 6
    ChallengeDerive toggle inputs from a row
  7. 7
    ConnectionUse JK excitation choices
  8. 8
    ExplanationTest the unused words with final logic
  9. 9
    ExampleRecover from 101
  10. 10
    ChallengeFind the trapped cycle
  11. 11
    Key InsightReset and correction do different jobs
  12. 12
    ChallengeJudge a compact implementation
  13. 13
    RecapVerify more than the main loop
6

Build phases and choose a sequence generator

17 steps
Trace ring and Johnson timing, repair unused states and select a counter for clean phase and event signals.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionChoose the output you need
  2. 2
    ExplanationMove one 1 around a ring
  3. 3
    ExampleRead the pulse width and rate
  4. 4
    ChallengeInitialize the phase pattern
  5. 5
    ExplanationMake the ring repair itself
  6. 6
    ChallengeFollow correction from extra 1s
  7. 7
    ExplanationComplement the last bit instead
  8. 8
    ExampleUse the boundary to decode
  9. 9
    ChallengeFind a phase detector
  10. 10
    Key InsightRead a Johnson square wave
  11. 11
    TipCheck the unused Johnson loop
  12. 12
    ConnectionCompare eight phase outputs
  13. 13
    ChallengeChoose the divider
  14. 14
    ExplanationEnd a transfer after the final shift
  15. 15
    ChallengeCount one sensor event once
  16. 16
    ChallengeFit the output requirements
  17. 17
    RecapMatch the cycle and its signals

Registers and Counters practice questions

50 Practice Questions in 5 sets

Set 1: Trace ripple and synchronous counts10 Practice Questions

Question 1 of 10

A reset-method mod-14 binary counter counts from zero. For what fraction of its cycle is the most significant bit high?
  1. 7/14
  2. 6/14
  3. 8/14
  4. 1/14
Show answerHide answer
Answer: B
Four bits are needed, and the top bit is high at counts 8 through 13: six of the fourteen stable states. The output therefore has duty cycle 6/14, even though its pattern repeats every fourteen input clocks. A 7/14 result assumes a 50% duty cycle without checking the actual states.

Question 2 of 10

An enabled synchronous four-bit binary up counter holds 1011. What toggle word, ordered from bit 3 to bit 0, is needed next?
  1. 0111
  2. 1111
  3. 1100
  4. 0011
Show answerHide answer
Answer: A
The bottom bit toggles on every count, and bits 1 and 2 toggle because all their lower bits are 1. Bit 3 holds because the lower three bits are 011, not all 1. Thus the toggle word is 0111; toggling every bit would incorrectly change the top bit.

Question 3 of 10

A four-bit synchronous down counter holds 1010 and is enabled. What is the next stored word?
  1. 1011
  2. 0101
  3. 1001
  4. 1000
Show answerHide answer
Answer: C
The bottom bit toggles, and bit 1 toggles because its lower bit is 0. Higher bits hold because their lower-bit groups are not all 0, giving 1001. The result 1011 increments the word; down counting uses lower-zero conditions instead of lower-one conditions.

Question 4 of 10

A synchronous counter has 8 ns maximum clock-to-output delay, 7 ns maximum input-logic delay and 5 ns setup time. With no clock skew, what maximum frequency meets this timing bound?
  1. 125 MHz
  2. 66.7 MHz
  3. 100 MHz
  4. 50 MHz
Show answerHide answer
Answer: D
The next input can be valid 15 ns after an edge, and setup needs another 5 ns before the following edge. The minimum period is therefore 20 ns, whose reciprocal is 50 MHz. Using 15 ns and 66.7 MHz ignores the receiving flip-flop’s setup requirement.

Question 5 of 10

A synchronously cleared up counter starts at zero and clears on the edge after its detector sees decimal 8. What is its modulus?
  1. 9
  2. 7
  3. 8
  4. 10
Show answerHide answer
Answer: A
Synchronous clear allows 8 to remain as a stable state and returns to zero on the following edge. The cycle includes all nine values from 0 through 8. A modulus of 8 would require detecting 7 for synchronous clear, or detecting 8 for asynchronous clear.

Question 6 of 10

A binary ripple counter uses falling-edge flip-flops. Each later clock connects to the preceding uncomplemented output. What settled word follows 000 on one input pulse?
  1. 111
  2. 010
  3. 100
  4. 001
Show answerHide answer
Answer: D
Falling-edge storage with uncomplemented interstage clocking counts up. The least significant bit rises from 0 to 1 on this pulse, producing 001 without triggering a falling edge in the next stage. The result 111 would match the opposite count direction.

Question 7 of 10

A five-stage full binary divider receives 6.4 MHz. What is the frequency at its most significant output?
  1. 400 kHz
  2. 200 kHz
  3. 100 kHz
  4. 1.28 MHz
Show answerHide answer
Answer: B
Five binary stages divide by 32, so 6.4 MHz becomes 0.2 MHz, or 200 kHz. Dividing by 16 gives 400 kHz and corresponds to the fourth stage. Each stage adds another factor of two; the divisor is not the number of stages.

Question 8 of 10

A four-bit up ripple counter has a 7 ns delay per stage. It starts at 1111, and the next input edge occurs at 0 ns. Its outputs feed a zero detector with a 3 ns delay. When is the decoded zero from the settled wrap guaranteed valid?
  1. 31 ns
  2. 10 ns
  3. 24 ns
  4. 28 ns
Show answerHide answer
Answer: A
The carry must pass through all four stages, so the stable 0000 word is reached after 28 ns. The zero detector then needs another 3 ns, giving 31 ns. A 28 ns answer stops at the counter outputs and omits the decoder that the question asks about.

Question 9 of 10

A reset-method ripple counter must count 0 through 10. What decimal count should its asynchronous-clear detector recognize?
  1. 9
  2. 10
  3. 11
  4. 12
Show answerHide answer
Answer: C
The desired stable sequence contains eleven counts, so the first unwanted value is 11. Asynchronous clear acts as soon as that value appears. Detecting 10 would remove the last wanted count before it can remain for a full period, shortening the sequence.

Question 10 of 10

Two four-bit synchronous binary up counters share a clock. The low block counts every edge; the high block is wrongly enabled by the low block’s top bit. Starting at 0000 1110, what word follows three edges, and what enable connection repairs binary counting?
  1. 0001 0001; use low top bit
  2. 0010 0001; use enabled low carry
  3. 0010 0001; use low bottom bit
  4. 0001 0001; use enabled low carry
Show answerHide answer
Answer: B
The high block advances at old low counts 14 and 15, then holds at 0, producing 0010 0001. Qualifying its enable with the low block’s enabled all-ones carry makes it advance only on the wrapping edge. The word 0001 0001 is the repaired result, not the faulty circuit’s result.
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

A register has a 4 ns setup time and a 2 ns hold time. Its active edge arrives at 30 ns. Over what interval must its input remain stable?
  1. 24 ns through 30 ns
  2. 26 ns through 32 ns
  3. 28 ns through 34 ns
  4. 26 ns through 30 ns
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A parallel-load register holds 1010, its data inputs show 0100, and load is 0 at the active edge. What word appears after the edge?
  1. 0000
  2. 0100
  3. 1110
  4. 1010
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A rising-edge register holds 1001. Its inputs change to 0011 and then settle at 1101 before the next rising edge. What word does that edge capture?
  1. 1001
  2. 0011
  3. 1101
  4. 1111
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A register uses clear, then load, then hold priority. It holds 0010 with input 1110. Clear is synchronous and active, and load is also active. What are its words immediately before and after the next edge?
  1. 0010 before; 0000 after
  2. 0000 before; 0000 after
  3. 0010 before; 1110 after
  4. 1110 before; 0000 after
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A four-bit register holds 0110 and shifts right with serial input 1. What is its next word?
  1. 0011
  2. 1101
  3. 1011
  4. 1110
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A four-bit right-shifting register starts at 0000. Serial inputs at three successive active edges are 0, 1 and 1. What word does it hold afterward?
  1. 0011
  2. 1100
  3. 0110
  4. 1110
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

An eight-bit unsigned register holds 10010110. It shifts left once with zero fill. What unsigned decimal value remains?
  1. 44
  2. 150
  3. 75
  4. 300
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A universal register uses 00 hold, 01 right, 10 left and 11 load. It starts at 1100, then uses mode 01 with input 1, followed by mode 10 with input 0. What final word results?
  1. 1110
  2. 0110
  3. 1111
  4. 1100
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A four-bit universal register starts at 0011. It rotates right once, holds for one edge, then shifts left with input 0. What word and outgoing bit result from that final shift?
  1. 0110; outgoing bit 1
  2. 0010; outgoing bit 0
  3. 1001; outgoing bit 1
  4. 0010; outgoing bit 1
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Three eight-bit output-expansion registers are chained. Their storage clocks share one control line, held inactive while data shifts. How many shift edges and storage edges load a completely new 24-bit output word?
  1. 8 shift edges, then 3 storage edges
  2. 24 shift edges, then 1 storage edge
  3. 24 shift edges, then 3 storage edges
  4. 1 shift edge, then 24 storage edges
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

A T flip-flop currently holds 1 and receives T = 1 at its active edge. What D input would produce the same next bit?
  1. 0
  2. 1
  3. Either 0 or 1
  4. The present T value
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A four-bit synchronous counter loads decimal 6 whenever its enabled terminal count is reached. Otherwise it increments. How many states are in its repeating cycle?
  1. 9
  2. 6
  3. 10
  4. 11
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A valid, enabled BCD digit holds 1001. What word does the next count edge store?
  1. 1010
  2. 1000
  3. 0001
  4. 0000
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A synchronous three-digit BCD counter displays 079 and is enabled. What display follows two count edges?
  1. 080
  2. 081
  3. 089
  4. 071
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A 12 MHz clock must produce one terminal-count tick every 5 ms. What counter width and synchronous clear detection value are needed for a count starting at zero?
  1. 16 bits; detect 60,000
  2. 15 bits; detect 59,999
  3. 16 bits; detect 59,999
  4. 17 bits; detect 60,000
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A mod-60 synchronous seconds counter displays 58. Units is a decade; tens increments on units carry and clears when tens is 5 and units carry is active. After three enabled edges, what is displayed?
  1. 00
  2. 11
  3. 61
  4. 01
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A three-bit counter must change from 110 to 011. What T-input word is required for that transition?
  1. 101
  2. 011
  3. 110
  4. 111
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A counter’s outputs must repeat the binary values 1, 3 and 9. How many flip-flops are needed to store those outputs directly?
  1. 2
  2. 4
  3. 3
  4. 9
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A three-bit counter uses five states. Its unused states follow 101→110→001 and 111→100, and 001 and 100 are valid. What is its longest unused-state recovery time?
  1. 1 clock
  2. 3 clocks
  3. It never recovers
  4. 2 clocks
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A counter’s valid cycle uses 000, 001, 010, 011 and 100. Its final equations send 101→110, 110→101 and 111→000. What change to one unused-state successor makes every unused state reach the valid cycle?
  1. Change 111→000 to 111→001
  2. Change 101→110 to 101→101
  3. Change 110→101 to 110→010
  4. Change 110→101 to 110→110
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

A five-stage ring counter has a 250 kHz clock. What are one stage’s pulse repetition frequency and duty cycle?
  1. 125 kHz and 50%
  2. 50 kHz and 50%
  3. 25 kHz and 20%
  4. 50 kHz and 20%
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A four-stage right Johnson counter is in 1110. Complemented last-bit feedback is used. What are its next two words?
  1. 1111, then 0111
  2. 0111, then 0011
  3. 1111, then 1110
  4. 0111, then 1011
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A four-bit Johnson counter is known to be in its valid cycle. What two-input product detects 0011?
  1. Q2Q1‾
  2. Q3‾ Q0‾
  3. Q2‾Q1
  4. Q1‾Q0
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A six-stage one-hot ring counter runs from a valid state. How many distinct states are in its intended cycle?
  1. 3
  2. 6
  3. 12
  4. 64
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A controller needs 12 direct one-hot phase outputs and has room for twelve flip-flops. It must use no state-decoding gates. What counter architecture meets those conditions?
  1. A 6-stage Johnson counter
  2. A 4-bit binary counter
  3. A 12-stage Johnson counter
  4. A 12-stage ring counter
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A self-correcting right ring uses Q3+=Q3+Q2+Q1‾ and ordinary right-shift connections for the other bits. Starting at 1100, what word first enters the valid one-hot cycle?
  1. 1000
  2. 0001
  3. 0010
  4. 0100
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A corrected four-bit Johnson counter uses Q3+=Q0‾, Q2+=Q3, Q1+=(Q3+Q1)Q2 and Q0+=Q1. Starting at 1101, what first valid state does it reach?
  1. 1000
  2. 1111
  3. 0000
  4. 0001
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A six-bit transfer controller starts at count 000 with enable S = 1. Each edge with old S = 1 shifts and increments the count; old count 101 also returns the count to 000 and clears S. What occurs across the sixth and seventh edges?
  1. Sixth shifts and clears S; seventh holds
  2. Sixth shifts and holds S; seventh shifts
  3. Sixth clears S; seventh makes the last shift
  4. Sixth holds and clears S; seventh holds
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A plain three-bit ring is intended to cycle 100, 010 and 001. If it starts at 101, what feature prevents recovery?
  1. Rotation clears a 1 each edge
  2. Its three valid states use all codes
  3. Its feedback always inserts a 0
  4. Rotation preserves its two 1s
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A device needs a 50% duty-cycle output at 80 kHz from a 960 kHz clock, with no extra output toggle stage. How many stages does a Johnson divider need?
  1. 4
  2. 6
  3. 8
  4. 12
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

With load 0, what data source must each D-input multiplexer select to hold a register word?
  1. Its external data input
  2. The preceding bit’s output
  3. Its own flip-flop output
  4. The constant-zero input
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A shift connection has minimum clock-to-output delay 2 ns, minimum path delay 1 ns and receiving hold time 2 ns. What is the largest positive receiving-clock skew allowed by this hold bound?
  1. 1 ns
  2. 2 ns
  3. 3 ns
  4. 5 ns
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A four-bit serial adder adds unsigned 0110 and 0011 but begins with stored carry 1. After four bit pairs, what sum word remains in A?
  1. 1001
  2. 1000
  3. 1011
  4. 1010
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A synchronous two-digit BCD counter displays 29. Units enable is 0, and units carry is correctly qualified by enable. After four clock edges, what display remains?
  1. 20
  2. 29
  3. 30
  4. 69
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

For the transition 101→010, what is the required JK input pair for the middle bit?
  1. J = 1, K = X
  2. J = X, K = 1
  3. J = 0, K = X
  4. J = X, K = 0
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A four-bit synchronous counter must repeat 5 through 12 inclusive. Clear has priority over load. The proposed wiring asserts both clear and load at 12, with parallel data 5. What wiring change produces the required cycle?
  1. Assert clear at 12 and leave load inactive
  2. Assert both controls at 11 instead of 12
  3. Assert load at 13 and leave clear inactive
  4. Assert load at 12 and leave clear inactive
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A counter’s valid cycle is 00→01→10→00. The unused word 11 is a don’t-care during minimization. Final equations are D1=Q0 and D0=Q1‾ Q0‾. What behavior do the equations establish for the unused word?
  1. 11 holds itself indefinitely
  2. 11 reaches valid 00 in one edge
  3. 11 reaches valid 10 in one edge
  4. 11 enters a separate two-state cycle
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A four-bit serial adder starts with A = 1001, B = 0110 and carry 0. B shifts right with zero fill, and each sum bit enters A at the left. What are A and carry after two edges?
  1. A = 1110; carry = 0
  2. A = 1111; carry = 0
  3. A = 0110; carry = 1
  4. A = 1100; carry = 1
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A 2 MHz clock must give a one-clock-wide tick every 125 µs. The counter starts at zero and uses synchronous clear. What width, terminal count and tick width meet the request?
  1. 8 bits; 250; 0.5 µs
  2. 8 bits; 249; 0.5 µs
  3. 7 bits; 124; 1 µs
  4. 8 bits; 249; 62.5 µs
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A controller has at most four flip-flops and needs eight separately decoded phase states using only two-input product gates. During its valid cycle, each step must change one stored bit. What design meets all three requirements?
  1. A three-bit binary up counter
  2. An eight-stage one-hot ring
  3. A four-stage one-hot ring
  4. A four-stage Johnson counter
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

74 Key Terms, each with its definition

A

Active clock edge
An active clock edge is the rising or falling transition at which an edge-triggered flip-flop samples its data input.
A rising-edge register captures 1010 only if that word is present with the required timing at the rise.
Active-low control
An active-low control requests its operation at logic 0 and is inactive at logic 1, often shown with an overbar.
A NAND count detector can drive an active-low clear directly when its selected bits become 1.
Architecture tradeoff
An architecture tradeoff compares storage, logic, timing and waveform requirements to choose a suitable register or counter design.
Eight phases cost three binary flip-flops plus decoding, four Johnson stages plus decoding, or eight ring stages.
Arithmetic right shift
An arithmetic right shift moves bits toward the least significant end and fills the gap with the old sign bit.
The two’s-complement word 1100 becomes 1110, extending its sign while moving each bit right.
Asynchronous clear
An asynchronous clear is a reset input that forces stored bits to zero without waiting for an active clock edge.
Asserting asynchronous clear between clock edges removes the old word after the reset delay.

B

BCD counter
A BCD counter stores a decimal digit using the ten four-bit 8421 codes from 0000 through 1001, then wraps to zero.
The units BCD counter returns from 9 to 0 while its carry advances the tens digit.
Bidirectional shift register
A bidirectional shift register can move stored bits in either direction, using a serial input at the entering end.
Selecting left shift makes the new serial bit enter the least significant position of the word.
Bit order
The bit order specifies whether a serial word’s least significant or most significant bit is transmitted or processed first.
A serial adder uses least significant bits first because each carry belongs to the next higher pair.
Boundary decoding
Boundary decoding identifies a valid Johnson state by testing a neighboring 1-to-0 or 0-to-1 boundary, or matching end bits.
Within the valid four-bit cycle, the term Q2Q1‾ selects state 1100.

C

Carry flip-flop
A carry flip-flop stores a serial adder’s carry-out so the next more significant bit pair receives the proper carry-in.
Clearing the carry flip-flop before a new addition prevents an old carry from adding an extra 1.
Carry output
A carry output indicates an enabled terminal count so a higher synchronous counter block can advance on the wrapping edge.
At low-block count 1111, carry enables the high block before the common edge wraps the low block.
Clock skew
Clock skew is the difference in arrival time of a nominally shared clock edge at two storage elements.
A later receiving edge increases the time for which the sender’s old data must remain available.
Clock-to-output delay
The clock-to-output delay is the interval between an active clock edge and the resulting change becoming valid at the output.
A captured word does not appear instantly; receiving logic must allow for its output delay.
Control priority
The control priority is the ordering that decides which requested operation wins when several controls are active together.
With clear above load, asserting both makes the counter clear instead of taking the parallel data.
Correction feedback
Correction feedback changes next-state logic so unused patterns move toward the valid cycle while valid transitions stay intact.
NOR feedback can create a single 1 from an all-zero ring and remove extra 1s during recovery.
Count enable
A count enable permits counting when active and makes all stages retain their stored values when inactive.
Qualifying every toggle input with count enable pauses the counter without stopping the clock.
Counter
A counter is a sequential circuit that advances through a defined repeating sequence of stored states when enabled.
An event counter advances once for each one-clock pulse produced from a sensor transition.
Critical timing path
The critical timing path is the longest storage-to-input logic path whose delay limits how soon the next sampling edge may arrive.
Long toggle-condition gate chains increase the counter’s required period even with one shared clock.

D

Decade cascade
A decade cascade connects decimal counter stages so each higher digit advances when the preceding digit wraps from 9 to 0.
A three-digit ripple cascade counts to 999, but its full output needs time to settle at a carry.
Decimal carry
A decimal carry advances the next digit when the current enabled BCD digit is at 9 and will wrap on the next edge.
Including enable in decimal carry prevents a paused units digit at 9 from advancing tens repeatedly.
Don’t-care entry
A don’t-care entry marks an input or output choice that can take either binary value for the specified design requirement.
Grouping an unused state in a Karnaugh map can simplify a gate, but its final next state still needs checking.
Duty cycle
The duty cycle is the fraction of a repeating signal’s period for which the signal is high, often written as a percentage.
The decade counter’s top bit is high for two of ten count periods, giving a 20% duty cycle.

E

Edge detector
An edge detector produces a short pulse when a sampled signal changes level, allowing one count per detected event.
After sensor synchronization, a one-clock edge pulse prevents one long active level from causing many counts.
Excitation table
An excitation table specifies the flip-flop input values that cause each required present-bit to next-bit transition.
For a JK bit changing from 1 to 0, the table requires K = 1 while J can take either value.

F

Feedback path
A feedback path returns a stored output to its own input logic so the next clock edge can retain or transform that value.
Selecting each register bit’s feedback path causes a hold while the clock continues to run.
Frequency divider
A frequency divider produces an output whose repeating pattern occurs at a fixed fraction of the input clock frequency.
Four full binary stages divide a 3.2 MHz clock by sixteen to produce a 200 kHz output.

H

Hold time
The hold time is the minimum interval for which sampled data must remain stable after a flip-flop’s active edge.
A very fast next-stage data change can violate hold even when the previous value met setup.

J

Johnson counter
A Johnson counter complements the outgoing bit before returning it to a shift register’s input, giving an intended 2n-state cycle.
A four-stage Johnson sequence fills with 1s and then 0s, using eight of its sixteen possible words.

K

Karnaugh map
A Karnaugh map arranges Boolean input combinations so adjacent groups can simplify the equations driving each flip-flop input.
Unused-state entries can enlarge a group when deriving a smaller expression for one D input.

L

Load enable
A load enable is a control that selects new external data when active and stored-value feedback when inactive.
With load enable low, changes on a shared data bus leave that register’s stored byte intact.
Lockout
Lockout is counter behavior in which an unused state or separate unused-state cycle prevents return to the intended sequence.
The all-zero state locks a plain one-hot ring because rotating zeros never creates the required 1.

M

Mod-60 counter
A mod-60 counter has sixty intended states and can combine a units decade with a tens digit restricted to 0 through 5.
In a mod-60 seconds counter at 59, one common clock edge returns both digits to zero and prepares the next minute.
Mode inputs
Mode inputs are control bits that select which data-routing operation a universal register performs at the next edge.
In one mode table for a universal register, 01 selects right shift and 11 selects parallel loading.
Modulus
The modulus is the number of distinct states in one complete repeating cycle of a counter’s intended sequence.
The sequence 4 through 11 contains eight states, so its modulus is eight despite the nonzero start.

O

One-bit transition
A one-bit transition changes exactly one stored bit between successive words, simplifying clean state decoding in a valid Johnson cycle.
From 1100 to 1110 only bit 1 changes, so no combination of several changing count bits passes the decoder.
One-hot code
A one-hot code represents each valid state with exactly one bit set to 1, making that bit a direct state indicator.
In a four-stage ring counter, a one-hot phase word of 0100 selects only the second phase.
Output storage register
An output storage register holds a completed output word while separate shift stages collect the next serial word.
An output bank keeps its old pattern during shifting, then changes together on the storage-clock edge.

P

Parallel load
A parallel load is the capture of all bits of an input word into a register on one active clock edge.
One load pulse spanning an active edge transfers an entire byte into an output register.
Phase signal
A phase signal identifies a particular step within a repeated operation, allowing actions to occur in a defined order.
Each ring output becomes active for one clock as a four-step operation moves through its phases.
PIPO
A parallel-in parallel-out register, or PIPO register, captures a whole input word and makes all stored bits available together.
A PIPO destination captures the source register’s old word at their shared active clock edge.
PISO
A parallel-in serial-out register, or PISO register, loads a word at once and sends its bits through one serial output.
A transmitter loads a byte in parallel, then takes eight shift clocks to send it serially.
Presettable counter
A presettable counter can load an external parallel word so counting can start or restart at a selected nonzero value.
Loading 12 at terminal count makes a four-bit up counter repeat 12, 13, 14 and 15.

R

Recovery path
A recovery path is the sequence of transitions from an unused state to the counter’s intended cycle.
The longest recovery path gives the maximum number of clocks before the valid sequence resumes.
Register
A register is a group of flip-flops that stores one binary word, with one bit per stage and a common clock.
A four-bit register keeps a control word available while its input lines carry the next word.
Registered decoding
Registered decoding captures a decoded value in storage at a controlled edge so intermediate combinational glitches do not directly drive controls.
A binary phase decoder can feed an output register when short wrong-phase pulses would trigger unwanted actions.
Reset-method counter
A reset-method counter shortens a binary cycle by asynchronously clearing the stored word when the first unwanted count appears.
A mod-11 ripple design briefly reaches decimal 11 before its count detector clears all stages.
Ring counter
A ring counter recirculates a one-hot word through a shift register so an n-stage register generates n timing states.
A four-stage ring supplies the logical phase sequence 1000, 0100, 0010 and 0001.
Ripple counter
A ripple counter clocks its first stage externally and later stages from preceding outputs, so changes propagate in sequence.
A carry through four ripple stages reaches the top bit only after four successive stage delays.
Rotation
A rotation is a shift operation that returns the outgoing bit to the entering end, preserving all bits in the word.
Right rotation changes 1001 to 1100 because the outgoing least significant 1 returns at the left.

S

Self-starting counter
A self-starting counter reaches its intended cycle from every unused stored word after a finite number of clock transitions.
If each of three unused words leads into the main cycle, the counter recovers from any starting pattern.
Serial adder
A serial adder reuses one full adder over successive bit pairs and stores carry between cycles to add whole words.
A four-bit addition processes four pairs before the result register contains the completed sum.
Serial input
A serial input is the data connection that supplies one new bit to the entering end of a shift register per shift.
During a right shift of a four-bit word, serial input supplies the next most significant bit.
Serial transfer
A serial transfer moves a word between registers one bit per clock through a serial data connection.
A six-bit transfer needs six enabled shifts; stopping after five leaves a partly replaced receiver.
Settling time
The settling time is the delay needed after an input clock event before the complete counter output has reached its final word.
A decoder’s delay must be added after counter settling when deciding when its reading is valid.
Setup time
The setup time is the minimum interval for which data must be stable before the active sampling edge of a flip-flop.
With a 3 ns setup time, data for an edge at 40 ns must already be stable by 37 ns.
Seven-segment decoder
A seven-segment decoder converts a digit code into the segment signals needed to display that digit on a seven-segment display.
Each BCD digit can feed its own display decoder without first converting a whole binary total.
Shift register
A shift register is a clocked chain of storage stages that moves each bit to a neighboring stage at each enabled edge.
A receiver assembles a serial byte by moving the arriving bits through eight clocked stages.
SIPO
A serial-in parallel-out register, or SIPO register, collects sequential input bits into a word available at parallel outputs.
After all bits arrive, the receiver reads the SIPO outputs together as a completed word.
SISO
A serial-in serial-out register, or SISO register, accepts and releases one bit per shift, providing a clocked stream delay.
An eight-stage SISO path delays a bit stream by eight cycles before the corresponding bits emerge.
State encoding
A state encoding assigns stored binary words to the abstract states of a sequential circuit’s required behavior.
Three freely encoded states need two bits, while directly outputting the values 0, 1 and 8 needs four.
State table
A state table lists the next stored word required for each present state, including the effect of relevant control inputs.
Writing 011→100 before choosing inputs keeps the required transition separate from its implementation.
Storage clock
A storage clock controls the transfer from shift stages into a separate output register after a serial word is complete.
Sixteen shift edges prepare two chained bytes before one storage-clock edge updates their outputs.
Synchronous clear
A synchronous clear is a reset operation that stores zeros only at the active clock edge while its control is asserted.
A mod-8 synchronous counter detects 7 and returns to zero at the following edge.
Synchronous counter
A synchronous counter applies a shared clock to every stage and uses combinational input logic to select the next state.
In a four-stage synchronous counter, the stages prepare their toggle inputs before one shared edge changes the stored binary word.

T

Terminal count
The terminal count is the final stored value used to prepare a wrap, reload or carry for the next counting transition.
A counter that loads 6 after 15 uses 15 as its terminal count and repeats ten stored values.
Tick pulse
A tick pulse is a brief timing signal that marks a periodic event, such as a terminal count, without staying high for half the cycle.
A one-clock tick can repeat once per second while remaining high for only a few nanoseconds.
Toggle condition
A toggle condition is the Boolean test that decides whether a stored bit must complement its present value at the next edge.
For binary up counting, bit 2 toggles only when the two lower bits are both 1.
Transient state
A transient state is an intermediate output word that appears briefly while a counter is moving between stable counts.
A zero decoder can pulse during a ripple transition that briefly passes through the all-zero word.

U

Universal shift register
A universal shift register combines hold, shifts in both directions and parallel load through selectable input paths.
The same register can load a control word, rotate its bits and then keep the resulting pattern.
Unused state
An unused state is a stored bit pattern outside a counter’s intended repeating sequence, even though the flip-flops can hold it.
A three-bit mod-6 counter has two unused patterns because its storage provides eight possible words.
Unused-state cycle
An unused-state cycle is a closed loop of transitions among invalid count words that never enters the intended cycle.
A plain four-stage Johnson counter has eight unused words that circulate in a separate locked loop.
Up/down control
An up/down control selects whether the next enabled edge increments or decrements a binary counter’s stored value.
Switching from up to down between edges makes the next edge use lower-zero toggle conditions.

W

Word-time control
Word-time control enables shifting for exactly the number of clock edges needed to move one complete serial word.
A two-bit count and an enable flip-flop can admit four shifts, then hold the completed four-bit word.

#

8421 BCD
The 8421 BCD code represents each decimal digit separately using four bit weights of 8, 4, 2 and 1.
Decimal 42 uses BCD words 0100 and 0010, one word for each digit of the displayed number.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started