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

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Hardware/] [MIPS32_Standalone/] [Mux4.v] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
`timescale 1ns / 1ps
2
/*
3
 * File         : Mux4.v
4
 * Project      : University of Utah, XUM Project MIPS32 core
5
 * Creator(s)   : Grant Ayers (ayers@cs.utah.edu)
6
 *
7
 * Modification History:
8
 *   Rev   Date         Initials  Description of Change
9
 *   1.0   7-Jun-2011   GEA       Initial design.
10
 *
11
 * Standards/Formatting:
12
 *   Verilog 2001, 4 soft tab, wide column.
13
 *
14
 * Description:
15
 *   A 4-input Mux of variable width, defaulting to 32-bit width.
16
 */
17
module Mux4 #(parameter WIDTH = 32)(
18
        input  [1:0] sel,
19
        input  [(WIDTH-1):0] in0, in1, in2, in3,
20
        output reg [(WIDTH-1):0] out
21
        );
22
 
23
        always @(*) begin
24
                case (sel)
25
                        2'b00 : out <= in0;
26
                        2'b01 : out <= in1;
27
                        2'b10 : out <= in2;
28
                        2'b11 : out <= in3;
29
                endcase
30
        end
31
 
32
endmodule

powered by: WebSVN 2.1.0

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