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

Subversion Repositories signed_unsigned_multiplier_and_divider

[/] [signed_unsigned_multiplier_and_divider/] [trunk/] [mux16to4.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 zpekic
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    16:50:59 02/13/2016 
6
-- Design Name: 
7
-- Module Name:    mux16to4 - structural 
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
-- Uncomment the following library declaration if using
24
-- arithmetic functions with Signed or Unsigned values
25
--use IEEE.NUMERIC_STD.ALL;
26
 
27
-- Uncomment the following library declaration if instantiating
28
-- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32
entity mux16to4 is
33
    Port ( a : in  STD_LOGIC_VECTOR (3 downto 0);
34
           b : in  STD_LOGIC_VECTOR (3 downto 0);
35
           c : in  STD_LOGIC_VECTOR (3 downto 0);
36
           d : in  STD_LOGIC_VECTOR (3 downto 0);
37
           sel : in  STD_LOGIC_VECTOR (1 downto 0);
38
                          nEnable : in  STD_LOGIC;
39
           y : out  STD_LOGIC_VECTOR (3 downto 0));
40
end mux16to4;
41
 
42
architecture behavioral of mux16to4 is
43
begin
44
        mux: process(nEnable, sel, a, b, c, d)
45
        begin
46
                if (nEnable = '0') then
47
                        case sel is
48
                                when "00" =>
49
                                        y <= a;
50
                                when "01" =>
51
                                        y <= b;
52
                                when "10" =>
53
                                        y <= c;
54
                                when "11" =>
55
                                        y <= d;
56
                                when others =>
57
                                        null;
58
                        end case;
59
                else
60
                        y <= "ZZZZ";
61
                end if;
62
        end process;
63
end behavioral;

powered by: WebSVN 2.1.0

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