Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------ my_gates ------
- library ieee;
- use ieee.std_logic_1164.all;
- entity my_gates is
- port(
- a, b : in std_logic;
- and_out, or_out, xor_out : out std_logic);
- end my_gates;
- architecture my_gates_arch of my_gates is
- -- funktion hvor xor af a og b returneres
- function my_xor(a, b : std_logic) return std_logic is
- begin
- return a xor b;
- end my_xor;
- -- procedure hvor "and og or" af a og b returneres
- procedure and_or(signal a,b: in std_logic; signal and_out, or_out: out std_logic) is
- begin
- and_out <= a and b;
- or_out <= a or b;
- end and_or;
- begin
- -- proceduren og funktionen kaldes
- xor_out <= my_xor(a,b);
- and_or(a,b, and_out, or_out);
- end my_gates_arch;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement