以單行敘述條件訊號指定方式, 設計一個3輸入的 AND 閘:
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity andgate_3input is Port ( A : in STD_LOGIC; B : in STD_LOGIC; C : in STD_LOGIC; F : out STD_LOGIC); end andgate_3input; architecture Data_flow of andgate_3input is signal ABC : STD_LOGIC_VECTOR(2 downto 0); begin ABC <= A & B & C; F <= '1' when ABC = "111" else '0'; end Data_flow;
把上課的作業PO來這邊,與大家交流
請大家多多指教 : )
找時間模擬圖也一併傳上來
沒有留言:
張貼留言