IC Pascal
IC Pascal
IC 11/17/2017
1. Name of the IC
2. Information text of the IC
3. Pin number and pin arrangement
4. Family (Standard, LS, L, HC ...)
5. Test algorithm
The first four points are pure information blocks which appear on the
screen during testing or when the user demands information.
The fifth point, the test algorithm, is the actual IC-PASCAL test
program and is executed by the integrated IC-PASCAL interpreter
when required; consequently it tests out the electronic components.
Each of the five blocks is assigned a key name beginning with a
"#":
1. #NAME
2. #TEXT
3. #PIN
4. #FAMILY
5. #PROGRAM
1
IC_Pascal.IC 11/17/2017
Let's look at a few short examples which will help you to get
to grips with IC-PASCAL. Using your text editor create the file
"TEST.IC". In future we will write our test programs in this
file.
#NAME TEST1
#PROGRAM
BEGIN
WRITE ('IC-Tester V1.3');
WAIT;
END.
Store this file on a disk or hard disk. Now exit the text
editor program and load this file into the IC tester software
using the function "Load". You can now start the program at
any time with the function "Test" and by entering the name
"Test1". The IC-PASCAL-Interpreter will then open a small
window in which 'IC-Tester V1.3' appears. Thus the statement
'WRITE' opens the window and writes the following text. The
'WAIT'statement keeps the text on the screen; the interpreter
closes all windows after a program has been executed and so the
text would only be visible for a fraction of a second. Naturally
the information text and pin arrangement window remains blank
during the program execution as there is no data available for
this (#TEXT or #PIN !). For the same reason nothing will be
2
IC_Pascal.IC 11/17/2017
#NAME TEST2
#PROGRAM
BEGIN
WRITE ('IC-Tester V1.3');
WRITE ('------------------');
WAIT;
END.
After starting this program (please observe that you must now
enter 'TEST2') you will notice that the intepreter has not done
what one might expect: both texts are read out next to each
and not under one another. The reason for this is that the
'WRITE' command leaves the cursor after the first text and does
not position it at the beginning of the next line. This can be
remedied with the 'WRITELN' command (Write Line), which transports
the cursor to the beginning of the next line.
In addition several expressions can be written out with a single
'WRITE'- or 'WRITELN' command. The individual sequences are
separated by a comma, e.g. WRITELN (1+2,3+4,5+6).
Perhaps you have already noticed how important the semi-colon
is after statements; without this statement separater the
intepreter cannot distinguish between two statements and
indicates 'Syntax Error'.
3.2. Simple Arithmetic Expressions
----------------------------------
As well as text expressions, arithmetic expressions can also be
displayed on the screen using the 'WRITE'- or 'WRITELN' statement.
Please enter the following example:
#NAME TEST3
#PROGRAM
BEGIN
WRITELN (100);
WRITELN (100+100);
WRITELN (100-100);
WRITELN (100*100);
WRITELN (100 DIV 100);
WAIT;
END.
You will see that the computer tries to evaluate texts which
are not set in inverted commas. If certain computation rules
are not observed this can easily lead to program errors (e.g.
division by zero).
Please note that in IC PASCAL the word 'DIV'is used for
division and not the oblique line '/'. The interpreter only
carries out integer division because, as mentioned above, it
can only process integer numbers; i.e. 5 DIV 2 equals 2 and not
2.5; 5/2 however, must result in 2.5.
You can obtain the division remainder by employing the
operator 'MOD'; 5 MOD 2 equals 1 (5-(5 DIV 2)*2=1 !).
The normal algebriac conventions apply to IC-PASCAL, so
multiplications and divisions take priority over additions and
subtractions. In the case of 3+4*5 , four is multiplied by 5 and
then 3 is added to this product: 3+4*5 = 3+(4*5) = 3+20 = 23.
3
IC_Pascal.IC 11/17/2017
Note:
Numerical values can be processed binary, hexadecimally or
decimally. A % symbol must be placed before binary number values
and a $ symbol before hexadecimal number values. Decimal number
values are not specially marked. A numerical example illustrates
this:
%01010101 = $55 = 85
BEGIN
A:=3;
B:=4;
C:=5;
WRITELN (A+B*C);
WAIT;
END.
In the program TEST4 the interpreter assigns the values 3,
4 and 5 to the variables A, B and C. Then B and C are
multiplied (see 3.2) and A is added to this product giving
a result of 23.
If you have slightly more difficulty working with variables
and arithmetical terms then try to change the last two
program examples a little. You will soon see - practice makes
perfect!
If the 26 variables prove to be insufficient the user can
turn to an array containing 256 variables having the name
'MEMORY' or simply 'MEM'.
The variables (the value range corresponds to the variables
A-Z) are numbered in series from 0 to 255. This number is
written in square brackets behind the word 'MEMORY' or 'MEM';
for example MEM[100] or MEM[125].
The following example illustrates this:
#NAME TEST5
4
IC_Pascal.IC 11/17/2017
#PROGRAM
BEGIN
MEM[0]:=3;
MEM[1]:=4;
MEM[2]:=5;
WRITELN (MEM[0]+MEM[1]*MEM[2]);
WAIT;
END.
BEGIN
FOR I:=10 TO 25 DO
WRITELN (I);
WAIT;
END.
The very first thing that the program TEST6 does is assign
the value 10 (the initial value) to the variable I. Then the
statement WRITELN (I) is executed. Following this I is incremented
by one and compared to 25. If I is less than or equal to 25 the
intepreter executes the WRITELN (I) command again and so on until
I exceeds 25; the final value. The numbers 10 to 25 then appear as
the result on the screen.
It is also possible to allow a variable count down using the
statement 'DOWNTO':
#NAME TEST7
#PROGRAM
BEGIN
FOR I:=25 DOWNTO 10 DO
WRITELN (I);
WAIT;
END.
In TEST7 the variable I is checked to see if it is greater than or
equal to the final value, if it is the variable is decremented
5
IC_Pascal.IC 11/17/2017
#PROGRAM
BEGIN
FOR I:=0 TO 25 BY 5 DO
WRITELN (I);
WAIT;
END.
The program example TEST8 reads out all numbers from 0 to
25 with a step extent of 5; thus 0, 5, 10, 15, 20 und 25.
Please note that not only the variable I can be used as
control variable but every available variable in IC-PASCAL!
As mentioned above the interpreter only carries out one
command with the FOR-TO-DO statement; to execute a whole
sequence of statements in this form the statements must be
bracketed with the markers 'BEGIN' and 'END'.
#PROGRAM
BEGIN
FOR I:=1 TO 10 DO
BEGIN
WRITELN (I);
WRITELN (I);
END;
WAIT;
END.
The program example TEST9 writes each number from 1 to 10
twice, one below the other. If the markers 'BEGIN'and 'END' were
omitted, then the numbers would only be written once and the last
one twice.
= is equal to
<> is not equal to
< is less than
6
IC_Pascal.IC 11/17/2017
#PROGRAM
BEGIN
I:=10;
WHILE I<=25 DO
I:=I+1;
WAIT;
END.
#NAME TEST11
#PROGRAM
BEGIN
I:=10;
WHILE I<=25 DO
BEGIN
WRITELN (I);
I:=I+1;
END;
WAIT;
END.
7
IC_Pascal.IC 11/17/2017
BEGIN
I:=10;
REPEAT
WRITELN (I);
I:=I+1;
UNTIL I>25;
WAIT;
END.
#NAME TEST13
#PROGRAM
BEGIN
FOR I:=1 TO 100 DO
IF I=50 THEN WRITELN (I);
WAIT;
END.
8
IC_Pascal.IC 11/17/2017
#PROGRAM
BEGIN
FOR I:=1 TO 100 DO
IF I=50 THEN WRITELN (I)
ELSE WRITE ('*');
WAIT;
END.
In TEST14, as in TEST13, the FOR-TO-DO loop is
repeated 100 times. The IF-THEN statement checks every time
if the variable I has a value of 50; if this is the case
then, as in the previous example, I is written up on the
screen and the next loop iteration is undertaken. Other-
wise the command following 'ELSE'is executed and an '*'
appears on the screen.
9
IC_Pascal.IC 11/17/2017
#PROGRAM
BEGIN
PIN[7] : GND;
PIN[14] : +5V;
PIN[1] : INPUT;
PIN[2] : INPUT;
PIN[3] : OUTPUT;
...
...
END.
I Bit 1 Bit 0
10
IC_Pascal.IC 11/17/2017
-----------------
0 0 0
1 0 1
2 1 0
3 1 1
The assignment of individual bits to pins results using
the '&'command (sequential assignment), therefore
PIN[1] & PIN[2]:=I;
#NAME 7400,SN7400
#PIN 14
#PROGRAM
BEGIN
PIN[1] : INPUT;
PIN[2] : INPUT;
PIN[3] : OUTPUT;
PIN[7] : GND;
PIN[14] : +5V;
FOR I:=0 TO 3 DO
BEGIN
PIN[1] & PIN[2]:=I;
IF PIN[3]<>(PIN[1] NAND PIN[2]) THEN ERROR(1);
END;
ERROR(0);
END.
In this program the FOR TO DO loop causes the variable to
run from 0 to 3. PIN[1] and PIN[2] are assigned the lowest
bits from I at every iteration; PIN[1] bit 1 and PIN[2] bit 0.
Therefore PIN[1] and PIN[2] assume all possible combinations.
The next line checks whether PIN[3] corresponds to the NAND
operation of PIN[1] and [2], and if this is not the case (<> !),
the statement ERROR(1) is executed. In a way 'ERROR(1)' replaces
the WAIT command, only that here the program is terminated
and the message 'IC Defect' appears on the screen. The statement
'ERROR(0)' informs the user when an IC is operational: this
terminates the program too, but in this case 'IC OK'is displayed.
11
IC_Pascal.IC 11/17/2017
BEGIN
PIN[1,2,4,5,9,10,12,13] : INPUT;
PIN[3,6,8,11] : OUTPUT;
PIN[7] : GND;
PIN[14] : +5V;
FOR I:=0 TO 3 DO
BEGIN
PIN[1] & PIN[2]:=I;
PIN[4] & PIN[5]:=I;
PIN[9] & PIN[10]:=I;
PIN[12] & PIN[13]:=I;
IF PIN[3]<>(PIN[1] NAND PIN[2]) THEN ERROR(1);
IF PIN[6]<>(PIN[4] NAND PIN[5]) THEN ERROR(1);
IF PIN[8]<>(PIN[9] NAND PIN[10]) THEN ERROR(1);
IF PIN[11]<>(PIN[12] NAND PIN[13]) THEN ERROR(1);
END;
ERROR(0);
END.
#PROGRAM
BEGIN
PIN[2,3,5,6,8,9,11,12] : INPUT;
PIN[1,4,10,13] : OUTPUT;
PIN[7] : GND;
PIN[14] : +5V;
FOR I:=0 TO 3 DO
BEGIN
PIN[2]&PIN[3]:=I;
PIN[5]&PIN[6]:=I;
PIN[8]&PIN[9]:=I;
PIN[11]&PIN[12]:=I;
LOADMODEON;
PIN[1,4,10,13] : LOAD HIGH;
IF PIN[1]<>(PIN[2] NAND PIN[3]) THEN ERROR(1);
12
IC_Pascal.IC 11/17/2017
PIN[5,6,4] : RC;
...
PIN[5,6,4] : RC OFF;
The following seven combinations are possible:
R R/C C
-------------
PIN 5 6 4
PIN +5V 4 3
PIN +5V 9 8
PIN +5V 14 13
PIN +5V 16 14
PIN +5V 17 16
PIN +5V 16 17
'+5V' at R means that the respective pin must be the +5V
voltage-carrying pin. If the voltage supply has not been
assigned at that point an error message appears on the screen.
13
IC_Pascal.IC 11/17/2017
14