Guest User

Untitled

a guest
Apr 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 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 zbrajalo IS PORT(
  8. a: IN STD_LOGIC_VECTOR(7 DOWNTO 0);
  9. b: IN STD_LOGIC_VECTOR(7 DOWNTO 0);
  10. oper: IN STD_LOGIC;
  11. r: OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
  12. cout: OUT STD_LOGIC
  13. );
  14. END zbrajalo;
  15.  
  16. ARCHITECTURE arch OF zbrajalo IS
  17. component primitiv PORT(
  18. a: IN STD_LOGIC_VECTOR(1 DOWNTO 0);
  19. b: IN STD_LOGIC_VECTOR(1 DOWNTO 0);
  20. r: OUT STD_LOGIC_VECTOR(1 DOWNTO 0);
  21. cin: IN STD_LOGIC;
  22. cout: OUT STD_LOGIC;
  23. oper: IN STD_LOGIC
  24. );
  25. end component;
  26. signal i: std_logic_vector(2 downto 0);
  27. BEGIN
  28. f0: primitiv PORT MAP(a(1 downto 0),b(1 downto 0),r(1 downto 0),oper,i(0),oper);
  29. f1: primitiv PORT MAP(a(3 downto 2),b(3 downto 2),r(3 downto 2),i(0),i(1),oper);
  30. f2: primitiv PORT MAP(a(5 downto 4),b(5 downto 4),r(5 downto 4),i(1),i(2),oper);
  31. f3: primitiv PORT MAP(a(7 downto 6),b(7 downto 6),r(7 downto 6),i(2),cout,oper);
  32.  
  33. END arch;
Add Comment
Please, Sign In to add comment