Skip to content

Instantly share code, notes, and snippets.

@ritog
Created June 13, 2021 07:58
Show Gist options
  • Save ritog/c4e6f5ceb1e7ea2e3ba3601c9de121be to your computer and use it in GitHub Desktop.
Save ritog/c4e6f5ceb1e7ea2e3ba3601c9de121be to your computer and use it in GitHub Desktop.

Revisions

  1. ritog created this gist Jun 13, 2021.
    20 changes: 20 additions & 0 deletions Custom.hdl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // Custom.hdl
    // this is a part of Hashnode blog Convoluted demo

    CHIP Custom {
    IN a, b, c;
    OUT out;

    PARTS:
    Not(in=a, out=nota);
    Not(in=b, out=notb);
    Not(in=c, out=notc);
    And(a=nota, b=notb, out=notanotb);
    And(a=notanotb, b=notc, out=w1);
    And(a=a, b=notb, out=anotb);
    And(a=anotb, b=notc, out=w2);
    And(a=anotb, b=c, out=w3);
    And(a=a, b=b, out=ab);
    And(a=ab, b=notc, out=w4);
    Or8Way(in[0]=w1, in[1]=w2, in[2]=w3, in[3]=w4, out=out);
    }