Integer Literals

Discussion in 'VHDL' started by Tricky, Mar 28, 2008.

  1. Tricky

    Tricky Guest

    Is there a way of expressing integer literals in anything other than
    decimal, without doing overly complicated type conversions?
    Tricky, Mar 28, 2008
    #1
    1. Advertising

  2. Tricky

    KJ Guest

    On Mar 28, 11:42 am, Tricky <> wrote:
    > Is there a way of expressing integer literals in anything other than
    > decimal, without doing overly complicated type conversions?


    Here are a few ways to express the number 16

    16#10#
    2#10000#

    The number before the first # is the radix that you're using, the
    numbers between the two ## is the number you're trying to represent.

    KJ
    KJ, Mar 28, 2008
    #2
    1. Advertising

  3. Tricky

    Andy Guest

    On Mar 28, 11:02 am, KJ <> wrote:
    > On Mar 28, 11:42 am, Tricky <> wrote:
    >
    > > Is there a way of expressing integer literals in anything other than
    > > decimal, without doing overly complicated type conversions?

    >
    > Here are a few ways to express the number 16
    >
    > 16#10#
    > 2#10000#
    >
    > The number before the first # is the radix that you're using, the
    > numbers between the two ## is the number you're trying to represent.
    >
    > KJ


    KJ is correct. I might add that the radix is always expressed in
    decimal. It would be rather confusing (but simple to write!) to have
    the radix expressed in the same base as the number (always "10")

    Andy

    Andy
    Andy, Mar 31, 2008
    #3
  4. Andy wrote:

    > It would be rather confusing (but simple to write!) to have
    > the radix expressed in the same base as the number (always "10")


    Not to mention impossible to implement... think about it...

    Regards,

    --
    Mark McDougall, Engineer
    Virtual Logic Pty Ltd, <http://www.vl.com.au>
    21-25 King St, Rockdale, 2216
    Ph: +612-9599-3255 Fax: +612-9599-3266
    Mark McDougall, Apr 1, 2008
    #4
  5. Tricky

    Andy Guest

    On Mar 31, 6:37 pm, Mark McDougall <> wrote:
    > Andy wrote:
    > > It would be rather confusing (but simple to write!) to have
    > > the radix expressed in the same base as the number (always "10")

    >
    > Not to mention impossible to implement... think about it...
    >
    > Regards,
    >
    > --
    > Mark McDougall, Engineer
    > Virtual Logic Pty Ltd, <http://www.vl.com.au>
    > 21-25 King St, Rockdale, 2216
    > Ph: +612-9599-3255 Fax: +612-9599-3266


    That's what I meant by '(always "10")'

    Not all things simple to write are easy (or even possible) to
    implement.

    Andy
    Andy, Apr 7, 2008
    #5
    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. Purush
    Replies:
    4
    Views:
    1,591
    Purush Rudrakshala
    Apr 13, 2005
  2. John Goche
    Replies:
    8
    Views:
    16,411
  3. Bart Samwel
    Replies:
    14
    Views:
    785
    Bart Samwel
    Apr 22, 2005
  4. Integer Literals

    , Oct 18, 2006, in forum: C++
    Replies:
    5
    Views:
    433
  5. Ivan Novick

    negative integer literals

    Ivan Novick, Dec 10, 2006, in forum: C++
    Replies:
    15
    Views:
    649
    Steve Pope
    Dec 10, 2006
Loading...

Share This Page