Clock cycle 2026-10-31
One complete repetition of a periodic clock signal, for example from one rising clock edge to the next. Its duration is the clock period. A synchronous sequential circuit can update its stored state once per designated clock edge; a one-cycle output pulse remains asserted for one such interval.
Clock frequency 2026-11-05
Clock frequency is the number of cycles of a clock signal per unit time. If its period is , its frequency is . A hertz clock has a nominal period of about seconds. The clock coordinates timed operations; it does not specify how many complete program instructions are performed in each cycle.
For a fixed-frequency processor, execution time can be written as instruction count times average cycles per instruction divided by frequency. Raising frequency can improve that component of runtime, but it may also require a different pipeline organization or increase power and thermal constraints. Memory waits and dependencies can leave some cycles without completed instructions, while superscalar execution can complete several instructions in one cycle. Performance comparisons must therefore include the workload and microarchitecture, not only the clock rating.
Clock period 2026-10-31
The time between equivalent clock edges in consecutive cycles of a periodic clock signal. It is the reciprocal of the clock's frequency.
Electronic dice 2026-10-31
An electronic display cycling through the six die faces while a switch is pressed. A modulo-six counter and combinational logic can drive seven lights arranged as die pips. The apparent unpredictability comes from uncertainty in release timing relative to a rapid clock signal; deterministic cycling alone does not establish equal outcome probabilities.
Hardware timer Created 2026-10-25 Updated 2026-10-31
A hardware timer uses a clock signal to measure intervals, commonly by a digital counter with capture or comparison facilities. A comparison event can request an interrupt or change an output directly. Counter resolution, wraparound, interrupt latency and the hardware's comparison semantics determine the timing guarantees available to software.
A fully synchronous sequential circuit has all its state stored in edge-triggered elements driven by a common clock signal, with combinational logic computing the next state from the current state and inputs. State updates occur together at the designated clock edges, rather than letting one register output serve as another register's ripple clock. Its ideal equations are
For a Moore machine the output function depends only on the state, . Physical design must leave enough time for register-to-register combinational paths and satisfy setup time and hold time at every receiving storage element.
A D flip-flop stores one bit. At its specified active clock edge, it samples and, after its clock-to-Q delay, makes equal to that sampled value. Between active clock edges it retains the stored value. The input must meet the setup and hold time requirements around the sampling edge; a level-sensitive latch would have different behavior.
For a finite-state sequential circuit, encode the present state in a bank of D flip-flops. Feed their outputs and the external inputs to combinational logic computing the next-state function , and connect those outputs to the flip-flop inputs. A common clock signal then performs the simultaneous update
Output combinational logic computes for a Moore machine or for a Mealy machine. Since any finite next-state and output table is a Boolean function, it has a Boolean circuit implementation. Initialization specifies the starting state, and unused state encodings require either a recovery rule or an initialization assumption. The clock period must accommodate propagation through the D flip-flops and intervening combinational logic before the next sampling edge.
A particularly transparent design uses six D flip-flops in a one-hot encoding. Let mean that face is displayed. Initialize and , and wire the next-state inputs as a ring:
All six D flip-flops share the same active clock edge. Each pulse moves the single stored to the next position, giving the state-transition diagram cycle . The representation invariant “exactly one is high” holds after initialization and is preserved by rotation. Six D flip-flops are more than the three-bit theoretical minimum, but their simple wiring gives a complete implementation without requiring that minimum.
Figure 1.
One-hot ring state register and the six lamp patterns, including the original opposite diagonals on faces 2 and 3
. Details.
Decode the seven lamps by their positions, with denoting top, middle and bottom, and denoting left and right. Let be the center lamp. In the original figure, face 2 uses top-left and bottom-right, while face 3 uses top-right and bottom-left plus center; the two diagonals must therefore have different controls.[ref] The required OR gate decoder is
For example, only the center is high in state , the first diagonal is high in state , and in state both outer columns are high while the center is low. This verifies all six layouts directly.
To implement the switch behavior, use a rapid common clock signal and a sampled enable , high while the switch is pressed. Each next-state input is then selected between its advancing value and its own stored value:
One multiplexer per D flip-flop implements that selection. While enabled the electronic dice advances; otherwise every D flip-flop reloads its own value and the display holds. The enable supplied to this synchronous design must be stable at sampling edges. A reset or preset facility must establish the specified one-hot initial state: an all-zero ring does not start itself.
With a rapid clock signal, uncertainty in human release timing makes the final face practically unpredictable. The sequential circuit itself is deterministic; this observation alone is not a proof that its six outcomes have equal probabilities.
A serial-in parallel-out shift register is a chain of digital registers driven by the same clock signal. At each active clock edge, the first stage captures the input and every later stage captures the preceding stage's old value. Its parallel outputs expose the successive delayed samples simultaneously.
Let be the current sample and, immediately before its sampling edge, let . Feed these signals to combinational logic implementing . Then
Only stored history stages are needed if the current input is used directly. Alternatively, a -stage shift register exposes all samples after the edge. A separate output digital register can capture the first arrangement at the edge, giving a fully sampled output. Initialize the history, or regard the first cycles as a filling interval.
Use three positive-edge-triggered D flip-flops, all driven by the same clock signal . Write the current binary representation as , with the least significant bit. The next state is the current value plus one when and minus one when , in each case modulo eight. A bit toggles under exclusive or with a one.
For upward counting, toggles when , while toggles when , the respective carry conditions. For downward counting the corresponding borrow conditions are and . Define the shared inverted direction and the two direction-match signals
Each is one exactly when : it equals for upward counting and for downward counting. Thus the Boolean functions for the three D inputs are
Implement this with two NOT gates for , four two-input exclusive or gates for , and one two-input AND gate. Connect to the D flip-flop whose output is ; feed the three outputs back into the indicated gates. All three flip-flops capture simultaneously, so each equation uses the old state.
Figure 1.
Synchronous three-bit up-down binary counter: common clock signal, explicit D inputs and feedback
. Details.
Current Next for Next for
000001111
001010000
010011001
011100010
100101011
101110100
110111101
111000110
Every three-bit state is valid. A reset may initialize the binary counter to zero if required; counting itself needs no extra state. The direction input must meet the setup time and hold time requirements at the active clock edge.
Use a synchronous binary counter with three positive-edge-triggered D flip-flops, all driven by the same clock signal. Write their outputs , with the least significant bit. The next-state Boolean functions are
Implement these with one NOT gate, two exclusive or gates, and one AND gate. Connect each to its corresponding D flip-flop; its output is address line . A reset input clears all three flip-flops to zero, so the first selected sensor is sensor zero.
The state sequence is
The low bit toggles at every clock edge, the middle bit toggles exactly when the old low bit is one, and the high bit toggles exactly when both old lower bits are one. These are precisely the carry conditions for incrementing a three-bit binary representation. Every possible state belongs to the cycle, so there is no unused state requiring recovery. Choose a clock period allowing the combinational logic to settle before the next capture.
Processor clock period 2026-10-24
The interval between successive designated clock edges of a processor's clock signal. In a synchronous sequential circuit it must be long enough for the required register-to-register propagation and setup timing.