Files
nand2tetris_verilog/dmux.v
2024-06-13 18:55:53 -07:00

18 lines
312 B
Verilog

`ifndef _dmux_v
`define _dmux_v
`include "not.v"
`include "and.v"
module DMux (input in, input sel, output a, output b);
wire sel_bar;
wire a_sel;
wire b_sel;
Not u1 (.in(sel), .out(sel_bar));
And u2 (.a(in), .b(sel_bar), .out(a));
And u3 (.a(in), .b(sel), .out(b));
endmodule
`endif