VerLearn
Newbie level 5
I have a question where I need to stay for certain amount of time looping in the code. I'm facing the problem of applying the clock to the circuit.
Example:
module
................ ................
always@(posedge clk) begin
case()
s0: begin
...................
for(i=0;i<100;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<20;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<100;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<20;i=i+1) begin
...................................
end
endcase
end
endmodule
For the above circuit, how do I provide synchronous clock?
1. I should execute my first loop for exactly 100 times and display the output.
2. I should execute my second loop for exactly 20 times and display the output.
3. I should execute my third loop for exactly 100 times and display the output.
4. I should execute my fourth loop for exactly 20 times and display the output.
Please help, thanks in advance.
Example:
module
................ ................
always@(posedge clk) begin
case()
s0: begin
...................
for(i=0;i<100;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<20;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<100;i=i+1) begin
.................. ..................
end
s0: begin
...................
for(i=0;i<20;i=i+1) begin
...................................
end
endcase
end
endmodule
For the above circuit, how do I provide synchronous clock?
1. I should execute my first loop for exactly 100 times and display the output.
2. I should execute my second loop for exactly 20 times and display the output.
3. I should execute my third loop for exactly 100 times and display the output.
4. I should execute my fourth loop for exactly 20 times and display the output.
Please help, thanks in advance.