close
  • 同時
    • 指派
      <=
    • 條件
      輸出 <= 訊號 A when (條件1 ex x='1') else 訊號 B when (條件2 ex x='3') else 訊號 C ;
    • 選擇
      1. with 選擇訊號 select
      2. 輸出<=訊號 A when 選擇的訊號1 ,
      3.             訊號 B when 選擇的訊號2 ,
      4.               ...
      5.             訊號 N when others;
  • 順序
    • 語法宣告
      1. Label : process (Sensitivity List)
      2.            變數宣告
      3. begin
      4.            順序程式
      5. end process Label;
    • 條件
      • if (條件) then 執行 end if;
      • if (條件) then 執行 else 不成立執行 end if;
      • if (條件) then 執行 elsif (條件) then 執行 elsif .... else 都不成立執行 end if ;
    • 選擇
      1. case 選擇訊號 is
      2.     when 選擇的訊號1 =>
      3.         執行;
      4.     when 選擇的訊號2 =>
      5.         執行;
      6.     when others =>
      7.         執行;
      8. end case
    • 迴圈
      • for
        1. for i in startValue to/downto endValue loop
        2.     執行;
        3. end loop;
      • while
        1. while (條件) loop
        2.     執行;
        3. end loop;
      • loop (無限迴圈由next與exit控制)
        1. Label : loop
        2.     next when (條件);--與continue相同
        3.     執行;
        4.     exit when (條件);--與break相同
        5. end loop Label;
    • 等待(delay)
      • Wait Until CLK'event and CLK='1'; --直到條件成立
      • Wait On a,b ; --等待ab訊號
      • Wait For 20ns ; --等待20ns
      • Wait For (a*(b+c)) ; --等後面

擷取自 中正大學VHDL入門

arrow
arrow
    全站熱搜

    繩繩 發表在 痞客邦 留言(0) 人氣()