Forum Discussion
assn1
New Contributor
4 years agoI need help with coding...
I'm making a digital watch code. There is no problem with the code itself, but as I input things like BUTTON_SW and BUS_SW, I didn't have enough buttons in my kit to run the hour, minute, second, an...
assn1
New Contributor
4 years agoYou're right. I also want to take care of it on my own, but... It was so hard. Sorry.
I want to try as you said, so should I remove the DIP, and move the code corresponding to the hour, minute, and second using the case(BUTTON_SW) Like this?
always @(posedge CLK_100HZ or negedge RESETN)
begin
if (~RESETN)
BUTTON_SW <= 1'b0;
else begin
case(BUTTON_SW)
0 : BUTTON_SW = hour10_up_in;
1 : BUTTON_SW = hour1_up_in;
.
.
.