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 Register

Registers are unsigned variables with the value 0, 1, z, or x.

   

space.gif

Syntax reg variable_name [=initial_value];

   

space.gif

Specifies the initial value for the declared variable. If this specification is omitted, the initial value of the declared variable is x (unknown).

   

space.gif

   

space.gif

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

space.gif


  1 program reg_t {
  2   // Declare
  3   reg i;
  4   // Declare and init value
  5   reg [7:0] j = 8'b10xZ_01zX;
  6   // Declare multiple and assign
  7   reg [7:0] m,n,o,p = 100;
  8   // Print all the values
  9   printf("value of i %b\n",i);
 10   printf("value of j %b\n",j);
 11   printf("value of m %b\n",m);
 12   printf("value of n %b\n",n);
 13   printf("value of o %b\n",o);
 14   printf("value of p %b\n",p);
 15 
 16 }
You could download file reg_t.vr here
   

space.gif

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

space.gif

 value of i x
 value of j 10xz01zx
 value of m xxxxxxxx
 value of n xxxxxxxx
 value of o xxxxxxxx
 value of p 01100100
   

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