![]() |
|
||||||||||||||
| . 网站首页 . 新闻 . 新品 . 方案 . 专访 . 活动 . DSP . EDA . 评测室 . 技术文库 . 会员区 . 商城 . 服务导航 . 邮购 . 资源 . | ||
|
||
|
|||||
| ASK调制VHDL程序 | |||||
作者:Free 文章来源:Free 点击数: 更新时间:2008-1-3 ![]() |
|||||
|
--功能:基于VHDL硬件描述语言,对基带信号进行ASK振幅调制 --最后修改日期:2004.3.16 library ieee; use ieee.std_logic_arith.all; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity PL_ASK is port(clk :in std_logic; --系统时钟 start :in std_logic; --开始调制信号 x :in std_logic; --基带信号 y :out std_logic); --调制信号 end PL_ASK; architecture behav of PL_ASK is signal q:integer range 0 to 3; --分频计数器 signal f :std_logic; --载波信号 begin process(clk) begin if clk'event and clk='1' then if start='0' then q<=0; elsif q<=1 then f<='1';q<=q+1; --改变q后面数字的大小,就可以改变载波信号的占空比 elsif q=3 then f<='0';q<=0; --改变q后面数字的大小,就可以改变载波信号的频率 else f<='0';q<=q+1; end if; end if; end process; y<=x and f; --对基带码进行调制 end behav; ASK解调VHDL程序及仿真 1.ASK解调VHDL程序 --文件名:PL_ASK2 --功能:基于VHDL硬件描述语言,对ASK调制信号进行解调 --最后修改日期:2004.2.12 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 :out 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 behav; |
|||||
| 欢迎点击进入:TI德州中文网 (国内唯一针对TI应用的中文技术网站) 文章录入:admin 责任编辑:admin | |||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | |||||
| 最新热点 | 最新推荐 | 相关文章 | ||
| 没有相关文章 |
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 | | |||
|
|