Merge pull request #5 from udibr/multiplexer
fixed Multiplexer name and usage of old syntax
This commit is contained in:
commit
d91afa804a
|
@ -90,12 +90,17 @@ template Decoder(w) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template Multiplexor(wIn, nIn) {
|
template Multiplexer(wIn, nIn) {
|
||||||
signal input inp[nIn][wIn];
|
signal input inp[nIn][wIn];
|
||||||
signal input sel;
|
signal input sel;
|
||||||
signal output out[wIn];
|
signal output out[wIn];
|
||||||
component Decoder(nIn) dec;
|
component dec = Decoder(nIn);
|
||||||
component EscalarProduct(nIn) ep[wIn];
|
component ep[wIn];
|
||||||
|
|
||||||
|
for (var k=0; k<wIn; k++) {
|
||||||
|
ep[k] = EscalarProduct(nIn);
|
||||||
|
}
|
||||||
|
|
||||||
sel ==> dec.inp;
|
sel ==> dec.inp;
|
||||||
for (var j=0; j<wIn; j++) {
|
for (var j=0; j<wIn; j++) {
|
||||||
for (var k=0; k<nIn; k++) {
|
for (var k=0; k<nIn; k++) {
|
||||||
|
@ -106,7 +111,3 @@ template Multiplexor(wIn, nIn) {
|
||||||
}
|
}
|
||||||
dec.success === 1;
|
dec.success === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
component Multiplexor(8,3) main;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue