求帮忙!学校要求写一个bcd十进制加法器,学生浅浅看了下vhdl写的,结果报错这个也一直不知道怎么解决问题,看网上说是信号有多个输入,但是不知道怎么解决
ERROR:HDLCompiler:1401 - "C:.Xilinx\xcode\bcdDecAdder\bcdDecAdder.vhd" Line 52: Signal S_LOW[3] in unit BCD_ADD is connected to following multiple drivers:
ERROR:HDLCompiler:1401 - "C:.Xilinx\xcode\bcdDecAdder\bcdDecAdder.vhd" Line 58: Signal S_HIGH[3] in unit BCD_ADD is connected to following multiple drivers:
---------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 22:43:34 11/05/2024
-- Design Name:
-- Module Name: bcdDecAdder - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity BCD_ADD is
Port ( A : in STD_LOGIC_VECTOR(7 DOWNTO 0);
B : in STD_LOGIC_VECTOR(7 DOWNTO 0);
S : out STD_LOGIC_VECTOR(7 DOWNTO 0);
CO : out STD_LOGIC);
end BCD_ADD;
architecture Behavioral of BCD_ADD is
signal S_LOW,S_HIGH:STD_LOGIC_VECTOR(3 DOWNTO 0);
signal CO_LOW,CO_HIGH:STD_LOGIC;
signal CARRY_LOW,CARRY_HIGH:STD_LOGIC;
component ADD_4BIT
port(
A, B : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
S : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
CO : OUT STD_LOGIC);
END component;
begin
U1:ADD_4BIT port map(
A=>A(3 DOWNTO 0),
B=>B(3 DOWNTO 0),
S=>S_LOW,
CO=>CO_LOW);
U2:ADD_4BIT port map(
A=>A(7 DOWNTO 4),
B=>B(7 DOWNTO 4),
S=>S_HIGH,
CO=>CO_HIGH);
process(S_LOW)
begin
if S_LOW > "1001" then
CARRY_LOW <= '1';
else
CARRY_LOW <= '0';
end if;
end process;
process(S_LOW)
begin
if CARRY_LOW = '1' then
S_LOW <= "0110";
else
S_LOW <= S_LOW;
end if;
end process;
process(S_HIGH)
begin
if S_HIGH > "1001" then
CARRY_HIGH <= '1';
else
CARRY_HIGH <= '0';
end if;
end process;
process(S_HIGH)
begin
if CARRY_HIGH = '1' then
S_HIGH <= "0110";
else
S_HIGH <= S_HIGH;
end if;
end process;
S_HIGH(0)<=S_HIGH(0) or CO_LOW;
S(3 DOWNTO 0)<=S_LOW;
S(7 DOWNTO 4)<=S_HIGH;
CO<=CO_HIGH or CARRY_HIGH;
end Behavioral;