?? mfsk.txt
字號:
--文件名:MFSK
--功能:基于VHDL硬件描述語言,完成對基帶信號的MFSK調制
--說明:這里MFSK的M為4
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity MFSK is
port(clk :in std_logic; --系統時鐘
start :in std_logic; --開始調制信號
x :in std_logic; --基帶信號
y :out std_logic); --調制信號
end MFSK;
architecture behav of 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
if start='0' then y<='0'; -- if語句完成2位并行碼到4種載波的選通
elsif yy="00" then y<=not f(3);
elsif yy="01" then y<=not f(2);
elsif yy="10" then y<=not f(1);
else y<=not f(0);
end if;
end if;
end process;
end behav;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -