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

📄 ddrv4_2.vhd

📁 Workshop vhdl code from Esperan
💻 VHD
字号:
-----------------------------------------------------------------------
-- 
-- 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
--
-- Ddrv4_2.vhd
-- Array based display driver, instantiating 4 bit based display drivers
-- with Show New Time functionality (Ddrv_2.vhd) (Lab 13)
-- 
--------------------------------------------------------------- 

Library IEEE;
use IEEE.Std_Logic_1164.all; 

entity DDRV4 is
port ( ALARM_TIME_LS_MIN, CURRENT_TIME_LS_MIN, KEYPAD_LS_MIN  : in std_logic_vector(3 downto 0);
       ALARM_TIME_MS_MIN, CURRENT_TIME_MS_MIN, KEYPAD_MS_MIN  : in std_logic_vector(3 downto 0);
       ALARM_TIME_LS_HR, CURRENT_TIME_LS_HR, KEYPAD_LS_HR     : in std_logic_vector(3 downto 0);
       ALARM_TIME_MS_HR, CURRENT_TIME_MS_HR, KEYPAD_MS_HR     : in std_logic_vector(3 downto 0);
       SHOW_A, SHOW_NEW_TIME     : in std_logic;
       SOUND_ALARM               : out std_logic;
       DISPLAY_LS_MIN            : out std_logic_vector(6 downto 0);
       DISPLAY_MS_MIN            : out std_logic_vector(6 downto 0);
       DISPLAY_LS_HR             : out std_logic_vector(6 downto 0);
       DISPLAY_MS_HR             : out std_logic_vector(6 downto 0)
     );
end DDRV4;  

architecture RTL of DDRV4 is

   component DDRV
   port ( ALARM_TIME, CURRENT_TIME, KEYPAD  : in std_logic_vector (3 downto 0);
          SHOW_A, SHOW_NEW_TIME             : in std_logic;
          SOUND_ALARM               : out std_logic;
          DISPLAY                   : out std_logic_vector (6 downto 0)
         );
   end component; 

   signal ALARM_LS_MIN :  std_logic;
   signal ALARM_MS_MIN :  std_logic;
   signal ALARM_LS_HR :   std_logic;
   signal ALARM_MS_HR :   std_logic;

begin

  -------------------------------------------------
  -- Four instances of DDRV
  -------------------------------------------------
  U1: DDRV port map (ALARM_TIME_LS_MIN, CURRENT_TIME_LS_MIN, KEYPAD_LS_MIN,
		     SHOW_A, SHOW_NEW_TIME, ALARM_LS_MIN, DISPLAY_LS_MIN);

  U2: DDRV port map (ALARM_TIME_MS_MIN, CURRENT_TIME_MS_MIN, KEYPAD_MS_MIN,
		     SHOW_A, SHOW_NEW_TIME, ALARM_MS_MIN, DISPLAY_MS_MIN);

  U3: DDRV port map (ALARM_TIME_LS_HR, CURRENT_TIME_LS_HR, KEYPAD_LS_HR,
		     SHOW_A, SHOW_NEW_TIME, ALARM_LS_HR, DISPLAY_LS_HR);

  U4: DDRV port map (ALARM_TIME_MS_HR, CURRENT_TIME_MS_HR, KEYPAD_MS_HR,
		     SHOW_A, SHOW_NEW_TIME, ALARM_MS_HR, DISPLAY_MS_HR);

  ----------------------------------
  -- Sound Alarm signal
  ----------------------------------
  SOUND_ALARM <= ALARM_LS_MIN and ALARM_MS_MIN and 
                 ALARM_LS_HR and ALARM_MS_HR;

end RTL ;


⌨️ 快捷键说明

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