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

Subversion Repositories avs_aes

[/] [avs_aes/] [trunk/] [rtl/] [VHDL/] [mux2.vhd] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ruschi
--------------------------------------------------------------------------------
2 10 ruschi
-- This file is part of the project  avs_aes
3
-- see: http://opencores.org/project,avs_aes
4 2 ruschi
--
5
-- description: Mux2, 2-Port-N-Bit Bit Mulitplexer
6
--
7
-------------------------------------------------------------------------------
8
--
9
-- Author(s):
10
--         Thomas Ruschival -- ruschi@opencores.org (www.ruschival.de)
11
--
12
--------------------------------------------------------------------------------
13
-- Copyright (c) 2009, Authors and opencores.org
14
-- All rights reserved.
15
--
16
-- Redistribution and use in source and binary forms, with or without modification,
17
-- are permitted provided that the following conditions are met:
18
--    * Redistributions of source code must retain the above copyright notice,
19
--    this list of conditions and the following disclaimer.
20
--    * Redistributions in binary form must reproduce the above copyright notice,
21
--    this list of conditions and the following disclaimer in the documentation
22
--    and/or other materials provided with the distribution.
23
--    * Neither the name of the organization nor the names of its contributors
24
--    may be used to endorse or promote products derived from this software without
25
--    specific prior written permission.
26
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
31
-- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
36
-- THE POSSIBILITY OF SUCH DAMAGE
37
-------------------------------------------------------------------------------
38
-- version management:
39 20 ruschi
-- $Author::                                         $
40
-- $Date::                                           $
41
-- $Revision::                                       $
42 2 ruschi
-------------------------------------------------------------------------------
43
 
44
 
45
library ieee;
46
use ieee.std_logic_1164.all;
47
 
48
entity mux2 is
49
        generic (
50
                IOwidth : POSITIVE := 32                        -- width of I/O ports
51
                );
52
        port (
53
                inport_a : in  STD_LOGIC_VECTOR (IOwidth-1 downto 0);  -- port 1
54
                inport_b : in  STD_LOGIC_VECTOR (IOwidth-1 downto 0);  -- port 2
55
                selector : in  STD_LOGIC;               -- switch to select ports
56
                outport  : out STD_LOGIC_VECTOR (IOwidth-1 downto 0)   -- output
57
                );
58
end mux2;
59
 
60
 
61
architecture arch1 of mux2 is
62
 
63
begin  -- arch1
64
 
65
        -- purpose: switch the ports
66
        -- type   : combinational
67
        -- inputs : selector,inport_a,inport_b
68
        -- outputs: outport
69
        muxing : process (inport_a, inport_b, selector)
70
        begin  -- PROCESS selector
71
                -- default behaviour to avoid latch
72
                outport <= inport_a;
73
                case selector is
74
                        when '0' =>
75
                                outport <= inport_a;
76
                        when '1' =>
77
                                outport <= inport_b;
78
                        when others =>
79
                                --pragma synthesis_off
80
                                report "!! selector in arch1 of mux2 has strange value !!" severity warning;
81
                                --pragma synthesis_on
82
                end case;
83
        end process muxing;
84
 
85
end arch1;

powered by: WebSVN 2.1.0

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