问题描述
LSFR I have to write code for link
我的代码:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity top is
port ( output: out std_logic_vector(0 to 7) := "00000000";
fclk: in std_logic);
end top;
architecture arc of top is
begin
process (fclk)
variable reg: unsigned (0 to 7) := "11011010";
variable treg: unsigned (0 to 7);
begin
if fclk'event and fclk='1' then
treg := reg;
reg(0) := treg(1);
reg(1) := treg(0) xor treg(7);
reg(2) := treg(1) xor treg(7);
reg(3) := treg(2) xor treg(7);
reg(4) := treg(3) xor treg(7);
reg(5) := treg(4);
reg(6) := treg(5);
reg(7) := treg(6);
output <= std_logic_vector(reg);
end if;
end process;
end arc;
我的问题是,我是否为图中所示的 LSFR 正确编写了异或运算?您还有其他建议可以改进我的代码吗?谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)