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

📄 shift.vhdl

📁 Direct Digital Synthesis (DDS),最好用的可步进的数字频率发生器的方法
💻 VHDL
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;

entity shift is
		port(data :in std_logic;
			  upclk: in std_logic;
			  reset:in std_logic;
			  dataout:out std_logic_vector(15 downto 0));
end shift;

architecture Behavioral of shift is
	--signal cnt:integer range 0 to 15;
	signal dtemp:std_logic_vector(15 downto 0):=(others=>'0');
begin
   process(upclk,reset)	--每次有16个upclk
	begin
	  	if reset='1' then dtemp<=(others=>'0');
		elsif upclk'event and upclk='1' then 
		 dtemp<=data&dtemp(15 downto 1);			  
	   end if;		 
	end process;
   dataout<=dtemp;
end Behavioral;

⌨️ 快捷键说明

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