Data type conversion

Discussion in 'VHDL' started by Stachu Chebel, Mar 12, 2013.

  1. Hi,
    Suppose I have 2 variables declared as follows:

    variable x:integer;
    variable t:time;

    How to convert 't' (measured in ps) into 'x' ?
    Stachu Chebel, Mar 12, 2013
    #1
    1. Advertising

  2. Stachu Chebel

    KJ Guest

    On Tuesday, March 12, 2013 8:48:43 AM UTC-4, Stachu Chebel wrote:
    > Hi, Suppose I have 2 variables declared as follows:
    > variable x:integer;
    > variable t:time;


    > How to convert 't' (measured in ps) into 'x' ?


    x := t / 1 ps; -- x will be the integer number of picoseconds
    x := t / 1 ns; -- x will be the integer number of nanoseconds
    x := t / 1 us; -- x will be the integer number of microseconds
    ....

    Kevin Jennings
    KJ, Mar 12, 2013
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. luna
    Replies:
    1
    Views:
    6,813
  2. ibiza
    Replies:
    2
    Views:
    5,344
    ibiza
    Jan 27, 2006
  3. Chris
    Replies:
    2
    Views:
    21,334
    Chris
    May 11, 2006
  4. Michal Nazarewicz

    conversion from const type* to type* allowed?

    Michal Nazarewicz, Jan 4, 2007, in forum: C Programming
    Replies:
    13
    Views:
    559
    Eric Sosman
    Jan 5, 2007
  5. Replies:
    1
    Views:
    445
    Sylvester Hesp
    May 16, 2007
Loading...

Share This Page