From deb7d0a6fc76d5250c238d479cf97d4755abef01 Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Sun, 12 May 2024 21:27:41 +0200 Subject: refactoring --- src/led_unit.v | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/led_unit.v (limited to 'src/led_unit.v') diff --git a/src/led_unit.v b/src/led_unit.v new file mode 100644 index 0000000..cfcbbdf --- /dev/null +++ b/src/led_unit.v @@ -0,0 +1,18 @@ +module led_unit ( + input clk, + input rst, + input we, + output reg [31:0] data_read, + input [31:0] data_write, + output [5:0] led_output +); + +assign led_output = ~data_read[5:0]; + +always @(posedge clk or posedge rst) begin + if (rst) data_read <= 32'b0; + else if (we) data_read <= data_write; + else data_read <= data_read; +end + +endmodule -- cgit v1.2.3