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

Subversion Repositories mipsr2000

[/] [mipsr2000/] [trunk/] [Logic.vhd] - Blame information for rev 51

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

Line No. Rev Author Line
1 16 jimi39
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:   Lazaridis Dimitris
4
-- 
5
-- Create Date:    23:38:50 04/05/2012 
6
-- Design Name: 
7
-- Module Name:    Logic - 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_unsigned.ALL;
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 Logic is
33
Generic
34
(
35
         busw : integer := 31
36
);
37
    Port
38
(
39
                A : in  STD_LOGIC_VECTOR (busw downto 0);
40
           B : in  STD_LOGIC_VECTOR (busw downto 0);
41
           ALUop : in  STD_LOGIC_VECTOR (1 downto 0);
42
           S : out  STD_LOGIC_VECTOR  (busw downto 0)
43
);
44
end Logic;
45
 
46
architecture Behavioral of Logic is
47
--signal sel: STD_LOGIC_VECTOR(1 DOWNTO 0);
48
begin
49
--sel <=ALUop(1 downto 0);
50
 
51
log:process(ALUop,A,B)
52
 
53
         begin
54
 
55
 
56
         CASE ALUop IS
57
              When  "00"  =>  S <= A and B;
58
                        When  "01"  =>  S <= A or  B;
59
         When  "10"  =>  S <= A xor B;
60
         When  "11"  =>  S <= not(A or B);
61
                        When others =>
62
                                        S <= (others =>'0');
63
         end Case;
64
 
65
 
66
 
67
end process log;
68
end Behavioral;
69
 

powered by: WebSVN 2.1.0

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