From f7cb6e8e07c9b314e5052c4b0416db422dbdeb7b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 8 Dec 2015 12:54:20 +0100 Subject: Added icestick and hx8kboard examples --- examples/hx8kboard/example.v | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/hx8kboard/example.v (limited to 'examples/hx8kboard/example.v') diff --git a/examples/hx8kboard/example.v b/examples/hx8kboard/example.v new file mode 100644 index 0000000..9fc5a11 --- /dev/null +++ b/examples/hx8kboard/example.v @@ -0,0 +1,25 @@ +module top ( + input clk, + output LED0, + output LED1, + output LED2, + output LED3, + output LED4, + output LED5, + output LED6, + output LED7 +); + + localparam BITS = 8; + localparam LOG2DELAY = 22; + + reg [BITS+LOG2DELAY-1:0] counter = 0; + reg [BITS-1:0] outcnt; + + always@(posedge clk) begin + counter <= counter + 1; + outcnt <= counter >> LOG2DELAY; + end + + assign {LED0, LED1, LED2, LED3, LED4, LED5, LED6, LED7} = outcnt ^ (outcnt >> 1); +endmodule -- cgit v1.2.3