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

📄 pl_fsk2.vhd.bak

📁 用vhdl写的fpga移频键控程序
💻 BAK
字号:
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity PL_FSK2 is
port(
	clk      :in std_logic;	--系统时钟
	start    :in std_logic;	--同步信号
	x      :in std_logic;	--调制信号
	y      :out std_logic	--
	);          
end PL_FSK2;

architecture behav of PL_FSK2 is
signal q:integer range 0 to 11;	--分频计数器
signal regs:std_logic;	--寄存器 
signal m:integer range 0 to 5; 	--计数器
begin
	process(clk)	--对系统时钟进行q分频
	begin
		if clk'event and clk='1' then 
			regs<=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(regs,q)	--此进程完成FSK解调
	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  regs'event and regs='1'then 
			m<=m+1;	--计xx信号的脉冲个数
		end if;
	end process;
end behav;

⌨️ 快捷键说明

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