最近课程设计,让用VHDL遍一个程序,感觉压力很大,特来求救啊!!!!!!!!!!!1
题目要求:设计一个伪随机序列发生器,采用的生成多项式为1+X3+X7。要求具有一个RESET端和两个控制端来调整寄存器初值(程序中设定好四种非零初值可选)。
下面是我搞到的程序,但是就是运行不了,大神帮我看看有什么错误,是不是初始值没治好,最好有运行出来的4肿情况 的分析图quartus II 我们用这个仿真的
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity PRSG is
port (reset,clk:in std_logic;
sel:in std_logic_vector(1 downto 0);
doutut std_logic_vector(7 downto 0));
end PRSG;
architecture behavioral of PRSG is
signal ddout:std_logic_vector(7 downto 0);
signal temp:std_logic;
begin
process(sel)
begin
if reset='1' then
ddout<="00000000";
elsif clk'event and clk='1' then
case sel is
when"00"=>ddout<="01010001";
when"01"=>ddout<="00110001";
when"10"=>ddout<="10001001";
when others=>ddout<="01111001";
end case;
temp<=ddout(0) xor ddout(3);
dout(0)<=ddout(1);
dout(1)<=ddout(2);
dout(2)<=ddout(3);
dout(3)<=ddout(4);
dout(4)<=ddout(5);
dout(5)<=ddout(6);
dout(6)<=ddout(7);
dout(7)<=ddout(7) xor temp;
end if;
end process;
end behavioral;