quick.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

   

space.gif

   

space.gif

  ../images/main/bulllet_4dots_orange.gif repeat

The repeat loop executes < statement > a fixed < number > of times.

   

space.gif

Syntax:

   

space.gif

repeat (expression) statement
   

space.gif

   

space.gif

  ../images/main/bullet_star_pink.gif Example : repeat
   

space.gif


  1 program case_statement {
  2   integer i = 2;
  3   repeat (3) {
  4     do_case(i);
  5     i --;
  6   }
  7 }
  8 
  9 task do_case(bit [1:0] sel) {
 10   case(sel) {
 11      0  : printf("Nothing is selected\n");
 12      1  : {
 13             printf("something is selected\n");
 14             printf("This is multi statment example\n");
 15           }
 16      default : { 
 17             printf("Default is selected\n");
 18                }
 19   } // case (sel)
 20 }
You could download file repeat_statement.vr here
   

space.gif

  ../images/main/bullet_star_pink.gif Simulation : repeat
   

space.gif

 Default is selected
 something is selected
 This is multi statment example
 Nothing is selected
   

space.gif

   

space.gif

   

space.gif

   

space.gif

space2.gif

space2.gif

space2.gif

space2.gif

space2.gif

  

Copyright © 1998-2014

Deepak Kumar Tala - All rights reserved

Do you have any Comment? mail me at:deepak@asic-world.com