empty array litteral

Discussion in 'VHDL' started by JR, Jul 13, 2011.

  1. JR

    JR Guest

    Hi all!

    According to std.standard:

    TYPE string IS ARRAY ( positive RANGE <> OF character);

    "hello" is a valid string litteral
    "" is a valid string litteral too, it is the empty string.


    Let

    TYPE foo IS ARRAY ( positive RANGE <> OF integer);

    (0, 1, 1, 2, 3, 5) is a valid foo litteral

    What is the litteral for an empty foo?

    Thx

    Julien
    JR, Jul 13, 2011
    #1
    1. Advertising

  2. JR

    Tricky Guest

    > Hi all!
    >
    > According to std.standard:
    >
    > TYPE string IS ARRAY ( positive RANGE <> OF character);
    >
    > "hello" is a valid string litteral
    > "" is a valid string litteral too, it is the empty string.
    >
    > Let
    >
    > TYPE foo IS ARRAY ( positive RANGE <> OF integer);
    >
    > (0, 1, 1, 2, 3, 5) is a valid foo litteral
    >
    > What is the litteral for an empty foo?
    >
    > Thx
    >
    > Julien

    That is an interesting question.

    You can make a null constant like this:

    constant NULL_FOO : foo(1 downto 2) := (others => 0);

    then use the constant in place of a literal.
    Tricky, Jul 13, 2011
    #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. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,009
    Klaus Johannes Rusch
    Jul 16, 2003
  2. Lukas
    Replies:
    3
    Views:
    782
    spiff
    Nov 10, 2005
  3. Smokey Grindle

    cant rename a litteral in IDE?

    Smokey Grindle, Jun 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    323
    Smokey Grindle
    Jun 20, 2006
  4. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    562
    Dave Thompson
    Feb 14, 2004
  5. Brian Roberts

    empty lists vs empty generators

    Brian Roberts, May 3, 2005, in forum: Python
    Replies:
    12
    Views:
    640
    Jeremy Bowers
    May 4, 2005
Loading...

Share This Page