|
|
|
|
|
|
Signal signalName; // Defines an unnamed signal
Signal signalName( 1, "DisplayName" ); // Define one named signal ("DisplayName")
|
Examples:
Signal a; // Unnamed
Signal a(1, "MySignal"); // The signal is identified as "a" and
// displayed with the name "MySignal"
Sig(a, 1); // The signal is identified as "a" and
// displayed with the name "a"
|
|
|
Signal signalName[N]; // Unnamed
Sig( signalName, N ); // Named (shorthand)
|
Examples:
Signal x[4]; // Defines: x[0], x[1], x[2], x[3]
Sig( x, 4 ); // Defines: x[0], x[1], x[2], x[3]
|
|
|
|
ComponentName ( Coord, Input-Signal(s), Output-Signal(s), other-params ) ;
|
Note:
|
Sig(sw0,1);
Sig(sw1,1);
Sig(out,1);
Switch ( "aa", sw0, 'a', Zero ); // Location = "aa", name = sw0, key = 'a'
Switch ( "ca", sw1, 'b', One ); // Initial value: Zero or One
And ( "bb", (sw0,sw1), out ); // And: inputs = (sw0,sw1), output = out
Probe ( "bc", out ); // Probe out
|
Placement of the various components:
|
|
Sig(signalX,1);
Component1( coord1, ..., signalX );
// SignalX is the output signal of Component1
Component2( coord2, signalX, ... );
// SignalX is the input signal of Component2
|
Signal sw0, sw1, out;
Switch ( "aa", sw0, 'a', Zero );
^^
Output signal of a switch
Switch ( "ca", sw1, 'b', One );
^^
Output signal of a switch
And ( "bb", (sw0,sw1), out );
^^^^^^^
Input signals of the And gate
Probe ( "bc", out );
|
Resulting connection made by the red signals:
|
|
|
Example:
And ( "bb", ...., out ); // output = out Or ( "bc", ...., out ); // output = out |
How to run the program:
|
Error message:
|
|
|
Press the function key F5 and you will see the following:
|
|
|
you can group some of the signals together:
( signal1, signal2, ..., signalN ) = a group of signals A group of signal "counts" as ONE single signal !! |
This is just like Java:
{
Statement1;
Statement2; // "Counts" as ONE single statement !!!
...
StatementN;
}
|
|
How to run the program:
|
|
Sig( a, 10 ); // Define a range of signals: a[0] ... b[9]
Sig( b, 5 ); // Define signals: b[0] .. b[4]
|
(a[0]-a[3]) means: a[0], a[1], a[2], a[3] (4 signals !) (a[3]-a[0]) means: a[3], a[2], a[1], a[0] (4 signals !) (a[0],a[3]) means: a[0], a[3] (2 signals !) (a[3],a[0]) means: a[3], a[0] (2 signals !) |