Files
nand2tetris_verilog/mux8way.v
2024-06-13 17:52:12 -07:00

16 lines
437 B
Verilog

`ifndef _mux8way_v
`define _mux8way_v
`include "mux4way.v"
`include "mux.v"
module Mux8Way (input a, input b, input c, input d, input e, input f, input g, input h, input [2:0] sel, output out);
wire tmp0, tmp1;
Mux4Way u1(.a(a), .b(b), .c(c), .d(d), .sel(sel[1:0]), .out(tmp0));
Mux4Way u2(.a(e), .b(f), .c(g), .d(h), .sel(sel[1:0]), .out(tmp1));
Mux u3(.a(tmp0), .b(tmp1), .sel(sel[2]), .out(out));
endmodule
`endif