aboutsummaryrefslogtreecommitdiff
path: root/src/led_unit.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/led_unit.v')
-rw-r--r--src/led_unit.v18
1 files changed, 18 insertions, 0 deletions
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