我想避免在以下代碼中使用inout。避免在VHDL中使用inout
有什麼辦法可以做到嗎?例如幫助信號?
entity LA_Unit is
Port (Cin : in STD_LOGIC;
P : in STD_LOGIC_VECTOR (3 downto 0);
G : in STD_LOGIC_VECTOR (3 downto 0);
C3 : out STD_LOGIC;
C : inout STD_LOGIC_VECTOR (2 downto 0));
end LA_Unit;
architecture Behavioral of LA_Unit is
begin
C(0) <= (P(0) and Cin) xor G(0);
C(1) <= (P(1) and C(0)) xor G(1);
C(2) <= (P(2) and C(1)) xor G(2);
C3 <= (P(3) and C(2)) xor G(3);
end Behavioral;
請註明其中一個答案是「解決方案」,如果一個解決您的問題。 – Paebbels