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

📄 寄存器设计.txt

📁 protel电路板设计
💻 TXT
字号:
library ieee;
use ieee.std_logic_1164.all;
entity reg is
    port(
         clk:in std_logic;
         reset:in std_logic;
         load:in std_logic;
         din:in std_logic_vector(7 downto 0);
         dout:out std_logic_vector(7 downto 0)
    );
end reg;
architecture reg_arch of reg is
signal n_state,p_state: std_logic_vector(7 downto 0);
begin
   dout<=p_state;
    com:process(p_state,load,din)
   begin
      n_state<=p_state;
      if(load='1')then
           n_state<=din;
      end if;
   end process;
   state:process(clk,reset)
   begin
   if(reset='0')then
      p_state<=(others=>'1');
   elsif(clk'event and clk='1')then
      p_state<=n_state;
   end if;
  end process state;
end reg_arch;  


⌨️ 快捷键说明

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