fdiv.vhd
来自「大家要明白EDA在现实生活中的作用」· VHDL 代码 · 共 30 行
VHD
30 行
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;
entity fdiv is
port(
clk: IN std_logic; -- 确认输入
divout: out std_logic
);
end entity fdiv;
architecture behv of fdiv is
--signal 声明
signal d : std_logic_vector(3 downto 0);
signal o : std_logic;
begin
process(clk)
begin
if clk'event and clk = '1' then
if d = "1001" then d <= "0000"; o <= not o;
else d <= d + '1';
end if;
divout <= o;
end if;
end process;
end behv;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?