-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmux.v
65 lines (54 loc) · 789 Bytes
/
mux.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module selector41(
input [31:0] iC0,
input [31:0] iC1,
input [31:0] iC2,
input [31:0] iC3,
input [1:0]iS,
output reg [31:0] oZ
);
always @(*)
begin
if(iS==0)
oZ=iC0;
else if(iS==1)
oZ=iC1;
else if(iS==2)
oZ=iC2;
else
oZ=iC3;
end
endmodule
module selector41_5(
input [4:0] iC0,
input [4:0] iC1,
input [4:0] iC2,
input [4:0] iC3,
input [1:0]iS,
output reg [4:0] oZ
);
always @(*)
begin
if(iS==0)
oZ=iC0;
else if(iS==1)
oZ=iC1;
else if(iS==2)
oZ=iC2;
else
oZ=iC3;
end
endmodule
module selector21(
input [31:0] iC0,
input [31:0] iC1,
input iS,
output reg [31:0] oZ
);
always @(*)
begin
if(iS==0)
oZ=iC0;
else
oZ=iC1;
end
endmodule