-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb09e6a
commit edf381f
Showing
3 changed files
with
77 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
/* Design of 4-1 mux using binary module pattern */ | ||
module mux_4_1(input_1, input_2, input_3, input_4, select, mux_output); | ||
|
||
parameter N = 32; | ||
|
||
/* ----- Inputs ----- */ | ||
input wire [N-1:0] input_1, input_2, input_3, input_4; | ||
input wire [1:0] select; | ||
|
||
/* ----- Outputs ----- */ | ||
output logic [N-1:0] mux_output; | ||
|
||
/* ----- Submodules ----- */ | ||
logic [N-1:0] block_1_out ; | ||
mux_2_1 block_1(.input_1(input_1), .input_2(input_3), .select(select[1]), .mux_output(block_1_out) ); | ||
|
||
logic [N-1:0] block_2_out ; | ||
mux_2_1 block_2(.input_1(input_2), .input_2(input_4), .select(select[1]), .mux_output(block_2_out) ); | ||
|
||
logic [N-1:0] block_3_out ; | ||
mux_2_1 block_3(.input_1(block_1_out), .input_2(block_2_out), .select(select[0]), .mux_output(mux_output) ); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters