Initial commit. Working CPU!

This commit is contained in:
2018-06-05 00:06:45 -07:00
commit 6bceee5e68
6 changed files with 178 additions and 0 deletions

24
mux4.sv Executable file
View File

@@ -0,0 +1,24 @@
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),
.select(select[0]),
.out(lower));
mux2 upper_mux(
.left(third),
.right(fourth),
.select(select[0]),
.out(upper));
mux2 final_mux(
.left(lower),
.right(upper),
.select(select[1]),
.out(out));
endmodule