Last active
September 10, 2026 13:21
-
-
Save mit41301/5b3864f9991fb1162d7151cc1ce23d78 to your computer and use it in GitHub Desktop.
Verilog Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module countpro(sys_clk,led); | |
| input sys_clk; | |
| output [3:0] led; | |
| reg [25:0] count; | |
| reg [2:0] led; | |
| always @(posedge sys_clk) | |
| begin | |
| count <= count + 1; | |
| if( count == 26'b11_1111_1111_1111_1111_1111_1110 ) | |
| begin | |
| led <= ~led; | |
| end | |
| else | |
| led <= led; | |
| end | |
| endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment