signal <= (others => '0')

Discussion in 'VHDL' started by Pasacco, Apr 18, 2005.

  1. Pasacco

    Pasacco Guest

    dear

    It is for me unclear to understand differences between the following

    signal <= '00000000'; # assuming 8 bit signal
    signal <= (others => '0';
    signal <= (others => (others => '0'));

    GIMY, but so far unsuccesful to find --:

    Could anyone comment for this?
    Thankyou in advance
     
    Pasacco, Apr 18, 2005
    #1
    1. Advertising

  2. Pasacco wrote:

    > dear
    >
    > It is for me unclear to understand differences between the following
    >
    > signal <= '00000000'; # assuming 8 bit signal
    > signal <= (others => '0';
    > signal <= (others => (others => '0'));
    >
    > GIMY, but so far unsuccesful to find --:
    >
    > Could anyone comment for this?
    > Thankyou in advance
    >

    Well they have something in common - all of them are incorrect.
    First of all, signal is a keyword and cannot be used as identifier so
    in the following I will use s instead of signal.

    s <= '00000000'; -- is erroneous because of use ' instead of "
    s <= (others => '0'; -- is missing a closing )
    s <= (others => (others => '0')); -- is illegal for a vector
    -- (2 dimensional array required)

    Use of others in aggregate makes your code generic. Thus you won't have
    to replace all "00000000" with "00" when you change your mind and
    vectors should be only 2 bits wide.
    The last variant is even more powerful. If you take for example 128x8
    variable and you want to initialize it to all 0s you will spend a while
    typing the initializer.

    EG
     
    Engineering Guy, Apr 18, 2005
    #2
    1. Advertising

  3. Pasacco

    Pasacco Guest

    clear

    thankyou
     
    Pasacco, Apr 18, 2005
    #3
  4. Pasacco

    aaaaaa Guest

    case 1 : "00000000" is an assignment to a 8 bit signal . In this type of
    assignment you have to assign all the bits.
    Case 2 : In this type of assignment all the bits of signal will be
    assigned '0' .
    case 3 : this type of assignment is used in two dimentional array
    assignments .

    I think it is helpful.
     
    aaaaaa, Apr 19, 2005
    #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. Michael Pronath
    Replies:
    1
    Views:
    1,243
    Diez B. Roggisch
    Jan 3, 2005
  2. Jack Orenstein

    threading.Thread vs. signal.signal

    Jack Orenstein, Sep 18, 2005, in forum: Python
    Replies:
    0
    Views:
    504
    Jack Orenstein
    Sep 18, 2005
  3. Weng Tianxiang
    Replies:
    2
    Views:
    690
    Jonathan Bromley
    Jan 30, 2007
  4. Nicolas Moreau
    Replies:
    9
    Views:
    3,371
  5. Travis
    Replies:
    3
    Views:
    420
Loading...

Share This Page