summaryrefslogtreecommitdiff
path: root/led_toggle_nonwork.v
blob: a8e9b78dfd678d70f37fd8ac4695b8a1143d1b7c (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
// 
// 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