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

Subversion Repositories opencpu32

[/] [opencpu32/] [trunk/] [hdl/] [opencpu32/] [Multiplexer3_1.vhd] - Blame information for rev 47

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 leonardoar
--! @file
2
--! @brief 3:1 Mux using with-select
3
 
4
--! Use standard library
5
library IEEE;
6
use IEEE.STD_LOGIC_1164.ALL;
7
 
8
--! Use CPU Definitions package
9
use work.pkgOpenCPU32.all;
10
 
11
--! Mux 3->1 circuit can select one of the 2 inputs into one output with some selection signal
12
 
13
--! Detailed description of this 
14
--! mux design element.
15
entity Multiplexer3_1 is
16
    generic (n : integer := nBits - 1);                                 --! Generic value (Used to easily change the size of the Alu on the package)
17
         Port ( A : in  STD_LOGIC_VECTOR (n downto 0);           --! First Input
18
           B : in  STD_LOGIC_VECTOR (n downto 0);                --! Second Input
19
           C : in  STD_LOGIC_VECTOR (n downto 0);                --! Third Input
20 47 leonardoar
           sel : in dpMuxAluIn;                                                         --! Select inputs (fromMemory, fromImediate, fromRegFileA)
21 27 leonardoar
           S : out  STD_LOGIC_VECTOR (n downto 0));      --! Mux Output
22
end Multiplexer3_1;
23
 
24
--! @brief Architure definition of the MUX
25
--! @details On this case we're going to use VHDL combinational description
26
architecture Behavioral of Multiplexer3_1 is
27
 
28
begin
29
        with sel select
30 47 leonardoar
                S <= A when fromMemory,
31
                          B when fromImediate,
32
                          C when fromRegFileA,
33 27 leonardoar
                          (others => 'Z') when others;
34
 
35
end Behavioral;
36
 

powered by: WebSVN 2.1.0

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