restructure and add ipi texs

This commit is contained in:
2019-11-06 18:24:04 +01:00
parent e21da561fc
commit 8fd8d2a485
155 changed files with 129 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
Or::Or()
{
a=b=c=0; // nix angschlossen
actionFlag=false;
}
Or::~Or() {}
void Or::ChangeInput (State s, int pin)
{
// Sorge dafuer, dass Gatter neu berechnet wird, wenn
// alle Zustaende der Eingaenge (Draehte) festliegen
if (!actionFlag)
{
Sim.StoreCircuitEvent(*this);
actionFlag=true;
}
}
void Or::Action ()
{
// Lese Eingangssignale
State A = a->GetState();
State B = b->GetState();
State Output=unknown;
// Wertetabelle
if (A==low && B==low) Output=low;
if (A==high|| B==high) Output=high;
// Setze Draht
if (c!=0) c->ChangeState(Sim.GetTime()+3,Output);
// erlaube neue Auswertung
actionFlag=false;
}
void Or::ConnectInput (Wire& w, int pin)
{
// Wird von Connect-Funktion des Drahtes aufgerufen
if (pin==0) a = &w;
if (pin==1) b = &w;
}
void Or::ConnectOutput (Wire& w, int pin)
{
// Wird von Connect-Funktion des Drahtes aufgerufen
c = &w;
}