How could I output a real signal to std_logic_vector?

Discussion in 'VHDL' started by Will, Mar 9, 2009.

  1. Will

    Will Guest

    Hi all,

    I'm really new to VHDL. I need to output a real signal. How could I
    convert it to std_logic_vector? Or, could I output a real number
    directly?
    BTW, is there any way that I could monitor variables during test bench
    simulation like debugging in other language?

    Thanks and bow.
     
    Will, Mar 9, 2009
    #1
    1. Advertisements

  2. Will

    JohnDuq

    Joined:
    Dec 9, 2008
    Messages:
    88
    Likes Received:
    0
    Well, first you need some definition for your 'real' signal. If you can define it as a std_logic_vector then you are done.

    signal clk_scaler : unsigned(20 downto 0);

    What is your definition of 'real'? Not 'imaginary' (1 + i1)?

    Yes, your test bench will let you see about anything that makes it through the compiler.
     
    JohnDuq, Mar 18, 2009
    #2
    1. Advertisements

  3. Will

    Ukanbal

    Joined:
    Mar 7, 2009
    Messages:
    9
    Likes Received:
    0
    in VHDL you can set your signal into any number. you can write any signed or unsigned number on it and your output signal will carry that value until you change it.

    the question regarding creating a real signal... if you are talking about actual signals such as sinusoid i do not think you can do that. you can create a squarewave which is a simple clock in VHDL but thats about it.
     
    Ukanbal, Mar 20, 2009
    #3
  4. Will

    JohnDuq

    Joined:
    Dec 9, 2008
    Messages:
    88
    Likes Received:
    0
    You can create a sinusoid by using a look up table.
     
    JohnDuq, Mar 20, 2009
    #4
    1. Advertisements

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. eneko
    Replies:
    2
    Views:
    3,320
    eneko
    Oct 20, 2004
  2. Replies:
    6
    Views:
    5,144
    Douglas Sykora
    Feb 11, 2005
  3. eNo
    Replies:
    2
    Views:
    20,586
    Hubble
    Aug 9, 2005
  4. Weng Tianxiang
    Replies:
    2
    Views:
    938
    Jonathan Bromley
    Jan 30, 2007
  5. Thomas Rouam
    Replies:
    6
    Views:
    1,478
  6. dibacco73
    Replies:
    1
    Views:
    880
    joris
    Feb 12, 2009
  7. Will
    Replies:
    1
    Views:
    1,063
    joris
    Mar 10, 2009
  8. thaosb
    Replies:
    0
    Views:
    519
    thaosb
    Apr 10, 2009
Loading...