vector assignment in VHDL

Discussion in 'VHDL' started by Vadim Rusu, Jun 18, 2004.

  1. Vadim Rusu

    Vadim Rusu Guest

    Hi,

    I am trying to have a std_logic_vector which I want to define based on a
    variable. In other words, say I have the vector V(31 downto 0) and I
    only use RAM_SIZE bits. The rest of the vector I want to assign to 0. Is
    there any way I can do this? So instead of having

    V(31-RAM_SIZE downto 0)= "0000000000000"

    I want something more elegant, like:

    V(31-RAM_SIZE downto 0) = (32-RAM_SIZE) "0"

    Is this doable in vhdl?


    Thanks,
    Vadim
     
    Vadim Rusu, Jun 18, 2004
    #1
    1. Advertising

  2. Vadim Rusu

    Symon Guest

    V(31-RAM_SIZE downto 0) <= (others => '0');
    Syms.
     
    Symon, Jun 18, 2004
    #2
    1. Advertising

  3. Vadim Rusu

    ZOLVEZ

    Joined:
    Oct 2, 2007
    Messages:
    8
    help

    hi

    I wonder if you could help me please

    I want to discard bits of a signal of type std_logic_vector
    for instance:

    port (a, b : in std_logic_vector (15 downto 0)
    c : out std_logic_vector (7 downto 0));

    architecture a of xxx is
    signal tmp : std_logic_vector (15 downto 0);

    begin
    tmp<= a and b;
    c<= tmp (11 downto 4); ---that's I want to do

    It means I want to use only some bits of tmp. I'm using ISE of XILINX
    and it doesn't sinthesize it so I'd like to know another way please

    thanks
     
    ZOLVEZ, Oct 2, 2007
    #3
  4. Vadim Rusu

    ZOLVEZ

    Joined:
    Oct 2, 2007
    Messages:
    8
    help

    hi

    I wonder if you could help me please

    I want to discard bits of a signal of type std_logic_vector
    for instance:

    port (a, b : in std_logic_vector (15 downto 0)
    c : out std_logic_vector (7 downto 0));

    architecture a of xxx is
    signal tmp : std_logic_vector (15 downto 0);

    begin
    tmp<= a and b;
    c<= tmp (11 downto 4); ---that's I want to do

    It means I want to use only some bits of tmp. I'm using ISE of XILINX
    and it doesn't sinthesize it so I'd like to know another way please. Any suggestion to ZOLVEZ@hotm... thanks a lot before hand

    thanks
     
    ZOLVEZ, Oct 2, 2007
    #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. zhou
    Replies:
    9
    Views:
    482
    Andrey Tarasevich
    Sep 2, 2003
  2. pmatos
    Replies:
    6
    Views:
    24,120
  3. falcon734

    VHDL Vector Assignment

    falcon734, Oct 26, 2006, in forum: VHDL
    Replies:
    0
    Views:
    1,151
    falcon734
    Oct 26, 2006
  4. Replies:
    8
    Views:
    1,998
    Csaba
    Feb 18, 2006
  5. Javier
    Replies:
    2
    Views:
    621
    James Kanze
    Sep 4, 2007
Loading...

Share This Page