新闻  |   论坛  |   博客  |   在线研讨会
一些原码(转9)
ednchina | 2009-09-20 12:07:45    阅读:895   发布文章

CPSK调制VHDL程序

--文件名:PL_CPSK
--功能:基于VHDL硬件描述语言,对基带信号进行调制
--最后修改日期: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_CPSK is
port(clk :in std_logic; --系统时钟
start :in std_logic; --开始调制信号
x :in std_logic; --基带信号
y :out std_logic); --已调制输出信号
end PL_CPSK;
architecture behav of PL_CPSK is
signal q:std_logic_vector(1 downto 0); --2位计数器
signal f1,f2:std_logic; --载波信号
begin
process(clk) --此进程主要是产生两重载波信号f1,f2
begin
if clk'event and clk='1' then
if start='0' then q<="00";
elsif q<="01" then f1<='1';f2<='0';q<=q+1;
elsif q="11" then f1<='0';f2<='1';q<="00";
else f1<='0';f2<='1';q<=q+1;
end if;
end if;
end process;
process(clk,x) --此进程完成对基带信号x的调制
begin
if clk'event and clk='1' then
if q(0)='1' then
if x='1' then y<=f1; --基带信号x为‘1’时,输出信号y为f1
else y<=f2; --基带信号x为‘0’时,输出信号y为f2
end if;
end if;
end if;
end process;
end behav;

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
edn的世界
最近文章
一些原码(转18)
2009-09-20 12:17:17
一些原码(转16)
2009-09-20 12:16:07
一些原码(转16)
2009-09-20 12:14:35
推荐文章
最近访客