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

Subversion Repositories ourisc

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

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 6 joaocarlos
        generic ( WIDTH : integer := 16 );
25
    port ( sink_a   : in std_logic_vector (WIDTH-1 downto 0);
26
           sink_b   : in std_logic_vector (WIDTH-1 downto 0);
27
           sink_sel : in std_logic_vector (0 downto 0); -- FIXME
28
           src_data : out std_logic_vector (WIDTH-1 downto 0)
29
    );
30 2 joaocarlos
end mux2x1;
31
 
32
architecture Primitive of mux2x1 is
33
begin
34 6 joaocarlos
        process(sink_sel, sink_a, sink_b)
35 2 joaocarlos
        begin
36 6 joaocarlos
                case sink_sel is
37
                        when "0" => src_data <= sink_a;
38
                        when "1" => src_data <= sink_b;
39
                        when others => src_data <= (others => '0');
40 2 joaocarlos
                end case;
41
 
42
        end process;
43
end Primitive;
44
 

powered by: WebSVN 2.1.0

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