求大哥们解救 关于曼彻斯特编码器的FPGA实现的代码问题
时间:10-02
整理:3721RD
点击:
这个是代码begindate_out<=tem_register(5);
process(rst,clk)
begin
if rst='0'then
tem_register<="000000";
counter<="000000";
in_counter<='0';
odd_bit <='0';
bit_temp<='0';
en_out<='0'; --各信号初始化
elsif(clk'event and clk ='1')then
if in_en='1' then
if counter="000000" then
en_out<='0';
if ss='1' then
tem_register<="111000"; --命令同步字产生
else
tem_register<="000111"; --数据同步字产生
end if;
elsif counter="100110"then
if odd_bit='1'then
tem_register(5)<='0';
else
tem_register(5)<='1';
end if;
elsif counter="100111" then
if odd_bit='1'then
tem_register(5)<='1';
else
tem_register(5)<='0'; --奇偶校检的产生
end if;
else
tem_register(5 downto 1)<=tem_register(4 downto 0);
if in_counter='0'then
if date_in='1'then
tem_register(0)<='1';
bit_temp<='0';
odd_bit<=not odd_bit;
else
tem_register(0)<='0';
bit_temp<='1'; --对输入数据进行编码
end if;
else
tem_register(0) <= bit_temp;
end if;
in_counter<=not in_counter;
end if;
counter<=counter+'1';
if counter="101000"then
counter<="000000";
odd_bit <='0';
en_out<='1';
这个是错误
vlog -work work -vopt E:/examples/yekai.v
Model Technology ModelSim SE vlog 10.1a Compiler 2012.02 Feb 22 2012
** Error: E:/examples/yekai.v(1): near "begin": syntax error, unexpected begin, expecting class
解决不了求帮忙
process(rst,clk)
begin
if rst='0'then
tem_register<="000000";
counter<="000000";
in_counter<='0';
odd_bit <='0';
bit_temp<='0';
en_out<='0'; --各信号初始化
elsif(clk'event and clk ='1')then
if in_en='1' then
if counter="000000" then
en_out<='0';
if ss='1' then
tem_register<="111000"; --命令同步字产生
else
tem_register<="000111"; --数据同步字产生
end if;
elsif counter="100110"then
if odd_bit='1'then
tem_register(5)<='0';
else
tem_register(5)<='1';
end if;
elsif counter="100111" then
if odd_bit='1'then
tem_register(5)<='1';
else
tem_register(5)<='0'; --奇偶校检的产生
end if;
else
tem_register(5 downto 1)<=tem_register(4 downto 0);
if in_counter='0'then
if date_in='1'then
tem_register(0)<='1';
bit_temp<='0';
odd_bit<=not odd_bit;
else
tem_register(0)<='0';
bit_temp<='1'; --对输入数据进行编码
end if;
else
tem_register(0) <= bit_temp;
end if;
in_counter<=not in_counter;
end if;
counter<=counter+'1';
if counter="101000"then
counter<="000000";
odd_bit <='0';
en_out<='1';
这个是错误
vlog -work work -vopt E:/examples/yekai.v
Model Technology ModelSim SE vlog 10.1a Compiler 2012.02 Feb 22 2012
** Error: E:/examples/yekai.v(1): near "begin": syntax error, unexpected begin, expecting class
解决不了求帮忙
大哥们给点建议啊