Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. // This file is part of www.nand2tetris.org
  2. // and the book "The Elements of Computing Systems"
  3. // by Nisan and Schocken, MIT Press.
  4. // File name: projects/01/DMux.hdl
  5.  
  6. /**
  7. * Demultiplexor:
  8. * {a, b} = {in, 0} if sel == 0
  9. * {0, in} if sel == 1
  10. */
  11.  
  12. CHIP DMux {
  13. IN in, sel;
  14. OUT a, b;
  15.  
  16. PARTS:
  17. Not(in=sel, out=notsel);
  18. And(a=in, b=notsel, out=a);
  19. And(a=in, b=sel, out=b);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement