URL
https://opencores.org/ocsvn/ourisc/ourisc/trunk
[/] [ourisc/] [trunk/] [rtl/] [common/] [mux4x1.vhd] - Blame information for rev 10
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: 4x1 Multiplexer
|
7 |
|
|
-- Module Name: mux4x1 - 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 mux4x1 is
|
20 |
|
|
generic (
|
21 |
|
|
WIDTH : integer := 16 );
|
22 |
|
|
port (
|
23 |
6 |
joaocarlos |
sink_a : in std_logic_vector (WIDTH-1 downto 0);
|
24 |
|
|
sink_b : in std_logic_vector (WIDTH-1 downto 0);
|
25 |
|
|
sink_c : in std_logic_vector (WIDTH-1 downto 0);
|
26 |
|
|
sink_d : in std_logic_vector (WIDTH-1 downto 0);
|
27 |
|
|
sink_sel : in std_logic_vector (1 downto 0);
|
28 |
|
|
src_data : out std_logic_vector (WIDTH-1 downto 0) );
|
29 |
2 |
joaocarlos |
end mux4x1;
|
30 |
|
|
|
31 |
|
|
architecture Multiplex of mux4x1 is
|
32 |
|
|
begin
|
33 |
6 |
joaocarlos |
process(sink_sel, sink_a, sink_b, sink_c)
|
34 |
2 |
joaocarlos |
begin
|
35 |
6 |
joaocarlos |
case sink_sel is
|
36 |
|
|
when "00" => src_data <= sink_a;
|
37 |
|
|
when "01" => src_data <= sink_b;
|
38 |
|
|
when "10" => src_data <= sink_c;
|
39 |
|
|
when "11" => src_data <= sink_d;
|
40 |
|
|
when others => src_data <= (others => '0');
|
41 |
2 |
joaocarlos |
end case;
|
42 |
|
|
end process;
|
43 |
|
|
|
44 |
|
|
end Multiplex;
|
45 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.