Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Implement a divide-by-four clock model

Hardware interview practice

Implement a divide-by-four clock model

EasyRTL DesignSystemVerilog

For simulation or FPGA-style RTL, divide clk by four with a resettable two-bit counter. Also state the safe ASIC implementation rule for a generated clock.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Starting point

Question code

input logic clk, rst_n;
output logic clk_div4;
Reviewed example

Work through one case

Input
Counter starts at 00; apply four rising edges
Expected output
counter: 01,10,11,00; clk_div4: 0,1,1,0

The counter MSB completes one period for every four source-clock periods.

What to cover

Requirements

  1. Clear the two-bit counter with active-low asynchronous reset.
  2. Increment it on every rising edge while reset is inactive.
  3. Drive clk_div4 from counter bit 1 for a 50 percent steady-state duty cycle.
  4. For ASIC clock consumers, require an approved clock-generation primitive and generated-clock constraint.
asic.fyi · Learn silicon end to end.info@asic.fyi