⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mask.vhd.txt

📁 mask
💻 TXT
字号:
--文件名:PL_MASK
--功能:基于VHDL硬件描述语言,对基带信号进行MASK调制
--说明:这里MASK中的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_MASK is
port(clk      :in std_logic;                    --系统时钟
     start    :in std_logic;                    --开始调制信号
     x      :in std_logic;                    --基带信号
     y      :out std_logic_vector(7 downto 0));  --8位DAC数据
end PL_MASK;
architecture behav of PL_MASK is
signal q:integer range 0 to 7;                   --计数器
signal qq:integer range 0 to 3;                  --计数器
signal xx:std_logic_vector(3 downto 0);          --并行数据寄存器
signal yy:std_logic_vector(7 downto 0);          --8位DAC数据寄存器
begin
process(clk) --此进程完成基带信号的串并转换,完成4位并行数据到8位DAC数据的译码
begin
if clk'event and clk='1' then 
   if start='0' then q<=0;
   elsif q=0 then q<=1;xx(3)<=x;     
      if xx(3)='1' then yy<=xx&"1111";   --if语句完成4位并行数据到8位DAC数据转换
      elsif xx(2)='1' then yy<=xx&"1011";
      elsif xx(1)='1' then yy<=xx&"0111";
      elsif xx(0)='1' then yy<=xx&"0011";
      else yy<=xx&"0000";
      end if;
   elsif q=2 then q<=3;xx(2)<=x;
   elsif q=4 then q<=5;xx(1)<=x;
   elsif q=6 then q<=7;xx(0)<=x; 
   else  q<=q+1;
   end if;
end if;
end process;
process(clk)                                        --对8位DAC数据进行ASK调制
begin
if clk'event and clk='1' then
   if start='0' then qq<=0;
   elsif qq<2 then qq<=qq+1;y<="00000000";
   elsif qq=2 then qq<=3;y<=yy;
   else  qq<=0;
   end if;
end if;
end process;
end behav;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -