Frequency Divider by 3

Problem Description

Write a Verilog code for a frequency divider by 3. The duty cycle of the output clock should be 50%.

  • The circuit should have an input for the input clock and the output should be the clock frequency divided by "3".

  • On reset=0, the circuit should get initialized and the output should be 0.

Example:

rst=0 input_clk=0 output_clk=0
rst=0 input_clk=1 output_clk=0
rst=0 input_clk=0 output_clk=0
rst=1 input_clk=0 output_clk=0
rst=1 input_clk=1 output_clk=1
rst=1 input_clk=0 output_clk=1
rst=1 input_clk=1 output_clk=1

Verilog

Code Editor Access

Log in to write, run and submit your solution to this interview question. It's free.

Output

Output goes here...