diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
commit | deb7d0a6fc76d5250c238d479cf97d4755abef01 (patch) | |
tree | 395c266ff4757e83e151d1286d6d2388e63d9a9c /src/led_unit.v | |
parent | 008059fbe4e960a10bb4c444013129e0aaa02818 (diff) | |
download | riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.tar.gz riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.zip |
refactoring
Diffstat (limited to 'src/led_unit.v')
-rw-r--r-- | src/led_unit.v | 18 |
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 |