aboutsummaryrefslogtreecommitdiffstats
path: root/examples/gowin/demo.v
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gowin/demo.v')
-rw-r--r--examples/gowin/demo.v11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/gowin/demo.v b/examples/gowin/demo.v
new file mode 100644
index 000000000..e1a2f19ec
--- /dev/null
+++ b/examples/gowin/demo.v
@@ -0,0 +1,11 @@
+module demo (
+ input clk,
+ output led1, led2, led3, led4, led5, led6, led7, led8,
+ output led9, led10, led11, led12, led13, led14, led15, led16
+);
+ localparam PRESCALE = 20;
+ reg [PRESCALE+3:0] counter = 0;
+ always @(posedge clk) counter <= counter + 1;
+ assign {led1, led2, led3, led4, led5, led6, led7, led8,
+ led9, led10, led11, led12, led13, led14, led15, led16} = 1 << counter[PRESCALE +: 4];
+endmodule