Skip to content

Instantly share code, notes, and snippets.

@mkvenkit
Created December 20, 2020 13:12
Show Gist options
  • Select an option

  • Save mkvenkit/7322460f199b626be2a9d2e2290c5f0a to your computer and use it in GitHub Desktop.

Select an option

Save mkvenkit/7322460f199b626be2a9d2e2290c5f0a to your computer and use it in GitHub Desktop.
rain88.v
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