我想用VHDL设计一个32位二进制串行加法器,使用结构化描述。加法器应该使用一个完整的加法器和一个d-latch。我看到它的方式是:二进制串行加法器 - VHDL
全加器:
architecture Behavioral of FullAdder is
begin
s <= (x xor y) xor cin;
cout <= (x and y) or (y and cin) or (x and cin);
end Behavioral;
d-锁:
architecture Behavioral of dLatch is
begin
state: process(clk)
begin
if(clk'event and clk = '1') then
q <= d;
end if;
end process;
end Behavioral;
串行加法:
add: process (clk)
variable count : integer range 0 to 31;
variable aux : STD_LOGIC;
variable aux2 : STD_LOGIC;
begin
if(clk'event and clk = '1') then
fa: FullAdder port map(x(count), y(count), aux, s(count), aux2);
dl: dLatch port map(clock, aux2, aux);
count := count + 1;
end if;
end process;
但是,它似乎并没有工作。 另外,管道串行加法器最简单的方法是什么?
因为您已经使用信号到端口的postional映射,所以在没有实体声明的情况下检查有点困难。我建议使用命名的端口映射(pinname => signal_name)。你建立了一个模拟?如果不这样做。如果你有,用它来向我们解释“这似乎不起作用”的意思 - 你期望看到什么?你究竟看到了什么? –