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

📄 bin2seg.vhd

📁 智能控制交通灯。分主路辅路
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity bin2seg is
  port (  timebin_in : in std_logic_vector(4 downto 0);
          timeseg_l : out std_logic_vector(6 downto 0));
end bin2seg;

architecture bhv of bin2seg is
begin
  process(timebin_in)
  begin
    if timebin_in<="01001" then
      timeseg_l(3 downto 0)<=timebin_in;
      timeseg_l(6 downto 4)<="000";
    elsif timebin_in<="10011" then
      timeseg_l(3 downto 0)<=timebin_in - 10;
      timeseg_l(6 downto 4)<="001";
    else
      timeseg_l(3 downto 0)<=timebin_in - 20;
      timeseg_l(6 downto 4)<="010";
    end if;
  end process;
end bhv;

⌨️ 快捷键说明

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