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

📄 counter1.vhd

📁 多个Verilog和vhdl程序例子
💻 VHD
字号:
-- 8 bit up-counter with synchronous reset

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
entity counter is 
    port (clk, reset: in bit;
             count: buffer integer range 0 to 255);
end counter;

architecture behave of counter is
begin
    p1: process
    begin
        wait until clk'event and clk = '1';
        -- if synchronous reset comes along or max count
        if (reset = '1' or count = 255) then
            count <= 0;
        else
            count <= count + 1;
        end if;
    end process p1;
end behave;

⌨️ 快捷键说明

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