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

📄 shift_reg.vhd

📁 Simple shift register with testbench in vhdl
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;

entity shift_reg is
generic( dlzka : natural :=7);
port(
	datain	: in std_logic;
	clk		: in std_logic;
	rst		: in std_logic;
	ss		: in std_logic;
	dataout	: out std_logic);
end shift_reg;

architecture arch of shift_reg is

	signal shiftin	: std_logic_vector(dlzka downto 0):="00000000";
begin
		
	process(clk)
	begin
		if rst='1' then
			shiftin<=(others=>'0');
		elsif rising_edge(clk) then
			if ss='0' then
				shiftin<=datain & shiftin(dlzka downto 1);
			end if;
		end if;
	end process;
	dataout<=shiftin(0);
end arch;

⌨️ 快捷键说明

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