summaryrefslogtreecommitdiff
path: root/playground/led.v
diff options
context:
space:
mode:
authoruvok2026-01-09 15:18:23 +0100
committeruvok2026-01-09 15:18:23 +0100
commit6c83fd8730e55de8b1daaac1deb111d3d9bd408e (patch)
tree33a3dbc4fd87011b657b193224c3f39c5de6b766 /playground/led.v
parent678cb2d2d752bbac7625ba9b287762b3acabf116 (diff)
move stuff around
Diffstat (limited to 'playground/led.v')
-rw-r--r--playground/led.v31
1 files changed, 31 insertions, 0 deletions
diff --git a/playground/led.v b/playground/led.v
new file mode 100644
index 0000000..e4f4281
--- /dev/null
+++ b/playground/led.v
@@ -0,0 +1,31 @@
+`timescale 1us/1us
+
+`include "clkdiv.v"
+
+module led (
+ input clk, // clk input
+ input rst_i, // reset input
+ output reg [5:0] led_o // 6 LEDS pin
+);
+
+reg half_sec_clock;
+
+clkdiv half_sec_divider(
+ .rst_i(rst_i),
+ .clk(clk),
+ .o_divclk(half_sec_clock)
+);
+
+always @(posedge half_sec_clock or negedge rst_i) begin
+ if (!rst_i)
+ led_o <= 6'b111111;
+ else
+// else if (counter == 24'd1349_9999) // 0.5s delay
+ led_o[5:0] <= led_o[5:0] - 1;
+// else
+// led_o <= led_o;
+end
+
+
+endmodule
+