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

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [mux2x1.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:    22:26:49 04/18/2012 
6
-- Design Name: 
7
-- Module Name:    mux2x1 - 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
entity mux2x1 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
           sel : in std_logic_vector (0 downto 0); -- FIXME
28
           dataout : out std_logic_vector (WIDTH-1 downto 0));
29
end mux2x1;
30
 
31
architecture Primitive of mux2x1 is
32
begin
33
        process(sel, in_a, in_b)
34
        begin
35
                case sel is
36
                        when "0" => dataout <= in_a;
37
                        when "1" => dataout <= in_b;
38
                        when others => dataout <= (others => '0');
39
                end case;
40
 
41
        end process;
42
end Primitive;
43
 

powered by: WebSVN 2.1.0

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