Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
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.

36 line
788B

  1. FullAdder::FullAdder()
  2. {
  3. w1.ConnectInput(ha1,0);
  4. w1.ConnectOutput(ha2,0);
  5. w2.ConnectInput(ha1,1);
  6. w2.ConnectOutput(A,0);
  7. w3.ConnectInput(ha2,1);
  8. w3.ConnectOutput(A,1);
  9. }
  10. FullAdder::~FullAdder() {}
  11. void FullAdder::ChangeInput (State s, int pin)
  12. {
  13. if (pin==0) ha2.ChangeInput(s,1);
  14. if (pin==1) ha1.ChangeInput(s,1);
  15. if (pin==2) ha1.ChangeInput(s,0);
  16. }
  17. void FullAdder::Action () {}
  18. void FullAdder::ConnectInput (Wire& w, int pin)
  19. {
  20. // Wird von Connect-Funktion des Drahtes aufgerufen
  21. if (pin==0) ha2.ConnectInput(w,1);
  22. if (pin==1) ha1.ConnectInput(w,1);
  23. if (pin==2) ha1.ConnectInput(w,0);
  24. }
  25. void FullAdder::ConnectOutput (Wire& w, int pin)
  26. {
  27. // Wird von Connect-Funktion des Drahtes aufgerufen
  28. if (pin==0) ha2.ConnectOutput(w,0);
  29. if (pin==1) A.ConnectOutput(w,0);
  30. }