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