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

📄 clock.vhdl

📁 这是一个用VHDL写的简易的CPU的程序
💻 VHDL
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;

entity clock is
    Port ( clk : in std_logic;
           reset : in std_logic;
           t0 : out std_logic;
           t1 : out std_logic);
end clock;

architecture main of clock is
	signal mstart:std_logic:='0';
	signal mt0:std_logic:='0';
	signal mt1:std_logic:='0';
begin
	process(clk,reset)
	begin
		if reset='1'then 
			mt0<='0';
		elsif clk='1' and clk'event then
			mt0<=not mt0;
		end if;
	end process;

	process(clk,mstart,reset)
	begin
		if reset='1' then
			mt1<='0';
		elsif mstart='1' and clk='0' and clk'event then
			mt1<= not mt1;
		end if;				
	end process;

	process(mt0,reset)
	begin
		if reset='1' then
			mstart<='0';
		elsif mt0='0' and mt0'event then
			mstart<='1';
		end if;
	end process;

	t0<=mt0;
	t1<=mt1;
end main;

⌨️ 快捷键说明

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