并行語句和順序語句
發布時間:2015/8/26 20:49:17 訪問次數:1925
并行(Concurrent)語句
并行語句總是處于進程(PROCESS)的外部。并行語句之間值的更新是同時進行的,DGB15F與語句所在的順序無關。并行語句包括:布爾方程;條件賦值;例化語句等。
①布爾方程
四選一的數據選擇器的庫聲明、程序包聲明及實體定義如下:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY mux4 IS
PORT
( s :IN STD_LOGIC_VECTOR(1DOWNT0 0);
aO,al,a2,a3 :IN STD_LOGIC;
y : OUT STD_LOGIC );
END mux4;
ARCHITECTURE archmux OF mux4 IS
BEGIN
y<=(ao AND not (s(0》 AND not (s(l》) or (al AND s(0) AND not (s(l》) or (a2 AND not (s(O》AND
s(l》 or (a3 AND s(0) AND s(l》;
END archmux;
③條件賦值
并行語句中條件賦值語句為: WITH-SELECT-WHEN語句及WHEN-ELSE語句。用WITH-SELECT-WHEN語句實現的結構體
ARCHITECTURE archmux OF mux4 ISBEGIN
WITH s SELECT
y<= ao WHEN "00",
al WHEN "01",
a2 WHEN "10",
a3 WHEN others;
并行(Concurrent)語句
并行語句總是處于進程(PROCESS)的外部。并行語句之間值的更新是同時進行的,DGB15F與語句所在的順序無關。并行語句包括:布爾方程;條件賦值;例化語句等。
①布爾方程
四選一的數據選擇器的庫聲明、程序包聲明及實體定義如下:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY mux4 IS
PORT
( s :IN STD_LOGIC_VECTOR(1DOWNT0 0);
aO,al,a2,a3 :IN STD_LOGIC;
y : OUT STD_LOGIC );
END mux4;
ARCHITECTURE archmux OF mux4 IS
BEGIN
y<=(ao AND not (s(0》 AND not (s(l》) or (al AND s(0) AND not (s(l》) or (a2 AND not (s(O》AND
s(l》 or (a3 AND s(0) AND s(l》;
END archmux;
③條件賦值
并行語句中條件賦值語句為: WITH-SELECT-WHEN語句及WHEN-ELSE語句。用WITH-SELECT-WHEN語句實現的結構體
ARCHITECTURE archmux OF mux4 ISBEGIN
WITH s SELECT
y<= ao WHEN "00",
al WHEN "01",
a2 WHEN "10",
a3 WHEN others;
上一篇:進程Process
上一篇:順序(Sequential)語句