(probably) a very easy VHDL question

Discussion in 'Programmer's Corner' started by jjtjp, Mar 18, 2014.

  1. jjtjp

    Thread Starter Member

    Mar 3, 2014
    30
    0
    We have not been formally taught anything in VHDL or Xilinx but I know that I will have to in the future so when my class requires me to design a logic circuit I try and use it to just gain familiarity. I created a magnitude comparitor and mapped two buses, dataa and datab to a0 to a3 and b0 to b3 respectively. I want to use the test bench feature to see the waveforms and I can't figure out why my first logic vector goes in and it never changes. Is there something wrong with my syntax or do I misunderstand what a logic vector can do?

    Here is the relevant portion of my code:
    Code ( (Unknown Language)):
    1.   tb : PROCESS
    2.    BEGIN
    3.         high <= '1';
    4.         DATAA <= "0001";
    5.         DATAB <= "0010";
    6.         wait for 2 ms;
    7.         DATAA <= "0010";
    8.         DATAB <= "0010";
    9.         wait for 2 ms;
    10.         DATAA <= "0011";
    11.         DATAB <= "0010";
    12.         wait for 2 ms;
    13.        
    14.       WAIT; -- will wait forever
    15.    END PROCESS;
    And here is the output I get:
    [​IMG]

    Sorry for such a newb question. I can't figure it out by searching the depths of the internet. Thanks so much in advance.
     
  2. jjtjp

    Thread Starter Member

    Mar 3, 2014
    30
    0
    okay, I'm still curious about the answer, but I tried ns and it worked fine. milli seconds is unsupported?
     
    Last edited: Mar 18, 2014
  3. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    It looks like you didn't run your simulation long enough.

    You tell the testbench to not change values for 2ms, yet your simulation goes for 1us...

    Try simulating for at least 6ms.
     
  4. jjtjp

    Thread Starter Member

    Mar 3, 2014
    30
    0
    Aha! Thanks! I figured it was something trivial. I also discovered in this process the importance of vector 3 downto 0 as opposed to 0 to 3. All of my bits were opposite of what I anticipated and that tripped me up for a bit. Thanks again!
     
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Glad you got it figured out.

    Just wait until you implement a ROM... ;)
     
Loading...