Advertisement
Doda94

Untitled

Dec 11th, 2023
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.87 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. -- warning: this file will not be saved if:
  5. --     * following entity block contains any syntactic errors (e.g. port list isn't separated with ; character)
  6. --     * following entity name and current file name differ (e.g. if file is named mux41 then entity must also be named mux41 and vice versa)
  7. ENTITY funkcija IS port(
  8.     input : in std_logic_vector (0 to 2);
  9.     output : out std_logic_vector (5 downto 0));
  10. END funkcija;
  11.  
  12. ARCHITECTURE arch OF funkcija IS
  13.     signal a,b,c: std_logic;
  14. BEGIN
  15.     a <= input(0);
  16.     b <= input(1);
  17.     c <= input(2);
  18.    
  19.     output(0) <= a;
  20.     output(1) <= (not a and not b and c) or (not a and b and not c) or (a and b and c) or (a and not b and not c);
  21.     output(2) <= not c;
  22.     output(3) <= (not a and not b and not c) or (not a and c) or a;
  23.     output(4) <= not a or (a and c);
  24.     output(5) <= b and c;
  25.  
  26. END arch;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement