-
Notifications
You must be signed in to change notification settings - Fork 0
/
MUX_2to1.v
42 lines (34 loc) · 1.05 KB
/
MUX_2to1.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//0516016 蘇育劭 、 0516225 蔡坤哲
//Subject: CO project 2 - MUX 221
//--------------------------------------------------------------------------------
//Version: 1
//--------------------------------------------------------------------------------
//Writer: 0516016 蘇育劭 、 0516225 蔡坤哲
//----------------------------------------------
//Date:
//----------------------------------------------
//Description:
//--------------------------------------------------------------------------------
module MUX_2to1(
data0_i,
data1_i,
select_i,
data_o
);
parameter size = 0;
//I/O ports
input [size-1:0] data0_i;
input [size-1:0] data1_i;
input select_i;
output [size-1:0] data_o;
//Internal Signals
reg [size-1:0] data_o;
//Main function
always @( * ) begin
case(select_i)
0: data_o <= data0_i;
1: data_o <= data1_i;
default: data_o <= 0;
endcase
end
endmodule