library ieee;
use ieee.std_logic_1164.all;
entity fsq is
port
(
clk : in std_logic;
u : out std_logic
);
end fsq;
architecture afsq of fsq is
signal p : std_logic_vector(3 downto 0);
signal p0 : std_logic;
signal p1 : std_logic;
signal p2 : std_logic;
signal p3 : std_logic;
begin
process(clk)
begin
if clk'event and clk='1' then
p0<=not p0;
end if;
end process;
process(p0)
begin
if p0'event and p0='0' then
p1<=not p1;
end if;
end process;
process(p1)
begin
if p1'event and p1='0' then
p2<=not p2;
end if;
end process;
process(p2)
begin
if p2'event and p2='0' then
p3<=not p3;
end if;
end process;
p<=p3&p2&p1&p0;
process(p)
begin
if p="1000" then
p<="0000";
end if;
case p is
when "0000" => u<='0';
when "0001" => u<='1';
when "0010" => u<='1';
when "0011" => u<='0';
when "0100" => u<='1';
when "0101" => u<='1';
when "0110" => u<='1';
when "0111" => u<='1';
when others => null;
end case;
end process;
end afsq;
这个是我的程序。。刚开始学VHDL,我想做一个01101111序列发生器。。这么写就会提示1 errors:signal "p" has multiple sources。。。怎么改?