Search code examples
vhdl

downto vs. to in VHDL


I'm not sure I understand the difference between 'downto' vs. 'to' in vhdl.

I've seen some online explanations, but I still don't think I understand. Can anyone lay it out for me?


Solution

  • One goes up, one goes down:

    -- gives 0, 1, 2, 3:
    for i in 0 to 3 loop
    
    -- gives 3, 2, 1, 0:
    for i in 3 downto 0 loop