Skip to content

Commit

Permalink
Merge pull request #5 from udibr/multiplexer
Browse files Browse the repository at this point in the history
fixed Multiplexer name and usage of old syntax
  • Loading branch information
jbaylina authored May 11, 2019
2 parents 1da1f58 + 39bb716 commit d91afa8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions circuits/multiplexer.circom
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ template Decoder(w) {
}


template Multiplexor(wIn, nIn) {
template Multiplexer(wIn, nIn) {
signal input inp[nIn][wIn];
signal input sel;
signal output out[wIn];
component Decoder(nIn) dec;
component EscalarProduct(nIn) ep[wIn];
component dec = Decoder(nIn);
component ep[wIn];

for (var k=0; k<wIn; k++) {
ep[k] = EscalarProduct(nIn);
}

sel ==> dec.inp;
for (var j=0; j<wIn; j++) {
for (var k=0; k<nIn; k++) {
Expand All @@ -106,7 +111,3 @@ template Multiplexor(wIn, nIn) {
}
dec.success === 1;
}

component Multiplexor(8,3) main;


0 comments on commit d91afa8

Please sign in to comment.