Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 04/16/2019 01:02:49 PM
  6. -- Design Name:
  7. -- Module Name: inm_float - 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 inm_float is
  35. Port ( clk : in STD_LOGIC;
  36. x : in STD_LOGIC_VECTOR (31 downto 0);
  37. y : in STD_LOGIC_VECTOR (31 downto 0);
  38. rst : in STD_LOGIC;
  39. start : in STD_LOGIC;
  40.  
  41. r : out STD_LOGIC_VECTOR (31 downto 0));
  42. end inm_float;
  43.  
  44. architecture Behavioral of inm_float is
  45.  
  46. signal rez_m : std_logic_vector (51 downto 0) := (others => '0');
  47. signal term : std_logic := '0';
  48. signal plus_x : std_logic_vector (25 downto 0) := (others => '0');
  49. signal plus_y : std_logic_vector (25 downto 0) := (others => '0');
  50. signal do_op : std_logic := '0';
  51.  
  52. begin
  53.  
  54. process(x,y)
  55. begin
  56. if (x = x"00000000" or y = x"00000000") then
  57. do_op <= '0';
  58. r <= x"00000000";
  59. elsif (term = '1') then
  60. do_op <= '0';
  61. else
  62. do_op <= '1';
  63. end if;
  64. end process;
  65.  
  66. plus_x <= "01" & x (23 downto 0);
  67. plus_y <= "01" & y (23 downto 0);
  68.  
  69. INM_MANTISE: entity WORK.inm_gen generic map (n => 26) port map(
  70. Clk => clk,
  71. Rst => rst,
  72. Start => do_op,
  73. X => plus_x,
  74. Y => plus_y,
  75. A => rez_m,
  76. Term => term );
  77.  
  78.  
  79.  
  80. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement