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.

26 lines
402 B

4 years ago
  1. template Main() {
  2. signal input in;
  3. signal output out[3];
  4. if (in == 0) {
  5. out[0] <-- 1; // TRUE
  6. }
  7. if (in != 0) {
  8. out[0] <-- 0;
  9. }
  10. if (in == 1) {
  11. out[1] <-- 1; // TRUE
  12. } else {
  13. out[1] <-- 0;
  14. }
  15. if (in == 2) {
  16. out[2] <-- 1;
  17. } else {
  18. out[2] <-- 0; // TRUE
  19. }
  20. }
  21. component main = Main();