集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1612|回复: 2

谁能帮我解释一下这个ASK解调程序,用VHDL语言编写的

[复制链接]
lcx8618 发表于 2011-6-7 21:55:09 | 显示全部楼层 |阅读模式
2.ASK解调VHDL程序
--文件名:PL_ASK2
--功能:基于VHDL硬件描述语言,对ASK调制信号进行解调
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity PL_ASK2 is
port(clk      :in std_logic;          --系统时钟
     start    :in std_logic;         --同步信号
     x      :in std_logic;          --调制信号
     y      ut std_logic);        --基带信号
end PL_ASK2;
architecture behav of PL_ASK2 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)                    --此进程完成ASK解调
begin  
if q=11 then m<=0;               --m计数器清零
elsif q=10 then              
   if m<=3 then y<='0';           --if语句通过对m大小,来判决y输出的电平
   else y<='1';
   end if;
elsif  xx'event and xx='1'then m<=m+1; --计xx信号的脉冲个数
end if;
end process;
end behave;
ppc68 发表于 2011-6-9 16:51:52 | 显示全部楼层
不是已经有注释了么
至芯兴洪 发表于 2011-6-9 22:30:09 | 显示全部楼层
写个testbench,仿真出来,加上注释,更容易明白是怎么回事。建议先看看ASK是怎么调制的,懂了调制,解调更容易明白了
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-6-23 10:42 , Processed in 0.065422 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表