Apr 18, 2017 #1 V viyaaloth Junior Member level 3 Joined Jul 15, 2016 Messages 25 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Location India Activity points 211 Hi ALL, I need a clarification regarding frequency divider using counter. Usually, If a counter with N bits, it will divide the frequency by 2^N. Code Verilog - [expand]1 2 3 4 5 6 7 8 9 10 11 12 reg [19:0] counter; always@(posedge clk) // clock frequency is 100MHZ begin if(!reset_n) counter <= 0; else begin counter <= counter + 1'b1; clock <= counter[16]; end end From the above snippet, what will be the frequency of "clock" Last edited by a moderator: Apr 18, 2017
Hi ALL, I need a clarification regarding frequency divider using counter. Usually, If a counter with N bits, it will divide the frequency by 2^N. Code Verilog - [expand]1 2 3 4 5 6 7 8 9 10 11 12 reg [19:0] counter; always@(posedge clk) // clock frequency is 100MHZ begin if(!reset_n) counter <= 0; else begin counter <= counter + 1'b1; clock <= counter[16]; end end From the above snippet, what will be the frequency of "clock"
Apr 18, 2017 #2 D dipin Full Member level 4 Joined Jul 16, 2014 Messages 223 Helped 14 Reputation 28 Reaction score 14 Trophy points 18 Activity points 1,731 viyaaloth said: Hi ALL, I need a clarification regarding frequency divider using counter. Usually, If a counter with N bits, it will divide the frequency by 2^N. reg [19:0] counter; always@(posedge clk) // clock frequency is 100MHZ begin if(!reset_n) counter <= 0; else begin counter <= counter + 1'b1; clock <= counter[16]; end end From the above snippet, what will be the frequency of "clock" Click to expand... hi approximately 763 Hz (accurately :: 762.93) regards
viyaaloth said: Hi ALL, I need a clarification regarding frequency divider using counter. Usually, If a counter with N bits, it will divide the frequency by 2^N. reg [19:0] counter; always@(posedge clk) // clock frequency is 100MHZ begin if(!reset_n) counter <= 0; else begin counter <= counter + 1'b1; clock <= counter[16]; end end From the above snippet, what will be the frequency of "clock" Click to expand... hi approximately 763 Hz (accurately :: 762.93) regards