Guest User

Untitled

a guest
Apr 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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.  
  18. SIGNAL i: STD_LOGIC_VECTOR(2 DOWNTO 0);
  19.  
  20. BEGIN
  21.  
  22. fa1: entity work.primitiv PORT MAP(a(1 DOWNTO 0),b(1 DOWNTO 0),oper,oper,r(1 DOWNTO 0),i(0));
  23. fa2: entity work.primitiv PORT MAP(a(3 DOWNTO 2),b(3 DOWNTO 2),oper,i(0),r(3 DOWNTO 2),i(1));
  24. fa3: entity work.primitiv PORT MAP(a(5 DOWNTO 4),b(5 DOWNTO 4),oper,i(1),r(5 DOWNTO 4),i(2));
  25. fa4: entity work.primitiv PORT MAP(a(7 DOWNTO 6),b(7 DOWNTO 6),oper,i(2),r(7 DOWNTO 6),cout);
  26.  
  27. END arch;
Add Comment
Please, Sign In to add comment