yatta
Newbie level 2
Hi. I'm undertaking a project in school and i've been tasked to design a 9999 counter. I'm new to verilog and thus, i need some help regarding the counter.
I'm trying to use if-else and i'm stuck at this part:
if(counter<4'd10)
begin
digit1=counter;
end
else if (counter>=4'd10 && counter<4'd100)
begin
digit1=counter/4'd10;
digit2=counter%4'd10;
end
else if (counter>=4'd100 && counter<4'd1000)
begin
digit1=counter/4'd100;
i'm not exactly sure how to extract the 2nd digits if the numbers range from 100-999. your help would be much appreciated. Thanks![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I'm trying to use if-else and i'm stuck at this part:
if(counter<4'd10)
begin
digit1=counter;
end
else if (counter>=4'd10 && counter<4'd100)
begin
digit1=counter/4'd10;
digit2=counter%4'd10;
end
else if (counter>=4'd100 && counter<4'd1000)
begin
digit1=counter/4'd100;
i'm not exactly sure how to extract the 2nd digits if the numbers range from 100-999. your help would be much appreciated. Thanks