📄 mcutofpga.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity McuToFpga is
generic(QWidth : Integer := 24); --移位寄存器的宽度
port(
CLK: in std_logic; --同步时钟,上升研写入数据
DATA: in std_logic; --串行数据端口,先发低位然后高位
EN: in std_logic; --使能端,高电平开始传输,同步方式
frep: out std_logic_vector(14 downto 0);
phase: out std_logic_vector(8 downto 0)
);
end;
architecture behav of McuToFpga is
signal Qtmp: std_logic_vector(QWidth-1 downto 0):=(others=>'0');
begin
process(CLK,EN,DATA)
begin
if(CLK'event and CLK='1') then
if(EN = '1') then
Qtmp(23) <=DATA;
Qtmp(22 downto 0) <= Qtmp(23 downto 1);
else
Qtmp<=Qtmp;
end if;
end if;
end process;
frep<=Qtmp(14 downto 0);
phase<=Qtmp(23 downto 15);
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -