Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 03/21/2019 10:25:30 AM
  6. -- Design Name:
  7. -- Module Name: sum_8b - 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 sum_8b is
  35. Port ( x : in STD_LOGIC_VECTOR (7 downto 0);
  36. y : in STD_LOGIC_VECTOR (7 downto 0);
  37. tin : in STD_LOGIC;
  38. s : out STD_LOGIC_VECTOR (7 downto 0);
  39. tout : out STD_LOGIC);
  40. end sum_8b;
  41.  
  42. architecture Behavioral of sum_8b is
  43.  
  44. signal p : std_logic_vector (3 downto 0) := "0000";
  45. signal g : std_logic_vector (3 downto 0) := "0000";
  46. signal t : std_logic_vector (3 downto 0) := "0000";
  47.  
  48. begin
  49.  
  50. sum_10: entity WORK.sum_2b port map (
  51. x => x (1 downto 0),
  52. y => y (1 downto 0),
  53. t => tin,
  54. s => s (1 downto 0),
  55. p => p(0),
  56. g => g(0));
  57.  
  58. sum_32: entity WORK.sum_2b port map (
  59. x => x (3 downto 2),
  60. y => y (3 downto 2),
  61. t => t(0),
  62. s => s (3 downto 2),
  63. p => p(1),
  64. g => g(1));
  65.  
  66. sum_54: entity WORK.sum_2b port map (
  67. x => x (5 downto 4),
  68. y => y (5 downto 4),
  69. t => t(1),
  70. s => s (5 downto 4),
  71. p => p(2),
  72. g => g(2));
  73.  
  74. sum_76: entity WORK.sum_2b port map (
  75. x => x (7 downto 6),
  76. y => y (7 downto 6),
  77. t => t(2),
  78. s => s (7 downto 6),
  79. p => p(3),
  80. g => g(3));
  81.  
  82. gen_t0: entity WORK.gen_t port map(
  83. p => p,
  84. g => g,
  85. t0 => tin,
  86. t => t);
  87.  
  88. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement