Created
December 20, 2020 13:12
-
-
Save mkvenkit/7322460f199b626be2a9d2e2290c5f0a to your computer and use it in GitHub Desktop.
rain88.v
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
| always @ (posedge clk) | |
| begin | |
| if (!resetn) | |
| begin | |
| // reset counters | |
| refresh_counter <= 0; | |
| // initialise grid | |
| grid[0:7] <= 8'b01010101; | |
| grid[8:15] <= 8'b10101010; | |
| grid[16:23] <= 8'b01010101; | |
| grid[24:31] <= 8'b10101010; | |
| grid[32:39] <= 8'b01010101; | |
| grid[40:47] <= 8'b10101010; | |
| grid[48:55] <= 8'b01010101; | |
| grid[56:63] <= 8'b10101010; | |
| end | |
| // update refresh counter | |
| refresh_counter <= refresh_counter + 1; | |
| // update frame | |
| if (!refresh_counter) | |
| begin | |
| grid <= ~grid; | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment