aboutsummaryrefslogtreecommitdiffstats
path: root/examples/igloo2/example.v
diff options
context:
space:
mode:
Diffstat (limited to 'examples/igloo2/example.v')
-rw-r--r--examples/igloo2/example.v23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/igloo2/example.v b/examples/igloo2/example.v
new file mode 100644
index 000000000..1a1967d5a
--- /dev/null
+++ b/examples/igloo2/example.v
@@ -0,0 +1,23 @@
+module example (
+ input clk,
+ input EN,
+ output LED1,
+ output LED2,
+ output LED3,
+ output LED4,
+ output LED5
+);
+
+ localparam BITS = 5;
+ localparam LOG2DELAY = 22;
+
+ reg [BITS+LOG2DELAY-1:0] counter = 0;
+ reg [BITS-1:0] outcnt;
+
+ always @(posedge clk) begin
+ counter <= counter + EN;
+ outcnt <= counter >> LOG2DELAY;
+ end
+
+ assign {LED1, LED2, LED3, LED4, LED5} = outcnt ^ (outcnt >> 1);
+endmodule