Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ740
Page ↗
Q740DesignQualcommASIC interview problem

Generate a Divide-by-2.5 Fractional Tick Sequence

TechniquesDesignClocking
DifficultyHard
TopicTiming
LanguageSystemVerilog
Requirements4 checkpoints
01

Problem

A scheduling block needs a one-source-cycle enable pulse at an average divide ratio of 2.5. It may alternate integer intervals of two and three enabled source cycles. This is an enable sequence, not a clock-tree output. Implement the alternating-period divider and quantify its average frequency and deterministic timing error.

Module declarationSystemVerilog
module div2p5_tick(input logic clk,rst_n,en, output logic tick);
// interval sequence after reset: 2,3,2,3,... enabled edges
// tick width: one clk cycle; en=0 freezes interval state and counter
// first tick occurs on enabled edge 2

Example input and output

Use this case to check your interpretation
Input
Case 1: Hold en high continuously
Case 2: Observe the first four tick intervals
Case 3: After enabled edge 3, hold en low for four source-clock cycles, then resume enabled edges
Output
Case 1: tick occurs on enabled edges 2,5,7,10,12,15,...
Case 2: the intervals are 2,3,2,3 edges; their average is (2+3+2+3)/4 = 2.5
Case 3: the next tick remains due on the second later enabled edge, enabled edge 5 of the sequence
Explanation

The shown result follows by applying this rule: The state machine produces the exact 2,3 alternating interval sequence and one-cycle tick pulses. The cases also demonstrate this requirement: Relative to ideal uniformly spaced 2.5-edge events, actual intervals are -0.5 and +0.5 source cycles; report this deterministic period jitter and do not claim a stable 50% clock duty cycle.

02

Requirements (4)

  • Reset selects a two-edge first interval, clears the interval counter, and clears tick. Disabled cycles freeze the counter and 2/3 selector and force tick low.
  • Pulse on the last enabled edge of the current interval, reload the counter, and alternate the next interval between three and two enabled edges.
  • Over every pair of intervals, exactly two ticks occur in five enabled edges, so the long-term tick rate is `fclk/2.5`.
  • Relative to ideal uniformly spaced 2.5-edge events, actual intervals are -0.5 and +0.5 source cycles; report this deterministic period jitter and do not claim a stable 50% clock duty cycle.