Texas Instruments CC-40 A Collection Of Information

A
Collection
of
Information
c
an
The
CC-
-40
Computer
fey
Palmer
0.
Hanson,
Jr.
June
1985
This
collection
is
a
compilation
of
articles
on
the
CC-4-0
which
appeared
in
the
1983
and
1984
issues
of
TI
PPG
Notes.
This material is not copyrighted and may be reproduced for
personal
use.
In/hen
material
is
used
elsewhere
we ask as a
matter of courtesy that
TI
PPC
Notes
be
mentioned.
The
use
of the material in this compilation is entirely at the risk of the
user.
No responsibility as
to
the accuracy and the
consequences
due
to
the
lack
of
it
will
be
borne
by
either
the
club
or
the
editor.
Volume
8,
Number
3 *
May/June
1983
The BIG NEWS is the Texas Instruments Compact
Computer,
40 (CC-40).
Maurice Swinnen and I had received engineering models some time ago for
evaluation. As a result this issue of TI PPC Notes contains
our
pre
liminary impressions together with some sample programs. There seems
to be
an
emphasis
on
scientific applications as
evidenced
by
thirteen
(sometimes
fourteen)
digit
arithmetic,
trigonometric
functions
such as
arcsin and arccos, use of trigonometric arguments in radians, degrees,
or grads,
and
the like. A
calculator
mode
is
provided
which
has
an
unexpected quirk for a TI machine (see page
5)-
Example speed checks
show that
the
CC-40
is much
faster
than
the
TI-59-
The keyboard is
small—too
small to touch type, but large enough to not feel cramped.
The
CC-40
is not a pocket computer—but then neither are most other
so-called "pocket" computers, unless one is talking about.the pockets
in
the
winter
overcoatsofRussian
infantrymen.
The
announcementsTaf
the peripherals describe a^complete.capability including Wafertape drives for recording, RS-232 interfaces for printing, and even a video
interface which will circumvent one of the
major
limitations
of
the
baseline
CC-40,
namely the
single
line,
display.
It is downright
difficult to debug programs without a printer and only a single line
display. While the CC-40 is now available from retailers the periph
erals
are
not, at least
not
in
the Tampa
Bay
area.
V8N3
P23
THE
CC-40^-
Maurice
Swinnen
writes:
The
CC-40
is a good computer
...
the
keyboard is smaller than the one on the typewriter. It
has a lot of one-keystroke entries for programming such as PRINT,
FOR,
NEXT,
etc.
The Basic is enhanced by a lot of subprograms which you
can reach by
CALL
XXXXX.
All information on memory mapping is given
such that it is easy to do assembly language programming. It has
both
CALL
PEEK
and
CALL
POKE
commands,
plus
a
CALL
DEBUG. I
wrote
several
programs—JIVE TURKEY and
others.
Because I sorely missed
a printer I concocted
an
RS-232 interface and
now
I
can
use.any
printer on
it.
(Editor's
Note:
Late news releases from TI indicate
that
peripherals
for
the
CC-40
should
be
available.
As I
write
this
the CC-40 is available
in
retail stores in this area,
but
the peripherals
are not.)
lfoe
speed on
the
CC-40*
is much
faster
than on the 59$ of
course.
Count
ing from 1
to
100
was
fast
this
time,
too
fast to clock
directly.
So
I put it in a loop and let it
count
to
100 one hundred
times.
That
took 34 seconds, which makes the time for counting to 100 equal to
0.34 seconds. Not bad? Then I tried to compute factorials. The
highest
factorialIcould
generate
directly
before
overflow
was
84.
It took exactly
1-.37
seconds, again measured in a loop-of 100 for
accuracy.
Editor's
Note:
Maurice's JIVE TURKEY program appears on the following
page.
I
have
also
had
an
engineering
model
of
the
CC-40
for
about
a month, and performed other speed comparisons. The keyboard is what
TI
calls
a.3/4
keyboard,
meaning
it
is
3/4
the
distance
between
the
keys relative
to
a full size
keyboard.
That means it is essentially
impossible
to
touch
type*
The
HP-75
has
approximately a
0.8
keyboard.
Touch typing is trying at best. The Radio Shack Model 100 has a full
size keyboard.
/
TI
PPC NOTES
V8N3P24
JIVE
TURKEY
an the CC-40. Maurice E.T.
Suinnen
100 DISPLAY AT(6)"* JIVE TURKEY GAME *":PAUSE 2 110 SCORE=Q:FIB=0:RANDOMIZE:SECRET=INTRND(100)
120 DISPLAY ERASE ALL"PROBABILITY OF
TRUTH?
0-100? ;
130
ACCEPT AT(29)BEEP VALIDATE(DIGIT);PROB
140 ROLL=INTRND(100):SC0RE=SC0RE+1:DISPLAY"YOUR
GUES?
0-100";
150
ACCEPT
AT(20)BEEP
VALIDATE(DIGIT);GUESS:IF
GUESS=SECRET THEN 190
160 IF PROB>ROLL THEN FLAG=1 ELSE FLAG =0:IF FLAG=0 THEN FIB=FIB+1 170 IF
GUESSOECRET
THEN IF FLAG=1 THEN 240 ELSE 230
180 IF GUESS>SECRET THEN IF FLAG=1 THEN 230 ELSE 240
190
PRINT»CONGRATULATIONS!
YOU
DID
IT!":PAUSE
3
200
DISPLAY
AT
(3)"SC0RE=";SC0RE,"#OFFIBS=";FIB:PAUSE
210
DISPLAY"SAME
GAME
AGAIN?
Y/N";:ACCEPT AT(22)BEEP VALIDATE("YNyn"),ANSWERS
220 IF
ANSUER$="Y"
OR
ANSWER$="y"
THEN
110
ELSE
250
230
PRINT"GUESS
TOO
HIGH":PAUSE
1:G0T0
140
240
PRINT"GUESS
TOO LOW"".PAUSE
1:G0T0
140
250
DISPLAY AT(5)ERASE ALL"BYE,
HAVE
A NICE DAY!":PAUSE 3:END
PALINDROMIC
NUMBERS
IN BASIC -
Palmer
Hanson.
Page
6
of
this
issue
reports
the
results
of
some
exten
sive
tests
of
the
TI-59
generating
palindromic
numbers
using
digit
reverser
techniques.
Albert
Smith
found
23
numbers
between
1
and
1900
which
would
not
reach
a
palindromic
number
within
the
range
of
the
TI-59.
I
wrote
the
following
BASIC
program
for
the
CC-40
to
investigate
those
numbers
further.
10
INPUT
"fl$
«";fl*
15
N « 9
.
20
L •
LEN<
fl$
>
25
6$
s
""
30
FOR
I = L TO 1
STEP
-1
35
B$
* B-$ &
SEG*<fl$,ia>
40
NEXT
I
50
IF
fl$
B$
THEN
290
100
C*
""••R10
* 0
'
105
FOR I = L TO 1
STEP
-1
110
fl •
VflL<SEG*<fi**Iil>>
+
VflL<SEG*<B*,
I,l>>
+
fU0
115
IF
fl > 9
THEN
C * fl -
10
ELSE
C • fl
120
C$
»
STR$<C>
8<
C$
125
IF
1=1
> 9
THEN
1=110
* 1
ELSE
fll0
- 0
135
NEXT
I
140
IF
fllO
- 1
THEN
C*
-
"1"
fc
C*
145
N.«
N + 1
150
PRINT
N
155
fl*
*
C$
160
GOTO
20
200
PRINT
fl*;N
210
PAUSE
10
220
GOTO
10
999
END
TI PPC NOTES
V8N3P25
PALINDROMIC NUMBERS IN BASIC (cont)
The program
uses
digit by
digit
string manipulation such that its
operation is independent of the word length of an individual computer.
Variations of the program were also
run
on a Radio Shack Color Computer,
a Radio
Shack
TRS-80
Model
100
Portable
Computer,
and
an
Apple.
The
relative execution times to change 89 into 8813200023188 in 24 steps
were
i
TI-59
in normal mode 4 min 51 sec
TI-59
in EE mode 4 min 37 sec
TI-58C in normal mode 6 min 7 sec
CC-40 27
seconds
Color Computer 18 seconds
Apple 10 seconds
Model
100
18
seconds
With the insertion of a CLEAR 1024 command at line number 5 the string
limitation
which
limited
the
number
of
iterations
to
about
140
was
removed
with
the
Model
100
and
raised
to
about
580
iterations.
Tests
showed
that not one of the 23
numbers
listed on page 6 would reach
a palindromic number where the final number
prior
to
string
overflow
was 255 digits long! I also noticed that there was a pattern in the
numbers
1495
through
1857
on page 6 which suggested that
the
numbers
1945
and
1947
would
also
fail
to
yield
a
palindromic
number,
and
verified
that
with
the
Model
100.
FINDING PI IN BASIC - Palmer
Hanson.
The CC-40 implementation of BASIC
provides
a PI
function
and
permits
the
arguments
for the trigonometric functions to be entered in
-degrees,
radians, or
grads—one indication of the
emphasis
on scientific useage for the
CC-40.
For those BASIC mechanizations which do not provide a PI function and
which are limited to radian
arguments
for the trigonometric functions
the programmer
often
wants the value of PI
for
use
in
conversions
from
degrees to radians. An old programmer's trick which recovers the value
of PI to the accuracy of the individual machine is to
use
the
function
PI
=
4*ATN(l).
I
had
used
that
technique
satisfactorily
on
many
com
puters
until
I
encountered
the Radio
Shack
Model
100.
When
using
the
conversion
factor
derived
from
ATN(l)A5
(equivalent
to
4*ATN(l)/l80)
I found that
the
cosine
of 60
degrees
was returned as .5000000001147 f
Which is
simply
not
consistent
with a fourteen digit
machine.
After
some
experimentation
I
found
that the
use
of
a
conversion
factor
de
rived
from
ATN(3E13)/90
would
result
in
the
cosine
of
60
degrees
being
returned as
.49999999999998
—respectable accuracy in anyone's
book.
Similar improvements in the accuracy of the trigonometric functions on
the Model 100 were found for other functions and other arguments. I
have tentatively concluded that the ATN
function
on
the -Model 100 is weak.
With this information in hand I decided to
examine*
the capability of
other calculators and computers to evaluate pi. I found a wide range
of capability ranging from the nine digit capability of the Apple
II,
the
Radio
Shack
Color
Computer
and
the
Atari
400,
through
the
ten
digit
capability pf the HP product line of programmable calculators to the
fourteen digit capability of the Model 100t The table on the following
page
summarizes
my
experience.
TI
PPC
NOTES
V8N3P26
DERIVING
PI
IN
BASIC
(cont)
From
4*ATN(1)
From
2*ATN(N)
AMS-55
Reference
.3.1^15
92553
58979
3.1415
92653
58979
Commodore
VIC-20
3.1415
9266
3.1415
9266
Color
Computer
3.1415
9266
3.1415
9266
Apple
II
3.1^15
9266
3.1415
9266
Atari
400
3.1415
9267
3.1415
9264
HP-11
3.1415
92654
3.1415
92654
TI-57
3.1415
92653
2
3.1415
92653
6
TI-55H
&
TI-57LCD
3.1415
92653
5
3.1415
92653
4
TI-58/58C/59
3.1415
92653
588
3.1415
92653
590
TI-99/4A
3.1415
92653
59
3.1415
92653
59
CC-40
3.1415
92653
59
3.1415
92653
59
Model
100
3.1415
92653
1932
3.141.5
92653
5898
In
the table the N in 2*ATN(N) is a number sufficiently large
such
tnat
no
further
changes
in
ATN(N)
will
occur
with
larger
N.
For
the
Model
100 that value is about
3E13.
For the CC-40 that value is about
2E12.
For
the
TI
programmable
calculators
and
the
CC-40
the
values
listed
are
those internal to the machine
not
those displayed.
The
predominance
of
TI
machines,
including
the
CC-40,
at
the
high
accuracy
end
of
the
table
is
as
expected.
The
CC-40
also
provides
the
arcsin
ahd'arccos
functions
which
are
not
available
on
the
other
"home"
computers—one more
instance
of attention to scientific applications.
TI
PPC
NOTES
V9N4P7
FOURTEEN
DIGITS
OF
PI
FROM
THE
99/4
AND
CC-40
-
Myer
Boland
"Finding-Piin
BASIC"
in
V8N3P26
reported
that
both
the
TI-99/4A
and
the
CC-40
returned
the
twelve
digits
3«l4l5
92653
59
in
response
to
the BASIC instruction P = 4*ATN(l) . Myer Boland reports that one
can
recover
fourteen
digits
with
the
equation
P =
4000*ATN(1)
on
the
TI-99/4A,
andIverify
the
same
result,
with
the
CC-40j
Pi
x
1000
exact
4000*ATN(1>
3141.5 92653 58979 3
3141.5 92653 5898
Unfortunately,
at
least
on
the
CC-40,
if one
tries
to.
convert
to
the
value
of
pi,
not
lOOOxpi,
by
dividing
the
result
by
1000,
the
end
result
reverts
to
the
twelve
digit
value
3.1415
92653
59
.
This
is
one more illustration of the kind of results
which
occur
with
BASIC,
but
which,
we would not expect with the typical calculator.
TI PPC NOTES V8N3P5
A CC-40 QUIRK - Palmer Hanson. The
second
chapter
of
the TI Compact
Computer User's Guide describes
how
to use the CC-40
as a calculator. The discussion of chain calculations on page 2-8
cautions "•..A loss of accuracy occasionally results when you chain
calculations. See Appendix F for accuracy information. ...H The
discussion of accuracy in Appendix F begins with a discussion of
the
5/4
rounding
technique
which
will
remind
the
TI-58/59
user
of
a similar discussion on page C-l of Personal Programming. As with
the TI-58/59 the
CC-40
uses a minimum of 13 digits to perform
calculations and rounds the results to 10 digits for the normal
display
format.
Actually,
some
calculations
are
carried
to
14
digits as in the example on page F-l:
2/3=
.66666666666667
and
1/3
=
.33333333333333
2/3-1/3
-
1/3
=
.00000000000001
which
is
dispalyed
as
l.E-14
Note that both fractions yield fourteen digit values. Furthermore,
the
fraction
2/3
yields
a 7 in
the
fourteenth
of
least
significant
place.
The
TI
calculators
have
typically
yielded
a 6 in
the
least
significant place of the display register in response to the
sequence 2 DIV 3 = . The fact that the TI calculators truncated
to
the
display
register
was
sometimes
useful.
An
example
appeared
in
my
article
"There's
Gold
in
Those
Guard
Digits"
in
the
May/June
1982
issue
of
PPX
Exchange»
where
I
described
the
use
of
the
truncation feature to implement an effective integer function when
a thirteen digit integer was divided by a small integer such that
the quotient still had a thirteen digit number to the left of the
decimal point*
Now
if
we'alter
the
sequence
above
slightly
in
order
to
view
the
intermediate
result,
say
to the
sequence
2/3
ENTER
-1/3-1/3
ENTER
then the result in the display will be 3.334E-11 . Insertion of
= before each ENTER will not change the result. Investigation
will
reveal
that
the
different
result
occurs
because
the
ENTER
command
causes
the
calculator
mode
to
truncate
to
the
display
value.
TI-58/59
users
will
recognize
this
effect
as
being
similar
to
the
use of an EE-INV-EE sequence to truncate to the display value. If
one
performs
the
sequence
2
DIV
3 =
EE
INV
EE
- 1
DIV
3-1
DIV
3 =
with a
TI-58
or
TI-59
the
result will be 3.34E-11 where the
difference
from
the CC-40
result
above is due to the
use
of
fourteen
dibits
by
the
CC-40
and
thirteen
digits
by
the
TI-58/59.
This
effect
of
the
interruption of a chain calculation
to
display an intermediate
result
is
an
important
difference
between
the
use of
the
CC-40
in
the calculator
ftiode
and the use of TI calculators. The equivalent
sequence in a BASIC mode does not yield the truncation effect. The
sequence y s 2/3
PRINT
Y
.x = Y -
1/3
-
1/3
PRINT
X
yields l.E-14 in the
display.
We will discuss other aspects of
accuracy of the CC-40 in future
issues.
TI
PPC
NOTES
V8N4P10
CC-40
GRAPHICS
-
Maurice
Swinnen.
These
whimsical little programs
illustrate the use of the CHAR command
(page
5-15
of the
CC-40
User's
Guide
to generate user defined characters.
The characters are then called in sequence to provide
an
illusion
of motion. The first program moves a character across the screen
while performing the old "jumping
jack"
exercise. The second
program
uses
seven
characters
(all
that
are
allowed)
to
generate
a "soccer" figure which moves the
"ball
back
and
forth across the
screen.
JUMPIHi
^JFIOK
100
CALL
CHAR'C0,"0E0E150E04048A11',
>'CALL
CHARX
1,"0E0E840E15840404'
118
FOR
1=1
TO
31'FOR
J=9
TO
1=DISPLAY
AT<I>,CHR*<J>=PAUSE
.3
120
NEXT
J'NEXT
I
130
FOR
K=31
TO
1
STEP
-l'FOR
L=9
TO
1 =
DISPLAY
AT<
fO,
CHR$<
L >
140
NEXT
L'NEXT
K
150
GOTO
110
SOCCER
100
CALL
CHAR<
Q>"
0E0E158E04040A11"
>«CALL
CHAR<
1, "
881A1A1B0S820509
" >
110
CALL
CHARX
2,"0001050305191919">'CALL
CHAR<3,"000185031D191981">
128
CALL
CHAR<4,,,150E84048A110E0E"
>'CALL
CHARTS,"8018141314131313">
138
CALL
CHAR<S,"008B081B8C8S1412">
148
FOR
fl*10
TO
21=FOR
B-0
TO
S'DISPLAY
AT<A>,CHR*<B>'PAUSE
.1
150
NEXT
B'NEXT
A'PAUSE
.5
160
FOR
A=21
TO
10
STEP
-l'FOR
B'6
TO
0
STEP
-1
170
DISPLAY
flT<R),CHR*<e>-PflUSE
.1
138
NEXT
B'NEXT
A'PAUSE
.5'GOTO
140
TI
PPC
NOTES
V9N1P19
What
is
the
memory
protection
-for
the
CC—40?
Can
I
safely
bridge
a
battery
removal
by
having
the
AC
adapter
connected?
You
will
recall
that
we
were
cautioned
that
having
the
Adapter/Charger
connected
to
a
TI—58C
or
TI=59
with
the
battery
pack
removed
could
damage
the
calculator.
The
CC—40
manual
provides
no
information.
I
did
not
want
to
do
a
test
with
my
CC-40
since
I
run
the
risk
of
destroying
all
my
accumulated
programs.
Maurice
Sw'innen
says
that
he
has
changed
batteries
without
losing
his
programs.
He
thinks
it
took
about
a
minute
to
make
the
change.
As
soon
as
I
have
some
sort
o-f
recording
device
for
the
CC-40
I will
run
the
appropriate
tests.
In
the
meantime
I
have
asked
TI
for
clarification.
TI
PPC
NOTES
V8N4P11
ACCURACY OF THE CC-40 SINE AND COSINE FUNCTIONS - Palmer Hanson
V8N3P18/19
presented
George
Thomson's
analysis
of
the
accuracy
of
the
sine
and
cosine
functions
of
the
TI-58/59.
The
CC-40
calculates
the
trigonometric
functionstofourteen
places
and
might
"be
expected
to
yield
more
accurate
results
than
the
TI-59.
Examinationofthe
CC-40
sine
function
for one
degree
increments
from 0 through 90
degrees
shows
the
following
errors:
CC-40
Sine
Errors
Mean
Error
=
8.2E-14
RMS Error = 18.3E-14 Peak Error = 59E-14
+
60
-60
The
peak
error
of
59E-14
occurs
at
79
degrees.
For
a
graphic
comparison
with
the
TI-59
results
the
following
plots
show
the
•TI-59
errors
without
compensation
(same
as
the
top
plot
on
V8N3P19)
and
the
CC-40
errors
using
the
same
scale
for
"both
plots*
TI-59
Errors
without
any
compensation
Mean Error = 1.6E-13
RMS
Error = 6.8E-13
Peak
Error
=
17E-13
CC-40
Errors
Mean
Error
= 0.8E-13
RMS
Error
= 1.8E-13
Peak
Error
=
5.9E-13
+ »o -
-10
o
4»0
-
-10
I
MS
I
30
Over
the
examined
range
the
CC-40
results
are
nearly
four
times
more
accurate
than
the
TI-59.
As
with
the
TI-59
the
cosine
function
is
less
accurate
over
the
same
range.
The
mean
cosine
error
is
5.8E-14,
but the RMS
cosine
error
is
37.1E-14,
nearly twice that of the
sine.
TI
PPC
NOTES
V8N4P12
PROMPTING
ON
THE
CC-40
- In
V7N7/8P24
Maurice
Swinnen
described
a
multi-language
capability
built
into
the
TI-88
such
that
prompting
could
be
in
English,
German
or
French,
The
CC-40
provides
an
extended
multi-language
prompting
capability
through
the
use
of
the
CALL
SETLANG(n)
command.
The
assigned
language codes are:
0 English
1
German
2
French
3
Italian
4
Dutch
5 Swedish
6 Spanish
For
n = 1
the
system
messages
and
error
messages
are
in
German.
For
example,
the
responsetothe
incorrect
entry
sequence
ATN(
ENTER
is
"ungleiche
Klammern".
For
any
other
value
of n
the
system
messages
and
error
messages
are
in
English.
In
response
to
the
incorrect
sequence
ATN(
ENTER
the
English
response
is
"Unmatched
parenthesis".
This
output
of
error
messages
in
text
is
one
of
the
attractive
features of the
CC-40.
The user need not memorize error codes or
translation
tables
to avoid frequent reference to
th'e
manual. The
manual does provide extended discussion of each error
message.*
TM
For
programs
fromaSolid
State
Software
module
the
prompts
and
messages
from
the
module
may
be
in
any
of
the
languages
if
supported
by
the
particular
module.
My
Mathematics
module
supports
English,
German and French. For the Prime Factors program the various messages
ares
English"
PRIME
FACTORS
Use
Printer?
Enter # To Be
Factored:
Exit Program?
German
PRIMZAHLEN
Drucker
benutzen?
- >
Zahl:
French
FACTEURS
PREMIERS
Utilisation
d'une
Imprimante?
- >
Nb
a
Decomposer:
Programm
verlassen?
Fin du
Programme?
The
responsestothe
questions
asking
for
yes/no
answers
areYor
N
in
English,Jor
N in
German,
and
0
or
N in
French.
I
have
not
found
any
information
in
the
manual
for
the
Mathematics
module
which
would
tell
me
which
languages
are
supported.
Language
codes3through
6
result in English
messages
for that
module.
PRIME FACTORS WITH THE CC-40 MATHEMATICS MODULE - The speed of the
prime
factors
program
in
the
CC-40
Mathematics
module
is
disappointing,
about
ten
to
.forty
percent
faster
than
the
fastest
program
for
the
TI-59t
but
substantially
slower
than
some
programs
for
the
HP-41.
Representative
speeds for some of the standard problems are:
Program/machine
CC-40
Fast
Mode
Modulo
210
Leeds
FM
(V8N2P26)
Acosta
FM
58C
M/JJ
Module
- 59
111111111111
1035698<?9
987654321
9999999967
11
sec
32
sec
4l
sec
1 hr 55
min
I
45 sec
58 sec
2
hr
8
min
17
sec
46
sec
61
sec
2 hr 31
min
27
sec
6l
sec
79
sec
3 hr 6 min
43 sec
163 sec
215
sec
Loading...
+ 20 hidden pages