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.

24 lines
392 B

5 years ago
  1. template Main() {
  2. signal input in;
  3. signal output out[2];
  4. // First play with variables;
  5. var c = 3;
  6. var d = c++; // d --> 3
  7. var e = ++c; // e --> 5
  8. out[0] <== in + e; // in + 5
  9. // Then play with signals
  10. c = in;
  11. d = c++; //d <-- in;
  12. e = ++c; // d <-- in+2
  13. out[1] <== in + e; // 2*in +2
  14. }
  15. component main = Main();