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

📄 fenwei.vhd

📁 实现交通灯控制器的vhdl编程
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity fenwei is
port( clock : in std_logic;   --时钟采用50MHz
      numin : in integer range 0 to 30;
      numA,numB : out integer range 0 to 15);
end entity;
architecture behav of fenwei is
begin
process(clock)
begin
  if rising_edge(clock) then
    if numin>=30 then
      numA<=3;   --提取显示的十位数
      numB<=numin-30;   --提取显示的个位数
    elsif numin>=20 then
      numA<=2;
      numB<=numin-20;
    elsif numin>=10 then
      numA<=1;
      numB<=numin-10;
    else
      numA<=0;
      numB<=numin;
    end if;
  end if;
end process;
end behav;
 

⌨️ 快捷键说明

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