EIE4-FYP/rtl/flipPwm.sv
Aadi Desai 81cf1ebc5c
Replace assign with always_comb in rtl/
Update to better match IEEE1800-2017
2023-05-18 12:01:56 +01:00

21 lines
379 B
Systemverilog

`default_nettype none
module flipPwm
( input var clk
, input var [23:0] rgb
, output var ledr
, output var ledg
, output var ledb
);
logic [7:0] counter;
always_ff @(posedge clk)
counter <= counter + 1;
always_comb ledr = (rgb[23:16] > counter);
always_comb ledg = (rgb[15: 8] > counter);
always_comb ledb = (rgb[ 7: 0] > counter);
endmodule