moonnightingale
Full Member level 6
I have written a code which i have implemented in Spatran 3E kit. The program glows the LEDs of kit in sequenceform when i select the DIP switch. I mean first of all, first LED glows, then first two ,then first three and so on.
What all i want is that when i select second DIP switch, what so ever numbering is going to Diaplay LED, it should Halt and when i select, it continues from there.
Just like concept of stop watch. e.g if at this instance 4 LEDs are glowing and if i selcet switch, the four LEDs keep glowing and sequence is stopped till i deselect it and then it will continue from 5 onwards.any suggestions.
---------- Post added at 20:45 ---------- Previous post was at 18:56 ----------
This is the one portion of my code in which LEDs are glowing after one second and give symbol for binary 1 2 3 .....
Now what i want is that i want to add one more option "STOP" . That whenever Slide Switch STOP is made to high, the LED numbering should stop there till the time i make "STOP" Low again.
Kindly help me
My code is not that good as i am new in this field but i have made clock in FPGA kit and now i am trying to make stop watch for which i am stuck up with STOP portion Thanks
if (select==1'b1 && go==1'b1 && sec==0)
begin
cnt=0;
cnt2=0;
cnt3=cnt3+1;
if (cnt3[40:0]==40'd5)
begin
zero=1'b1;
one=1'b0;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd50000000)
begin
zero=1'b0;
one=1'b1;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd100000000)
begin
zero=1'b1;
one=1'b1;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd150000000)
begin
zero=1'b0;
one=1'b0;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd200000000)
begin
zero=1'b1;
one=1'b0;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd250000000)
begin
zero=1'b0;
one=1'b1;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd300000000)
begin
zero=1'b1;
one=1'b1;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd350000000)
begin
zero=1'b0;
one=1'b0;
two=1'b0;
three=1'b1;
six=1'b0;
end
if (cnt3[40:0]==40'd400000000)
begin
zero=1'b1;
one=1'b0;
two=1'b0;
three=1'b1;
six=1'b0;
end
What all i want is that when i select second DIP switch, what so ever numbering is going to Diaplay LED, it should Halt and when i select, it continues from there.
Just like concept of stop watch. e.g if at this instance 4 LEDs are glowing and if i selcet switch, the four LEDs keep glowing and sequence is stopped till i deselect it and then it will continue from 5 onwards.any suggestions.
---------- Post added at 20:45 ---------- Previous post was at 18:56 ----------
This is the one portion of my code in which LEDs are glowing after one second and give symbol for binary 1 2 3 .....
Now what i want is that i want to add one more option "STOP" . That whenever Slide Switch STOP is made to high, the LED numbering should stop there till the time i make "STOP" Low again.
Kindly help me
My code is not that good as i am new in this field but i have made clock in FPGA kit and now i am trying to make stop watch for which i am stuck up with STOP portion Thanks
if (select==1'b1 && go==1'b1 && sec==0)
begin
cnt=0;
cnt2=0;
cnt3=cnt3+1;
if (cnt3[40:0]==40'd5)
begin
zero=1'b1;
one=1'b0;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd50000000)
begin
zero=1'b0;
one=1'b1;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd100000000)
begin
zero=1'b1;
one=1'b1;
two=1'b0;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd150000000)
begin
zero=1'b0;
one=1'b0;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd200000000)
begin
zero=1'b1;
one=1'b0;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd250000000)
begin
zero=1'b0;
one=1'b1;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd300000000)
begin
zero=1'b1;
one=1'b1;
two=1'b1;
three=1'b0;
six=1'b0;
end
if (cnt3[40:0]==40'd350000000)
begin
zero=1'b0;
one=1'b0;
two=1'b0;
three=1'b1;
six=1'b0;
end
if (cnt3[40:0]==40'd400000000)
begin
zero=1'b1;
one=1'b0;
two=1'b0;
three=1'b1;
six=1'b0;
end