pmoonlite
Newbie level 4
- Joined
- Feb 20, 2015
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 39
I have a 25 MHz but need 10 MHz, will you please let me know how to write the verilog code for divide by 2.5. This is what I have done, but not sure if it will work. I have divide by 5 and multiple by 2.
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 always @(posedge CLK_OSC or posedge RST) if (RST) count<=0; else if (count == 3'd4) count<=0; else count <=count+1; assign clkA = count[1]; always@(negedge CLK_OSC ) clkB <= clkA; assign clk5_Mhz = clkA | clkB; assign clk10_Mhz = clk5_Mhz <<1;
Last edited by a moderator: