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

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [mux3x1.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:    3x1 Multiplexer
7 6 joaocarlos
-- Module Name:    mux3x1 - behavioral 
8 9 joaocarlos
----------------------------------------------------------------------------------
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 mux3x1 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_c   : in  std_logic_vector (WIDTH-1 downto 0);
24
           sink_sel : in  std_logic_vector (1 downto 0);
25
           src_data : out  std_logic_vector (WIDTH-1 downto 0));
26 2 joaocarlos
end mux3x1;
27
 
28 6 joaocarlos
architecture behavioral of mux3x1 is
29 2 joaocarlos
begin
30 6 joaocarlos
        process(sink_sel, sink_a, sink_b, sink_c)
31 2 joaocarlos
        begin
32 6 joaocarlos
                case sink_sel is
33
                        when "00" => src_data <= sink_a;
34
                        when "01" => src_data <= sink_b;
35
                        when "10" => src_data <= sink_c;
36
                        when others => src_data <= (others => '0');
37 2 joaocarlos
                end case;
38
        end process;
39
 
40 6 joaocarlos
end behavioral;
41 2 joaocarlos
 

powered by: WebSVN 2.1.0

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