我有一个与我的VHDL代码有关的问题。我必须为1位ALU创建一个模拟。我创建了一个D触发器和一个Full Adder,现在我必须用一些简单的逻辑门连接它们。如何使用这2个实体中的变量来执行此操作?
我的代码是:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY D_flipflop IS PORT (
D, Clock: IN STD_LOGIC;
Q: OUT STD_LOGIC);
END D_flipflop;
ARCHITECTURE Behavior OF D_flipflop IS
BEGIN
PROCESS(Clock)
BEGIN
IF Clock'EVENT AND Clock = '0' THEN
Q<= D;
END IF;
END PROCESS;
END Behavior;
ENTITY fa IS PORT (
Ci, Xi, Yi: IN STD_LOGIC ;
Ci1, Si: OUT STD_LOGIC) ;
END fa;
ARCHITECTURE Dataflow OF fa IS
BEGIN
Ci1 <= (Xi AND Yi) OR (Ci AND (Xi XOR Yi));
Si <= Xi XOR Yi XOR Ci;
End Dataflow ;