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

Subversion Repositories mipsr2000

[/] [mipsr2000/] [trunk/] [NPC_mux.vhd] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 jimi39
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    19:46:29 06/24/2012 
6
-- Design Name: 
7
-- Module Name:    NPC_mux - 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
 
23
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity NPC_mux is
33
port (
34
      clk   : in std_logic;
35
                Zero_in,EqNq : in std_logic;
36
                From_N: in std_logic_vector(31 downto 0);
37
                From_A: in std_logic_vector(31 downto 0);
38
                From_M: in std_logic_vector(31 downto 0);
39
                PCSource: in std_logic_vector(1 downto 0);
40
                NPC_out: out std_logic_vector(31 downto 0)
41
 
42
 
43
                );
44
end NPC_mux;
45
 
46
architecture Behavioral of NPC_mux is
47
 
48
begin
49
      process(clk,PCSource,From_N,From_A,From_M,Zero_in)
50
                begin
51
                if (FALLING_EDGE(clk))then
52
           case PCSource is
53
                    when "00" => NPC_out <= From_N;
54
                    when "01" =>
55
                             case EqNq is
56
                                  when '0' =>
57
                                  if Zero_in = '1' then
58
                                  NPC_out <= From_M;
59
                                  else
60
                                  NPC_out <= From_N;
61
                                  end if;
62
                                  when '1' =>
63
                                  if Zero_in = '0' then
64
                                  NPC_out <= From_M;
65
                                  else
66
                                  NPC_out <= From_N;
67
                                  end if;
68
                                  when others => NPC_out <= (others => '0');
69
                                  end case;
70
                         when "10" => NPC_out <= From_A;
71
                         when others => NPC_out <= (others => '0');
72
                end case;
73
      end if;
74
 
75
      end process;
76
 
77
end Behavioral;
78
 

powered by: WebSVN 2.1.0

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