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

Subversion Repositories xucpu

[/] [xucpu/] [trunk/] [VHDL/] [mux2to1/] [mux2to1.vhdl] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lcdsgmtr
-- Copyright 2015, Jürgen Defurne
2
--
3
-- This file is part of the Experimental Unstable CPU System.
4
--
5
-- The Experimental Unstable CPU System Is free software: you can redistribute
6
-- it and/or modify it under the terms of the GNU Lesser General Public License
7
-- as published by the Free Software Foundation, either version 3 of the
8
-- License, or (at your option) any later version.
9
--
10
-- The Experimental Unstable CPU System is distributed in the hope that it will
11
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
13
-- General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16
-- along with Experimental Unstable CPU System. If not, see
17
-- http://www.gnu.org/licenses/lgpl.txt.
18
 
19
 
20
LIBRARY IEEE;
21
USE IEEE.STD_LOGIC_1164.ALL;
22
 
23
LIBRARY UNISIM;
24
USE UNISIM.VComponents.ALL;
25
 
26
ENTITY mux2to1 IS
27
 
28
  GENERIC (
29
    width : NATURAL := 16);
30
 
31
  PORT (
32
    I0 : IN  STD_LOGIC_VECTOR(width - 1 DOWNTO 0);
33
    I1 : IN  STD_LOGIC_VECTOR(width - 1 DOWNTO 0);
34
    S  : IN  STD_LOGIC;
35
    O  : OUT STD_LOGIC_VECTOR(width - 1 DOWNTO 0));
36
 
37
END mux2to1;
38
 
39
--ARCHITECTURE Behavioral OF mux2to1 IS
40
 
41
--BEGIN
42
 
43
--  MUX1 :
44
--  FOR i IN width - 1 DOWNTO 0 GENERATE
45
--    MUXF7_inst : MUXF7
46
--      PORT MAP (O  => O(i),
47
--                I0 => I0(i),
48
--                I1 => I1(i),
49
--                S  => S);
50
--  END GENERATE MUX1;
51
 
52
--END Behavioral;
53
 
54
ARCHITECTURE instantiated OF mux2to1 IS
55
 
56
BEGIN
57
 
58
  MUX1 :
59
  FOR i IN width - 1 DOWNTO 0 GENERATE
60
    MUX : LUT6
61
      GENERIC MAP (INIT => X"FF00F0F0CCCCAAAA")
62
      PORT MAP(I0 => I0(i),
63
               I1 => I1(i),
64
               I2 => '0',
65
               I3 => '0',
66
               I4 => S,
67
               I5 => '0',
68
               O  => O(i));
69
  END GENERATE MUX1;
70
 
71
END instantiated;

powered by: WebSVN 2.1.0

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