Tuesday, July 29, 2008

How many times does the "for" loop gets executed

Hi all,

How many times does the for loop gets executed in the following verilog code

reg [3:0] loop ;

for ( loop = 0 ; loop <= 15 ; loop = loop + 1 )
begin
$display("Inside the loop for the %d time",loop);
end

2 comments:

Pradeep V said...

Infinite, since the condition to come out of the loop ( loop > 16 )would never happen

R Naresh said...

nee yankamma orey. ....
Naa peru thesesthava ....
Ippudu bagundi blog ...
Anyways my answer is 16 times.