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

📄 bsr.vhd

📁 全是FPGA的例子 对大家应该有好处 大家赶快下把 知识不等人
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity bsr is
port(din :in std_logic_vector(7 downto 0);
	s:in std_logic_vector(2 downto 0);
	clk,enb:in std_logic;
	wr:out std_logic;
	dout:out std_logic_vector(7 downto 0));
end bsr;
architecture behav of bsr is  
signal counter:integer;
begin 
	process(clk)
		variable sc:integer;
		variable tmp,tmp1:std_logic;
		begin
		if(clk'event and clk='1')then
			
			if(enb='0')then
				counter<=0;
				wr<='1';
			elsif(counter<sc)then
				sc:=conv_integer(s);
				dout(0)<=din(7);
				for i in 7 downto 1 loop
				dout(i)<=din(i-1);
				end loop;
				counter<=counter+1;
				wr<='1';
			else
				wr<='0';
			end if;
		end if;
	end process;
end behav;

⌨️ 快捷键说明

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