Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. PACKAGE Panican_Fall2019_CSC343_AdderSubtractor IS
  4. COMPONENT ssd_decoder IS
  5. GENERIC (n : INTEGER := 4);
  6. PORT
  7. (
  8. is_signed : IN STD_LOGIC;
  9. bit_num : IN STD_LOGIC_VECTOR (n - 1 DOWNTO 0);
  10. ssd_out : OUT STD_LOGIC_VECTOR (55 DOWNTO 0)
  11. );
  12. END COMPONENT;
  13. COMPONENT one_full_adder IS
  14. PORT (
  15. a, b, cin : IN STD_LOGIC;
  16. sum, carry : OUT STD_LOGIC
  17. );
  18. END COMPONENT;
  19. COMPONENT n_full_adder IS
  20. GENERIC (n : INTEGER := 2);
  21. PORT (
  22. a, b : IN STD_LOGIC_VECTOR (n - 1 DOWNTO 0);
  23. cin : IN STD_LOGIC;
  24. s : OUT STD_LOGIC_VECTOR (n - 1 DOWNTO 0);
  25. cout : OUT STD_LOGIC
  26. );
  27. END COMPONENT;
  28. COMPONENT n_full_subtractor IS
  29. GENERIC (n : INTEGER := 4);
  30. PORT (
  31. a, b : IN std_logic_vector (n - 1 DOWNTO 0);
  32. cin : IN std_logic;
  33. sum : OUT std_logic_vector (n - 1 DOWNTO 0);
  34. cout, negative, overflow, zero, SLT, SLTU : OUT std_logic
  35. );
  36. END COMPONENT;
  37. COMPONENT sign_extend IS
  38. GENERIC (n : INTEGER := 2);
  39. PORT (
  40. a : IN std_logic_vector(n - 1 DOWNTO 0);
  41. start_switch : IN std_logic;
  42. a_out : OUT std_logic_vector((n * 2) - 1 DOWNTO 0)
  43. );
  44. END COMPONENT;
  45. COMPONENT add_subtract_immediate IS
  46. GENERIC (n : INTEGER := 4);
  47. PORT (
  48. a : IN std_logic_vector(n - 1 DOWNTO 0);
  49. b : IN std_logic_vector(n/2 - 1 DOWNTO 0);
  50. cin : IN std_logic;
  51. cout, overflow, zero, negative : OUT std_logic;
  52. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  53. );
  54. END COMPONENT;
  55. COMPONENT four_full_adder IS
  56. PORT (
  57. a, b : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
  58. cin : IN STD_LOGIC;
  59. s : OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
  60. cout : OUT STD_LOGIC
  61. );
  62. END COMPONENT;
  63. COMPONENT n_bitwise_and IS
  64. GENERIC (n : INTEGER := 4);
  65. PORT (
  66. a, b : IN std_logic_vector(n - 1 DOWNTO 0);
  67. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  68. );
  69. END COMPONENT;
  70. COMPONENT n_bitwise_nor IS
  71. GENERIC (n : INTEGER := 4);
  72. PORT (
  73. a, b : IN std_logic_vector(n - 1 DOWNTO 0);
  74. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  75. );
  76. END COMPONENT;
  77. COMPONENT n_bitwise_xor IS
  78. GENERIC (n : INTEGER := 4);
  79. PORT (
  80. a, b : IN std_logic_vector(n - 1 DOWNTO 0);
  81. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  82. );
  83. END COMPONENT;
  84. COMPONENT n_bitwise_or IS
  85. GENERIC (n : INTEGER := 4);
  86. PORT (
  87. a, b : IN std_logic_vector(n - 1 DOWNTO 0);
  88. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  89. );
  90. END COMPONENT;
  91. COMPONENT n_bitwise_shift_left IS
  92. GENERIC (n : INTEGER := 4);
  93. PORT (
  94. a : IN std_logic_vector(n - 1 DOWNTO 0);
  95. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  96. );
  97. END COMPONENT;
  98. COMPONENT n_bitwise_shift_right IS
  99. GENERIC (n : INTEGER := 4);
  100. PORT (
  101. a : IN std_logic_vector(n - 1 DOWNTO 0);
  102. result : OUT std_logic_vector(n - 1 DOWNTO 0)
  103. );
  104. END COMPONENT;
  105. END PACKAGE Panican_Fall2019_CSC343_AdderSubtractor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement