declaring real numbers (2^15-1) and (-2^15) in vhdl

Discussion in 'VHDL' started by hari, Apr 22, 2004.

  1. hari

    hari Guest

    hi
    i would like to know how to declare the numbers in vhdl.the numbers
    are
    (2^15-1) and (-2^15).

    when i declare it using the REAL modelsim returns a error saying it is
    out of range.how to overcome it
    thanks
    hari
     
    hari, Apr 22, 2004
    #1
    1. Advertising

  2. Here an example (no problem for Modelsim)
    constant rl : real := 2.0**15;

    (remember the right operand of the power function should be an integer; so
    do not write 15.0. When you use the IEEE package math_real you have more
    functions)

    Egbert Molenkamp

    "hari" <> wrote in message
    news:...
    > hi
    > i would like to know how to declare the numbers in vhdl.the numbers
    > are
    > (2^15-1) and (-2^15).
    >
    > when i declare it using the REAL modelsim returns a error saying it is
    > out of range.how to overcome it
    > thanks
    > hari
     
    Egbert Molenkamp, Apr 22, 2004
    #2
    1. Advertising

  3. constant i : integer:=2**15;
    works also.

    "Egbert Molenkamp" <> wrote in
    message news:c67sd7$7gn$...
    > Here an example (no problem for Modelsim)
    > constant rl : real := 2.0**15;
    >
    > (remember the right operand of the power function should be an

    integer; so
    > do not write 15.0. When you use the IEEE package math_real you have

    more
    > functions)
     
    Charles Bailey, May 12, 2004
    #3
    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. senthil
    Replies:
    5
    Views:
    1,438
    senthil
    Jan 24, 2004
  2. hari
    Replies:
    0
    Views:
    649
  3. hari
    Replies:
    2
    Views:
    9,225
    Ajeetha Kumari
    Apr 23, 2004
  4. Curious Trigger
    Replies:
    2
    Views:
    1,852
    Curious Trigger
    Sep 9, 2006
  5. canadianJaouk

    VHDL switch in real numbers

    canadianJaouk, Sep 28, 2006, in forum: VHDL
    Replies:
    9
    Views:
    2,980
    Paul Uiterlinden
    Oct 29, 2006
Loading...

Share This Page