Divide by 3.5 clock divider
- Divide by 3 first and add the negedge flop in series to make divide by 3.5
A simple divide by 3 counter can be as as follows
=== Divide by 3 ===
always @ (posedge clk or negedge reset)
if (!reset) Q[1:0] <= 2'b0;
else Q[1:0] <= {Q[0], (!Q[1] & !Q[0])};
The above code is a sequence of 00, 01, 10, 00.
always @(negedge clk)
Q0_inv <= Q[0];
assign divide_by_3 = Q[0] | Q0_inv ;
====End of Divide by 3===
always @ (negedge clk)
divide_by_dot5 <= divide_by_3 ;
assign divide_by_3dot5 = divide_by_3 | divide_by_dot5;
===== End of Divide by 3.5====
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment