nand2/01_Boolean_Logic/DMux.v

22 lines
317 B
Coq
Raw Normal View History

2023-01-11 10:13:09 +00:00
/**
* Demultiplexor:
* {a, b} = {in, 0} if sel == 0
* {0, in} if sel == 1
*/
`default_nettype none
module DMux(
input in,
input sel,
2023-01-11 10:13:09 +00:00
output a,
output b
2023-01-11 10:13:09 +00:00
);
// Put your code here:
wire nsel;
2023-01-11 10:13:09 +00:00
Not NOT1(sel, nsel);
And AND1(in, sel, b);
And AND2(in, nsel, a);
2023-01-11 10:13:09 +00:00
endmodule