std_logic_vector'("0011100001111111") ??

Discussion in 'VHDL' started by guylewis, Nov 14, 2008.

  1. guylewis

    guylewis

    Joined:
    Nov 14, 2008
    Messages:
    3
    period_h_register <= std_logic_vector'("0000000000000001")??

    What does the aspostrophe mean between vector'(

    period_h_register <= std_logic_vector'("0000000000000001"):damnmate:


    Thanks for any help

    lewis
     
    Last edited: Nov 14, 2008
    guylewis, Nov 14, 2008
    #1
    1. Advertising

  2. guylewis

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    You will find the same structure with for instance

    if Clk'event and Clk='1' then .....

    if Rising_Edge(Clk) then .... -- alternative version

    I believe its same kind of type conversion between std_logic and std_ulogic but I never used it.

    Jeppe
     
    jeppe, Nov 15, 2008
    #2
    1. Advertising

  3. guylewis

    guylewis

    Joined:
    Nov 14, 2008
    Messages:
    3
    Thanks Jeppe

    Someone from another forum sent me this answer.

    "Qualified expressions" may be used to explicitly identify the type, and possibly the subtype, of an expression. Such qualification is a "hint" to the compiler, informing it as to the desired interpretation of the expression being qualified. Hence, such qualification is legal only if the expression can be legally interpreted as a value of the qualifying type. In contrast to type conversion, no information loss can occur.

    The syntax of a qualified expression is similar to the syntax of a type conversion. The difference is that a "tick" (the ''' character) is inserted between the type name and the parentheses surrounding the expression, as shown in the next example:

    -- note, both enumeration type declarations have some common
    -- enumeration items
    type color1 is (violet, blue, green, yellow, red);
    type color2 is (black, blue, green, red);

    -- this array type has an index type "color1". Without
    -- using type qualification this example will not compile
    -- because the compiler cannot determine the type
    -- of "blue" (might be "color1" or "color2").
    type a1 is array(color1'(blue) to color1'(red));

    -- this array type has an index type "color2". Without
    -- using type qualification this example will not compile
    type a2 is array(color2'(blue) to color2'(red));
     
    guylewis, Nov 15, 2008
    #3
  4. guylewis

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Thanks for question and answer - I learnt something new :)
     
    jeppe, Nov 16, 2008
    #4
    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. Jeremy Pyle
    Replies:
    3
    Views:
    52,745
    Mike Treseler
    Jun 28, 2003
  2. Mike
    Replies:
    3
    Views:
    3,062
    Mike Treseler
    Jul 9, 2003
  3. Willem Oosthuizen

    Array of std_logic_vector

    Willem Oosthuizen, Jul 9, 2003, in forum: VHDL
    Replies:
    3
    Views:
    35,592
    mathukutty
    Feb 26, 2010
  4. Pedro Claro

    character to std_logic_vector

    Pedro Claro, Jul 30, 2003, in forum: VHDL
    Replies:
    7
    Views:
    19,603
    Ruudiculus
    Oct 21, 2009
  5. Thomas Rouam
    Replies:
    6
    Views:
    1,134
Loading...

Share This Page