blob: 5fe458feab2634742e5ae1d2f32eb3e7976c0a0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
`timescale 1us/1us
//
// NON-WORKING
// LED toggle example
// probably because LED is controlled by two blocks
//
module led_toggle_nonwork(
input clk_i,
input key_i,
input rst_i,
output reg [5:0] led
);
always @(negedge rst_i) begin
if (!rst_i)
led <= 6'b111111;
end
always @(negedge key_i) begin
if (!key_i)
led[0] <= ~led[0];
end
endmodule
|