Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module FrequencyDivider(
- input clk_in,
- input rst,
- output reg clk_out
- );
- reg [4:0] counter;
- always @(posedge clk_in or negedge rst) begin
- if (!rst) begin
- counter <= 0;
- clk_out <= 0;
- end else begin
- if (counter == 9) begin
- counter <= 0;
- clk_out <= ~clk_out;
- end else begin
- counter <= counter + 1;
- end
- end
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement