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

📄 binary_upcounter.vhd

📁 含有各类寄存器
💻 VHD
字号:
--Generated Binary Up Counter--The first design entity is a T-type flip-flop. The second is an scalable synchronous binary up counter illustrating the use of the generate statement to produce regular structures of components.library ieee;use ieee.std_logic_1164.all;entity tff isport(clk, t, clear : in std_logic; q : buffer std_logic);end tff;architecture v1 of tff isbeginprocess(clear, clk)beginif clear = '1' thenq <= '0';elsif rising_edge(clk) thenif t = '1' thenq <= not q;elsenull;end if;end if;end process;end v1;library ieee;use ieee.std_logic_1164.all;entity bigcntr isgeneric(size : positive := 32);port(clk, clear : in std_logic;q : buffer std_logic_vector((size-1) downto 0));end bigcntr;architecture v1 of bigcntr iscomponent tff isport(clk, t, clear : in std_logic; q : buffer std_logic);end component;signal tin : std_logic_vector((size-1) downto 0);begingenttf : for i in (size-1) downto 0 generatettype : tff port map (clk, tin(i), clear, q(i));end generate;genand : for i in 0 to (size-1) generatet0 : if i = 0 generatetin(i) <= '1';end generate;t1_size : if i > 0 generatetin(i) <= q(i-1) and tin(i-1);end generate;end generate;end v1;

⌨️ 快捷键说明

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