For loop delay???

Discussion in 'VHDL' started by krkrkr, Jun 15, 2009.

  1. krkrkr

    krkrkr

    Joined:
    Jun 14, 2009
    Messages:
    4
    Likes Received:
    0
    Hi all,

    If I assign a signal before a long for loop in a process, will that signal wait until the end of the process to take place?

    ie process (a) is
    variable cnt : std_logic_vector(0 to 15) := X"0000";
    begin
    active <= '1';
    for i 0 to 1000 loop
    cnt := cnt + a;
    end loop;
    end process;

    What if I want "active" take place once the process is activated and I don't want ot wait for the 1000 loop and reach the end of the process?

    Regards.
     
    krkrkr, Jun 15, 2009
    #1
    1. Advertisements

  2. krkrkr

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Likes Received:
    0
    Location:
    Denmark
    Will this be code for simulation or for synthesize (hardware implementation)
    ????
     
    jeppe, Jun 15, 2009
    #2
    1. Advertisements

  3. krkrkr

    krkrkr

    Joined:
    Jun 14, 2009
    Messages:
    4
    Likes Received:
    0
    Its for hardware implimentation.
     
    krkrkr, Jun 15, 2009
    #3
  4. krkrkr

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Likes Received:
    0
    Location:
    Denmark
    OK - You must understand some basic principles behind VHDL.
    You can't create delays in hardware with a loop statement.

    In order to get fixed delays must you have a clock signal (with a fixed frequency)
     
    jeppe, Jun 15, 2009
    #4
  5. krkrkr

    krkrkr

    Joined:
    Jun 14, 2009
    Messages:
    4
    Likes Received:
    0
    Thanks Jeppe for your reply.

    But I'm not looking to make a delay, I'm new to VHDL and I would like to understand the process concept.
    I read that signal assignment in a process will take place at the end of the process, so what if I have a long for loop after the signal assignment? does that mean the signal assignment will not take place except when the for loop and all other statments finished?

    If I want to design a logic that gives an active '1' once it comes in the process then do some other statments in the process, will this active signal comes to '1' just when it get in the process or at the end after all other statments in the process?

    Regards.
     
    krkrkr, Jun 15, 2009
    #5
  6. krkrkr

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Likes Received:
    0
    Location:
    Denmark
    Hi Krkrkr
    In that case will you get my "standard answer" :)
    Search the net for the free interactive book on VHDL EVITA from actel
    Specially chapter 6 will answer your questions about processes and signals

    And yes your right - the loop will have to end before the assignment takes places - but in hardware will the loop not exist.

    Jeppe
     
    jeppe, Jun 15, 2009
    #6
    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. D. Shane Fowlkes
    Replies:
    4
    Views:
    749
    =?Utf-8?B?a2VpdGhpbnNhYw==?=
    Jun 9, 2005
  2. Conrad

    Time delay loop - better way?

    Conrad, Jun 30, 2004, in forum: Python
    Replies:
    12
    Views:
    8,987
    Anthony Baxter
    Jul 5, 2004
  3. Craig Williamson

    Time delay loop less than 1ms

    Craig Williamson, Apr 21, 2008, in forum: C Programming
    Replies:
    6
    Views:
    1,378
    Keith Thompson
    Apr 23, 2008
  4. navin

    Loop and show page after delay

    navin, Jul 1, 2009, in forum: ASP General
    Replies:
    2
    Views:
    399
    Adrienne Boswell
    Jul 1, 2009
  5. Ed Redman

    ruby/tk and loop delay

    Ed Redman, Apr 14, 2008, in forum: Ruby
    Replies:
    6
    Views:
    324
    Hidetoshi NAGAI
    Apr 15, 2008
  6. Xx Xx

    create delay loop in ruby?

    Xx Xx, Dec 18, 2008, in forum: Ruby
    Replies:
    1
    Views:
    224
    Robert Klemme
    Dec 18, 2008
  7. Fabian

    noticeable delay in processing a loop

    Fabian, Dec 6, 2003, in forum: Javascript
    Replies:
    4
    Views:
    185
    Dr John Stockton
    Dec 7, 2003
  8. Isaac Won
    Replies:
    9
    Views:
    750
    Ulrich Eckhardt
    Mar 4, 2013
Loading...