...
 
Commits (1)
......@@ -187,28 +187,29 @@ Wires Wires::operator||(const Wires &w) const // MAX
Wires Wires::operator~() const /* INV */
{
Wires r(size(),type());
for(int i=0;i<size();i++)
{
switch(get(i))
{
case FALSE:
case PULLDOWN:
r.set(i,TRUE);
break;
case MAYBE:
case PULLMID:
r.set(i,MAYBE);
break;
case TRUE:
case PULLUP:
r.set(i,FALSE);
break;
default:
r.set(i,INVALID);
}
}
return r;
int n = size();
Wires r(n,type());
for(int i=0;i<n;i++)
{
switch(get(i))
{
case FALSE:
case PULLDOWN:
r.set(i,TRUE);
break;
case MAYBE:
case PULLMID:
r.set(i,MAYBE);
break;
case TRUE:
case PULLUP:
r.set(i,FALSE);
break;
default:
r.set(i,INVALID);
}
}
return r;
}
/* Connection bodies */
......
This diff is collapsed.
......@@ -65,25 +65,26 @@ class MyUnit : public Entity
int main()
{
Wire<5> a;
Wire<32> b;
Wire<5> a = "11111";
Wire<32> b = FALSE;
Wire<1> signal,out;
Signal signal2;
Uint<32> u;
Sint<32> s;
s[0] = TRUE;
b[31] = FALSE;
s = b&&u;
Sint<32> s = 0;
s[31] = TRUE;
b[0] = TRUE;
Uint<32> u = b || s;
Sint<5> small = -16;
signal = MAYBE;
signal2 = TRUE;
out = signal & signal2;
cout << "small=" << small << " (" << small.binarize() << ")" << endl;
cout << "signal=" << signal << endl;
cout << "signal2=" << signal2 << endl;
cout << "out=" << out << endl;
cout << "a=" << a << endl;
cout << "b=" << b << endl;
cout << "u=" << u << endl;
cout << "s=" << s << endl;
cout << "u=" << u << endl;
System *sys = System::getInstance();
class Unit1 : public MyUnit
......