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

Subversion Repositories rtf68ksys

[/] [rtf68ksys/] [trunk/] [rtl/] [verilog/] [mux4to1.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 robfinch
// (C) 2007  Robert T Finch
2
// All Rights Reserved.
3
//
4
// Verilog 1995
5
//
6
// Webpack 9.1i  xc3s1000-4ft256
7
//  slices /  LUTs / MHz
8
 
9
module mux4to1(e, s, i0, i1, i2, i3, z);
10
        parameter WID=4;
11
        input e;
12
        input [1:0] s;
13
        input [WID:1] i0;
14
        input [WID:1] i1;
15
        input [WID:1] i2;
16
        input [WID:1] i3;
17
        output [WID:1] z;
18
        reg [WID:1] z;
19
 
20
        always @(e or s or i0 or i1 or i2 or i3)
21
                if (!e)
22
                        z <= {WID{1'b0}};
23
                else begin
24
                        case(s)
25
                        2'b00:  z <= i0;
26
                        2'b01:  z <= i1;
27
                        2'b10:  z <= i2;
28
                        2'b11:  z <= i3;
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.