aboutsummaryrefslogtreecommitdiff
path: root/src/de1_and2gate_structure.vhd
blob: fcab62ad057fb47c31639bfc4bff94363c4c578d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-------------------------------------------------------------------------------
-- Module     : de1_and2gate
-------------------------------------------------------------------------------
-- Author     : Johann Faerber
-- Company    : University of Applied Sciences Augsburg
-------------------------------------------------------------------------------
-- Description: test the module and2gate on a DE1 prototype board
--              connecting device under test (DUT) and2gate
--              to input/output signals of the DE1 prototype board
-------------------------------------------------------------------------------
-- Revisions  : see end of file
-------------------------------------------------------------------------------
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;

ENTITY de1_and2gate IS
  PORT (
    SW   : IN  std_ulogic_vector(1 DOWNTO 0);  -- Toggle Switch[2:0]
    LEDR : OUT std_ulogic_vector(2 DOWNTO 0)   -- LED Red[2:0]  
    );
END de1_and2gate;

ARCHITECTURE structure OF de1_and2gate IS

  COMPONENT and2gate IS
    PORT (
      a_i : IN  std_ulogic;
      b_i : IN  std_ulogic;
      y_o : OUT std_ulogic);
  END COMPONENT and2gate;

BEGIN

  -- assigning input signals to LEDs
  LEDR(0) <= SW(0);
  LEDR(1) <= SW(1);

  -- connecting device under test with peripheral elements
  DUT : and2gate
    PORT MAP (
      a_i => SW(0),
      b_i => SW(1),
      y_o => LEDR(2));

END structure;
-------------------------------------------------------------------------------
-- Revisions:
-- ----------
-- $Id:$
-------------------------------------------------------------------------------