Add comments.

This commit is contained in:
2018-06-05 23:42:20 -07:00
parent d00131973b
commit 672eae920a
9 changed files with 111 additions and 46 deletions

11
mux4.sv
View File

@@ -1,10 +1,13 @@
/**
* A four-input multiplexer.
*/
module mux4 #(width=32)
(input logic [width-1:0] first, second, third, fourth,
input logic [1:0] select,
output logic [width-1:0] out);
logic [width-1:0] lower, upper;
mux2 lower_mux(
.left(first),
.right(second),
@@ -15,10 +18,10 @@ module mux4 #(width=32)
.right(fourth),
.select(select[0]),
.out(upper));
mux2 final_mux(
.left(lower),
.right(upper),
.select(select[1]),
.out(out));
endmodule
endmodule