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

Subversion Repositories mips_fault_tolerant

[/] [mips_fault_tolerant/] [trunk/] [source/] [Mult_out.vhd] - Blame information for rev 33

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 32 jimi39
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:       Lazaridis Dimitris
4
-- 
5
-- Create Date:    22:57:38 07/25/2012 
6
-- Design Name: 
7
-- Module Name:    Mult_out - 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
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
--use IEEE.STD_LOGIC_ARITH.ALL;
23
--use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
-- Uncomment the following library declaration if using
25
-- arithmetic functions with Signed or Unsigned values
26
--use IEEE.NUMERIC_STD.ALL;
27
 
28
-- Uncomment the following library declaration if instantiating
29
-- any Xilinx primitives in this code.
30
--library UNISIM;
31
--use UNISIM.VComponents.all;
32
 
33
entity Mult_out is
34
     port (
35
                clk : in std_logic;
36
                          rst,Mult_en : in  STD_LOGIC;
37
                          Mul_out_c : in STD_LOGIC_VECTOR (1 downto 0);
38
                          A_in : in STD_LOGIC_VECTOR (31 downto 0);
39
                Hi_to_out : in STD_LOGIC_VECTOR (31 downto 0);
40
                          Lo_to_out : in STD_LOGIC_VECTOR (31 downto 0);
41
                          Hi_out : out STD_LOGIC_VECTOR (31 downto 0);
42
                          Lo_out : out STD_LOGIC_VECTOR (31 downto 0)
43
                  );
44
end Mult_out;
45
 
46
architecture Behavioral of Mult_out is
47
 
48
begin
49
 
50
                process(clk,rst,Mult_en,Mul_out_c,A_in,Hi_to_out,Lo_to_out)
51
                 begin
52
                      If (RISING_EDGE(clk)) then
53
                                if rst = '0' then
54
                                    Lo_out <= (others => '0');
55
                                         Hi_out <= (others => '0');
56
                                else
57
              if Mult_en = '1' then
58
                                  case Mul_out_c is
59
                                    when "00" =>
60
                                    Hi_out <= Hi_to_out;
61
                                         Lo_out <= Lo_to_out;
62
                when "01" =>
63
                                         Lo_out <= A_in;
64
                                         when "10" =>
65
                                         Hi_out <= A_in;
66
                                         when others =>
67
                                         Hi_out <= (others => '0');
68
                                         Lo_out <= (others => '0');
69
                          end case;
70
                          end if;
71
           END IF;
72
           end if;
73
                 end process;
74
 
75
end Behavioral;
76
 

powered by: WebSVN 2.1.0

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