You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
template toBin(n) { signal input inp; signal output out[n]; var lc1=0;
for (var i = 0; i<n; i++) { out[i] <-- (inp >> i) & 1; out[i] * (out[i] -1 ) === 0; lc1 += out[i] * 2**i; }
lc1 === inp;
}
component toBin(3) main;
|