dismux2.vhd

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

VHD
49
字号
-----------------------------------------------------------------------
-- 
-- 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
--
-- Dismux2.vhd
-- Display multiplexer with Sound Alarm functionality
--------------------------------------------------------------- 
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;
       SOUND_ALARM               : out 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_ALARM: process (ALARM_TIME, CURRENT_TIME, SHOW_A)
  begin
    if (SHOW_A = '1') then
      DISPLAY_TIME <= ALARM_TIME;
    else
      DISPLAY_TIME <= CURRENT_TIME;
    end if;

    if (ALARM_TIME = CURRENT_TIME) then
       SOUND_ALARM <= '1';
    else
       SOUND_ALARM <= '0';
    end if;

  end process MUX_ALARM;


end RTL;

⌨️ 快捷键说明

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