Advertisement
hbinderup94

my_gates_package

May 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.72 KB | None | 0 0
  1. ------ my_gates_package ------
  2. library ieee;
  3. use ieee.std_logic_1164.all;
  4.  
  5. package my_gates_package is -- funktion og procedure erklæres som del af package
  6.         function my_xor(a, b : std_logic) return std_logic;
  7.         procedure and_or(signal a,b: in std_logic; signal and_out, or_out: out std_logic);
  8. end my_gates_package;
  9.  
  10. package body my_gates_package is
  11.  
  12.     -- funktion hvor xor af a og b returneres
  13.     function my_xor(a, b : std_logic) return std_logic is
  14.     begin
  15.         return a xor b;
  16.     end my_xor;
  17.    
  18.     -- procedure hvor and or or af a og b returneres
  19.     procedure and_or(signal a,b: in std_logic; signal and_out, or_out: out std_logic) is
  20.     begin
  21.         and_out <= a and b;
  22.         or_out  <= a or b;
  23.     end and_or;
  24.    
  25. end my_gates_package;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement