m序列vhdl程序,多项式f(x)=1+x^2+x^3+x^4+x^8 ,在线等。。

2025-03-01 03:37:50
推荐回答(4个)
回答1:

很简单的,你先把它电路图画出来,然后就知道怎么写了。
temp=x0&x2&x3&x4&x8
dout8<=dout8&temp
其余照抄就可以了。
你可以学习一下多项式和移位寄存器的关系就知道了

回答2:

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);
dout:out 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;

回答3:

你的意思是参照着这个已经给的程序(实现f(x)=1+x^3+x^7)基础上改成f(x)=1+x^2+x^3+x^4+x^8的?
我举得这个给的程序就有问题,m序列输出怎么会是八位的一起输出,不是一位一位移位输出的么,除非后面还有个并转串模块?

回答4:

说什么,没有看懂