新手求教,这个报错怎么改。VHDL实现2FSK调制,

[复制链接]
497|0
手机看帖
扫描二维码
随时随地手机跟帖
淡然处世|  楼主 | 2017-7-28 15:54 | 显示全部楼层 |阅读模式
本帖最后由 淡然处世 于 2017-7-28 16:01 编辑

--2FSK调制模块--
library ieee ;
use ieee.std_logic_arith.all ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all ;

entity PL_2FSK is
port (   clk   :in  std_logic ;
           start   :in  std_logic ;
               x   :in  std_logic ;
               y   :out std_logic ;
          )
end PL_2FSK ;

architecture behav of PL_2FSK is
signal     q1: integer range 0 to 11 ;
signal     q2: integer range 0 to 3 ;
signal  f1,f2: std_logic ;

begin
  process ( clk )
   begin
    if clk'event and clk = '1' then
     if start = '0'   then   q1 <= 0 ;
      elsif   q1 <= 5 then   f1 <= '1' ;
              q1 <= q1 + 1 ;
        elsif q1 = 11 then   f1 <= '0' ;
              q1 <= 0 ;
       else   f1 <= '0';
              q1 <= q1 + 1 ;
      end if ;
    end if ;
   end if ;
  end process ;

process ( clk )
begin
    if clk 'event and clk = '1' then
     if    start = '0' then q2 <= 0 ;
      elsif  q2 <= 0   then f2 <= '1';
             q2 <= q2 + 1 ;
       elsif q2 = 1    then f2 <= '0';
             q2 <= 0 ;
       elsif f2 <= '0' ;
             q2 <= q2 + 1 ;
     end if ;
    end if ;
end process ;

process ( clk,x )
  begin
     if clk'event and clk = '1' then
      if     x = '0' then y = f1 ;
      else   y = f2 ;
     end if ;
   end if ;
end process ;
end behav ;

cuowu.png

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

6

主题

19

帖子

0

粉丝