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

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [mux2x1.vhd] - Blame information for rev 12

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

Line No. Rev Author Line
1 2 joaocarlos
----------------------------------------------------------------------------------
2 9 joaocarlos
-- Engineer: Joao Carlos Nunes Bittencourt
3
----------------------------------------------------------------------------------
4
-- Create Date:    13:18:18 03/06/2012 
5
----------------------------------------------------------------------------------
6
-- Design Name:    2x1 Multiplexer
7
-- Module Name:    mux2x1 - behavioral 
8
----------------------------------------------------------------------------------
9
-- Project Name:   16-bit uRISC Processor
10
----------------------------------------------------------------------------------
11 2 joaocarlos
-- Revision: 
12 9 joaocarlos
--      1.0 - File Created
13
--      2.0 - Project refactoring
14 2 joaocarlos
--
15
----------------------------------------------------------------------------------
16
library ieee;
17
use ieee.std_logic_1164.all;
18
 
19
entity mux2x1 is
20 6 joaocarlos
        generic ( WIDTH : integer := 16 );
21
    port ( sink_a   : in std_logic_vector (WIDTH-1 downto 0);
22
           sink_b   : in std_logic_vector (WIDTH-1 downto 0);
23
           sink_sel : in std_logic_vector (0 downto 0); -- FIXME
24
           src_data : out std_logic_vector (WIDTH-1 downto 0)
25
    );
26 2 joaocarlos
end mux2x1;
27
 
28
architecture Primitive of mux2x1 is
29
begin
30 6 joaocarlos
        process(sink_sel, sink_a, sink_b)
31 2 joaocarlos
        begin
32 6 joaocarlos
                case sink_sel is
33
                        when "0" => src_data <= sink_a;
34
                        when "1" => src_data <= sink_b;
35
                        when others => src_data <= (others => '0');
36 2 joaocarlos
                end case;
37
 
38
        end process;
39
end Primitive;
40
 

powered by: WebSVN 2.1.0

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