8.13 MFSK 调制 VHDL 程序及仿真
--文件名:PL_MFSK
--功能:基于 VHDL 硬件描述语言,完成对基带信号的 MFSK 调制
--说明:这里 MFSK 的 M 为 4
--最后修改日期:2004.2.13
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity PL_MFSK is
port(clk :in std_logic; --系统时钟
start :in std_logic; --开始调制信号
x :in std_logic; --基带信号
y :out std_logic); --调制信号
end PL_MFSK;
architecture behav of PL_MFSK is
signal q :integer range 0 to 15; --计数器
signal f :std_logic_vector(3 downto 0); --分频器
signal xx:std_logic_vector(1 downto 0); --寄存输入信号 x 的 2 位寄存器
signal yy:std_logic_vector(1 downto 0); --寄存 xx 信号的寄存器
begin
process(clk) --此进程过对 clk 进行分频,得到 4 种载波信号 f3、f2、 f1、f0。
begin
if clk'event and clk='1' then
if start='0' then f<="0000";
elsif f="1111" then f<="0000";
else f<=f+1;
end if;
end if;
end process;
process(clk) --对输入的基带信号 x 进行串/并转换,得到 2 位并行信号的 yy
begin
if clk'event and clk='1' then
if start='0' then q<=0;
elsif q=0 then q<=1;xx(1)<=x;yy<=xx;
elsif q=8 then q<=9;xx(0)<=x;
else q<=q+1;
end if;
end if;
end process;
process(clk,yy) --此进程完成对输入基带信号 x 的 MFSK 调制
begin
if clk'event and clk='1' then