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

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [mux3x1.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 joaocarlos
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    15:02:04 04/19/2012 
6
-- Design Name:    Multiplexer 3 x 1
7
-- Module Name:    mux3x1 - Multiplex 
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
entity mux3x1 is
24
        Generic ( WIDTH : integer := 16 );
25
    Port ( in_a : in  STD_LOGIC_VECTOR (WIDTH-1 downto 0);
26
           in_b : in  STD_LOGIC_VECTOR (WIDTH-1 downto 0);
27
           in_c : in  STD_LOGIC_VECTOR (WIDTH-1 downto 0);
28
           sel : in  STD_LOGIC_VECTOR (1 downto 0);
29
           dataout : out  STD_LOGIC_VECTOR (WIDTH-1 downto 0));
30
end mux3x1;
31
 
32
architecture Multiplex of mux3x1 is
33
begin
34
        process(sel, in_a, in_b, in_c)
35
        begin
36
                case sel is
37
                        when "00" => dataout <= in_a;
38
                        when "01" => dataout <= in_b;
39
                        when "10" => dataout <= in_c;
40
                        when others => dataout <= (others => '0');
41
                end case;
42
        end process;
43
 
44
end Multiplex;
45
 

powered by: WebSVN 2.1.0

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