dismux1.vhd

来自「Workshop vhdl code from Esperan」· VHDL 代码 · 共 41 行

VHD
41
字号
-----------------------------------------------------------------------
-- 
-- Original Code Copyright (c) 1999 by Esperan. All rights reserved.
-- www.esperan.com
-- 
-- This source file may be used and distributed without restriction
-- provided that this copyright statement is not removed from the file
-- and that any derivative work contains this copyright notice. 
--
-- Esperan VHDL Alarm Clock Lab Exercise Design V5.0
--
-- Dismux1.vhd
-- Display multiplexer
--
--------------------------------------------------------------- 
Library IEEE;
use IEEE.Std_Logic_1164.all;

entity DISMUX is
port ( ALARM_TIME, CURRENT_TIME  : in std_logic_vector (3 downto 0);
       SHOW_A                    : in std_logic;
       DISPLAY_TIME              : out std_logic_vector (3 downto 0));
end DISMUX;  

architecture RTL of DISMUX is
begin

  -- ALARM_TIME, CURRENT_TIME and SHOW_A must all be in the
  -- process sensitivity list

  MUX: process (ALARM_TIME, CURRENT_TIME, SHOW_A)
  begin
    if (SHOW_A = '1') then
      DISPLAY_TIME <= ALARM_TIME;
    else
      DISPLAY_TIME <= CURRENT_TIME;
    end if;
  end process MUX;

end RTL;

⌨️ 快捷键说明

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