📄 can_register_asyn.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.all;
entity can_register_asyn is
generic(
WIDTH : integer := 8 ;
RESET_VALUE : integer := 0);
port
(
data_in : in std_logic_vector(WIDTH-1 downto 0) ;
we : in std_logic ;
clk : in std_logic ;
rst : in std_logic ;
data_out : out std_logic_vector(WIDTH-1 downto 0));
end can_register_asyn;
architecture RTL of can_register_asyn is
signal data_out_reg: std_logic_vector(WIDTH-1 downto 0);
begin
process(clk,rst)
begin
if(clk = '1' and clk'event) then
if(rst = '1') then
data_out_reg<= conv_std_logic_vector(RESET_VALUE,WIDTH) after 1 ns;
elsif (we = '1') then -- write
data_out_reg<= data_in after 1 ns;
end if;
end if;
end process;
data_out <= data_out_reg;
end RTL;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -