Guest User

Untitled

a guest
Dec 10th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 06.12.2018 18:37:00
  6. -- Design Name:
  7. -- Module Name: Full_adder - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool Versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20.  
  21.  
  22. library IEEE;
  23. use IEEE.STD_LOGIC_1164.ALL;
  24.  
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx leaf cells in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity Full_adder is
  35. Port ( a : in STD_LOGIC;
  36. b : in STD_LOGIC;
  37. cin : in STD_LOGIC;
  38. s : out STD_LOGIC;
  39. cout : out STD_LOGIC);
  40. end Full_adder;
  41.  
  42. architecture Behavioral of Full_adder is
  43.  
  44. signal s2, c2, c1 : std_logic;
  45. begin
  46.  
  47. HA1: entity work.half_adder port map (
  48. a => cin,
  49. b => s2,
  50. c => c1,
  51. s => s
  52. );
  53.  
  54.  
  55. HA2: entity work.half_adder port map(
  56. a => a,
  57. b => b,
  58. s => s2,
  59. c => c2
  60. );
  61.  
  62. cout <= c1 or c2;
  63.  
  64.  
  65. end Behavioral;
Add Comment
Please, Sign In to add comment