【发布时间】:2023-04-11 10:57:02
【问题描述】:
我是 VHDL 新手。我试图为加法减法器编写代码。我的一个电路输入总线在综合后接地。我在 Ubuntu 14.04 LTS 64 位中使用 Xilinx ISE 14.2。
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity examples is
Generic(n: Natural :=8);
port (
A : in std_logic_vector(n-1 downto 0);
B : in std_logic_vector(n-1 downto 0);
subtract : in std_logic;
sum: out std_logic_vector(n-1 downto 0);
carry : out std_logic
);
end examples;
architecture Behavioral of examples is
Signal result: std_logic_vector(n downto 0);
begin
my_adder_subtractor : process(A,B,subtract)
begin
if(subtract = '0') Then
result <= std_logic_vector(('0' & unsigned(A))+('0' & unsigned(B)));
else
result <= std_logic_vector(('0' & unsigned(A))-('0' & unsigned(B)));
end if;
sum <= result(n-1 downto 0);
carry <= result(n);
end process my_adder_subtractor;
end Behavioral;
RTL 示意图:
【问题讨论】:
-
你的问题是什么。
-
我的问题是为什么端口A接地?
标签: vhdl xilinx xilinx-ise