Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 03/15/2018 10:15:11 AM
  6. -- Design Name:
  7. -- Module Name: 8BitRippleCarryFulladder - 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 EightBitFulladder is
  35. Port ( Ain : in STD_LOGIC_VECTOR (7 downto 0);
  36. Bin : in STD_LOGIC_VECTOR (7 downto 0);
  37. Cin : in STD_LOGIC;
  38. Cout : out STD_LOGIC;
  39. ResultOut : out STD_LOGIC_VECTOR (7 downto 0);
  40. CLK : in STD_LOGIC);
  41. end EightBitFulladder;
  42.  
  43. Architecture EightBitFulladder of adder8 is
  44. signal c1, c2, c3, c4 : Std_logic;
  45. signal c5, c6, c7 : Std_logic;
  46.  
  47.  
  48. component Fulladder
  49. Port ( Ain : in STD_LOGIC;
  50. Bin : in STD_LOGIC;
  51. Cin : in STD_LOGIC;
  52. Sout : out STD_LOGIC;
  53. Cout : out STD_LOGIC
  54. );
  55. end component Fulladder;
  56. begin
  57. U32_0: entity WORK.Fulladder port map (Ain <= Ain[0], Bin <= Bin[0], Cin <= Cin, Cout <= c1, Sout <= ResultOut[0]);
  58. U32_1: entity WORK.Fulladder port map (Ain <= Ain[1], Bin <= Bin[1], Cin <= c1, Cout <= c2, Sout <= ResultOut[1]);
  59. U32_2: entity WORK.Fulladder port map (Ain <= Ain[2], Bin <= Bin[2], Cin <= c2, Cout <= c3, Sout <= ResultOut[2]);
  60. U32_3: entity WORK.Fulladder port map (Ain <= Ain[3], Bin <= Bin[3], Cin <= c3, Cout <= c4, Sout <= ResultOut[3]);
  61. U32_4: entity WORK.Fulladder port map (Ain <= Ain[4], Bin <= Bin[4], Cin <= c4, Cout <= c5, Sout <= ResultOut[4]);
  62. U32_5: entity WORK.Fulladder port map (Ain <= Ain[5], Bin <= Bin[5], Cin <= c5, Cout <= c6, Sout <= ResultOut[5]);
  63. U32_6: entity WORK.Fulladder port map (Ain <= Ain[6], Bin <= Bin[6], Cin <= c6, Cout <= c7, Sout <= ResultOut[6]);
  64. U32_7: entity WORK.Fulladder port map (Ain <= Ain[7], Bin <= Bin[7], Cin <= c7, Cout <= Cout, Sout <= ResultOut[7]);
  65.  
  66.  
  67. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement