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 String

Strings are character data types that have a set of predefined methods associated with them for manipulating characters. (See the section entitled ""String Methods" on page 12-51" for a description of these methods).

   

space.gif

Syntax string variable_name [=initial_value]; variable_name

   

space.gif

Specifies the initial value for the declared variable. If this specification is omitted, the initial value of the declared variable is null.

   

space.gif

As in Verilog, Vera permits strings to be assigned to integers. Strings greater than 32-bits are truncated. Integers, however, cannot be assigned to strings.

   

space.gif

   

space.gif

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

space.gif


  1 program string_t {
  2   // Declare
  3   string i;
  4   // Declare and init value
  5   string j = "This is sample string";
  6   // Declare multiple and assign
  7   integer m,n,o,p = "Guess this";
  8   // Print all the values
  9   printf("value of i %s\n",i);
 10   printf("value of j %s\n",j);
 11   printf("value of m %s\n",m);
 12   printf("value of n %s\n",n);
 13   printf("value of o %s\n",o);
 14   printf("value of p %s\n",p);
 15 
 16 }
You could download file string_t.vr here
   

space.gif

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

space.gif

 value of i 
 value of j This is sample string
 value of m     
 value of n     
 value of o     
 value of p this
   

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