pranavm1502
Newbie level 6
This code was implemented on a CPLD but it is not working. Please help!
// This code should show the position of the push-button pressed by glowing appropriate leds.
// This code should show the position of the push-button pressed by glowing appropriate leds.
Code Verilog - [expand] 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 27 module hex(col,row,led); output reg [3:0]row,led; input [3:0] col; integer r,c,val; always@(col ) begin //row=1; led=0; r=3; //while (col); while(r>=0) begin row=4'b0000; row[r]=1; for(c=0; c<4;c=c+1) begin val=col[c]; if(val==1) begin led= 4*(r) +c+1; end end r=r-1; end end endmodule
Last edited by a moderator: