这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » FPGA » ASK调制解调器解调部分仿真

共1条 1/1 1 跳转至

ASK调制解调器解调部分仿真

菜鸟
2016-05-26 11:41:47     打赏

对ASK调制解调器使用Quartus ii软件进行仿真,解调部分,输出与预期不同,希望各位指导下。程序如下

library ieee;

use ieee.std_logic_arith.all;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

entity ask_jt is

port(clk      :in std_logic;                           --系统时钟

       start    :in std_logic;                         --同步信号

       x      :in std_logic;                         --调制信号

       y      :out std_logic);                        --基带信号

end ask_jt;

architecture behav of ask_jt is

signal q:integer range 0 to 11;                          --计数器

signal xx:std_logic;                                  --寄存x信号

signal m:integer range 0 to 5;                          --xx的脉冲数

begin

process(clk)                                      --对系统时钟进行q分频

begin

if clk'event and clk='1' then xx<=x;       --clk上升沿时,把x信号赋给中间信号xx

   if start='0' then q<=0;                         --if语句完成q的循环计数

   elsif q=11 then q<=0;

   else q<=q+1;

   end if;

end if;

end process;

process(xx,q,m)                                       --此进程完成ASK解调

begin 

if q=11 then m<=0;                                  --m计数器清零

elsif q=10 then

   if m>4 then y<='1';               --if语句通过对m大小,来判决y输出的电平

   else y<='0';

   end if;

elsif  xx'event and xx='1'then m<=m+1;                 --xx信号的脉冲个数

end if;

end process;

end behav;



共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]