how to convert integer to signal value

Discussion in 'VHDL' started by Guffi, Sep 13, 2007.

  1. Guffi

    Guffi Guest

    I have integer (in process) which I want to convert to signal
    (std_logic_vector) value. How to do this?

    WrAddr1<=PENum;
    WrAddr1:=PENum;

    doesn't work :(

    WrAddr1 - std_logic_vector
    PENum - integer
     
    Guffi, Sep 13, 2007
    #1
    1. Advertising

  2. Guffi wrote:
    > I have integer (in process) which I want to convert to signal
    > (std_logic_vector) value. How to do this?
    >
    > WrAddr1<=PENum;
    > WrAddr1:=PENum;
    >
    > doesn't work :(
    >
    > WrAddr1 - std_logic_vector
    > PENum - integer


    use on top:
    LIBRARY ieee;
    USE ieee.numeric_std.ALL;

    and in your code:
    WrAddr1 <= std_logic_vector( to_unsigned( PENum, WrAddr1'LENGTH ) );

    Regards,

    Pieter
     
    Pieter Hulshoff, Sep 13, 2007
    #2
    1. Advertising

  3. Guffi

    Guffi Guest

    Pieter Hulshoff pisze:
    > Guffi wrote:
    >> I have integer (in process) which I want to convert to signal
    >> (std_logic_vector) value. How to do this?
    >>
    >> WrAddr1<=PENum;
    >> WrAddr1:=PENum;
    >>
    >> doesn't work :(
    >>
    >> WrAddr1 - std_logic_vector
    >> PENum - integer

    >
    > use on top:
    > LIBRARY ieee;
    > USE ieee.numeric_std.ALL;
    >
    > and in your code:
    > WrAddr1 <= std_logic_vector( to_unsigned( PENum, WrAddr1'LENGTH ) );
    >
    > Regards,
    >
    > Pieter


    thanks a lot
     
    Guffi, Sep 13, 2007
    #3
    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. Frank van Eijkelenburg

    how to convert signal value to integer

    Frank van Eijkelenburg, Jul 24, 2003, in forum: VHDL
    Replies:
    5
    Views:
    37,362
    vipinlal
    Mar 5, 2010
  2. les ander
    Replies:
    4
    Views:
    899
    wes weston
    Oct 5, 2004
  3. Michael Pronath
    Replies:
    1
    Views:
    1,194
    Diez B. Roggisch
    Jan 3, 2005
  4. Jack Orenstein

    threading.Thread vs. signal.signal

    Jack Orenstein, Sep 18, 2005, in forum: Python
    Replies:
    0
    Views:
    478
    Jack Orenstein
    Sep 18, 2005
  5. Robben
    Replies:
    14
    Views:
    569
    Old Wolf
    Dec 27, 2005
Loading...

Share This Page