Advertisement
Guest User

Untitled

a guest
May 14th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.56 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4.  
  5. entity my_gates is
  6. port(a,b: in std_logic;
  7. and_out,or_out,xor_out: out std_logic);
  8. end;
  9.  
  10. architecture test of my_gates is
  11. function my_xor(s1: std_logic;s2: std_logic) return std_logic is
  12.     begin
  13.         return (s1 xor s2);
  14.     end my_xor;
  15.    
  16.    
  17. procedure my_and_or(signal s1:in std_logic;signal s2:in std_logic;signal and_out, or_out: out std_logic) is
  18.     begin
  19.         or_out<=(s1 or s2);
  20.         and_out<=(s1 and s2);
  21.     end my_and_or;
  22.    
  23. begin
  24. xor_out<=my_xor(a,b);
  25. my_and_or(a,b,and_out,or_out);
  26. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement