我正在尝试使用结构化 VHDL 和组件来实现一位计数器。尝试执行端口映射时出现语法错误。错误是“错误(10028):无法在Assign4.vhd(47)处为网络“P”解析多个常量驱动程序”这是我到目前为止的内容:提前感谢您的任何想法。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
--------------------------------------------------------------
Entity Assign4 is
Generic (bits: POSITIVE := 1);
Port (CLK: in std_logic;
SE1,SE2: in std_logic;
P: out std_logic);
End Entity Assign4;
---------------------------------------------------------------
Architecture Structural of Assign4 is
--------------------------------
Component Counter is
-- Generic (N: Positive := 1);
Port(clock,sel1,sel2: in std_logic;
Q: out std_logic);
End Component;
--------------------------------
Signal x,y,z: std_logic;
begin
P <= x;
--Qn <= x;
process(CLK)
begin
if (Clk'event and CLK = '1') then
x <= x xor (SE1 and SE2);
end if;
end process;
--------------COUNTER-------------------------------------
count1: Counter PORT MAP (clk,SE1,SE2,P);
---------------END COUNTER--------------------------------
-- The generate will be used later for implementing more bits in the counter
--gen: FOR i IN 0 TO 1 GENERATE
-- count1: Counter PORT MAP (SE1 <= inbits(0),SE2 <= inbits(1),clock <= CLK,
-- outA <= SE1 and SE2, q <= outA xor q);
--end GENERATE gen;
---------------------------------------------------
end Architecture;