Doda94

Funkcija

Dec 4th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.85 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.     a: in std_logic;
  9.     b: in std_logic;
  10.     c: in std_logic;
  11.     d: in std_logic;
  12.     f: out std_logic);
  13. END funkcija;
  14.  
  15. ARCHITECTURE arch OF funkcija IS
  16.     signal tmp1 : std_logic;
  17.     signal tmp2 : std_logic_vector(0 to 3);
  18.     signal tmp3 : std_logic_vector(0 to 15);
  19. BEGIN
  20.     tmp1 <= '1';
  21.     tmp2 <= a & b & c & d;
  22.     c1: entity work.dek416e port map (tmp1, tmp2, tmp3);
  23.     f <= tmp3(0) or tmp3(2) or tmp3(3) or tmp3(5) or tmp3(6) or tmp3(7) or tmp3(9) or tmp3(10) or tmp3(11) or tmp3(12);
  24.  
  25. END arch;
Add Comment
Please, Sign In to add comment