Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module LED(
- input [2:0] hl ,
- input hl1,
- input [2:0] id,
- input clk_50,
- output r1,
- output g2,
- output b3
- );
- reg R1=0;
- reg G2=0;
- reg B3=0;
- reg HL = 3'b000;
- always @ (posedge clk_50)
- if(HL == 7)
- begin
- R1 =0 ;
- G2 = 0;
- B3 = 0;
- HL = 0;
- end
- else
- begin
- if (id == 1)
- begin
- R1 = 1;
- HL = HL + 1;
- end
- else
- if (id == 2)
- begin
- G2 = 1;
- HL = HL + 1;;
- end
- if (id == 3)
- begin
- B3 = 1;
- HL = HL + 1;
- end
- end
- assign r1= R1;
- assign g2= G2;
- assign b3= B3;
- assign hl = HL;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement