OpenCores
URL https://opencores.org/ocsvn/mips_fault_tolerant/mips_fault_tolerant/trunk

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [source/] [mult_32x32.vhd] - Blame information for rev 34

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 34 jimi39
library IEEE;
2
USE ieee.std_logic_1164.ALL;
3
--USE IEEE.std_logic_arith.all;
4
use IEEE.NUMERIC_STD.ALL;
5
use IEEE.STD_LOGIC_UNSIGNED.ALL;
6
 
7
ENTITY mult_32x32 is
8
  PORT
9
    (
10
     X :IN STD_LOGIC_VECTOR(31 DOWNTO 0);
11
     Y :IN STD_LOGIC_VECTOR(31 DOWNTO 0);
12
     P :OUT STD_LOGIC_VECTOR(63 DOWNTO 0)
13
     );
14
END mult_32x32;
15
 
16
architecture Behavioral of mult_32x32 is
17
 
18
 
19
 
20
begin
21
  process(X,Y)
22
  variable Xuns : unsigned(31 downto 0);  -- unsigned
23
  variable Yuns : unsigned(31 downto 0);  -- unsigned
24
  variable Puns : unsigned(63 downto 0);  -- unsigned
25
  begin
26
  -- type conversion: std_logic_vector -> unsigned
27
 
28
  Xuns := unsigned(X);
29
  Yuns := unsigned(Y);
30
 
31
  -- multiplication
32
  Puns := Xuns * Yuns;
33
 
34
  -- type conversion: unsigned -> std_logic_vector
35
  P <= std_logic_vector(Puns);
36
  end process;
37
end behavioral;
38
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.