Sanyo PHC-8000
Datasheet legend
Ab/c:
Fractions calculation
AC: Alternating current BaseN: Number base calculations Card: Magnetic card storage Cmem: Continuous memory Cond: Conditional execution Const: Scientific constants Cplx: Complex number arithmetic DC: Direct current Eqlib: Equation library Exp: Exponential/logarithmic functions Fin: Financial functions Grph: Graphing capability Hyp: Hyperbolic functions Ind: Indirect addressing Intg: Numerical integration Jump: Unconditional jump (GOTO) Lbl: Program labels LCD: Liquid Crystal Display LED: Light-Emitting Diode Li-ion: Lithium-ion rechargeable battery Lreg: Linear regression (2-variable statistics) mA: Milliamperes of current Mtrx: Matrix support NiCd: Nickel-Cadmium rechargeable battery NiMH: Nickel-metal-hydrite rechargeable battery Prnt: Printer RTC: Real-time clock Sdev: Standard deviation (1-variable statistics) Solv: Equation solver Subr: Subroutine call capability Symb: Symbolic computing Tape: Magnetic tape storage Trig: Trigonometric functions Units: Unit conversions VAC: Volts AC VDC: Volts DC |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sanyo PHC-8000
Only two components have date codes, but the near complete absence of surface mounted components seems to confirm: The Sanyo PHC-8000 is one of the earliest handheld computers to appear in the market of pocket computers and calculators, dating back to 1981.
This machine appears relatively unremarkable: a BASIC handheld computer with a single-line display, with no unique functionality or special capabilities. Far more remarkable is the I/O unit PHC-8010. Unusually for such an early model, the I/O unit offers a serial and a parallel interface, video output, I/O for a cassette recorder, and it also serves as a charger for the PHC-8000. Many years later, docking stationbecame the widely used name for similar devices.
Another indication of the PHC-8000's age: its BASIC suffers from a problem common to BASIC interpreters of this era. Namely that although the BASIC supports double-precision arithmetic, built-in transcendental and trigonometric functions are single-precision only. Because of this, implementing my programming example, the Gamma function, is more complicated than it really should be. To accurately compute logarithms and sines, I needed to include two subroutines that calculate these functions with double-precision. The natural logarithm is calculated as:
\[\ln(1+x)=x-\frac{x^2}{2}+\frac{x^3}{3}-...\]
Since the series converges only when $|x|\lt 1$, and converges quickly only when $|x|\lt 0.5$, $x$ is first normalized.
The sine is computed using the following series:
\[\sin x=x-\frac{x^3}{3!}+\frac{x^5}{5!}-...\]
$x$ is again normalized, this time to the range $0\le|x|\le 2\pi$.
The program, shown below, computes the logarithm of the Gamma function to 10+ digits of precision for any positive or negative argument. It is a bit slow, which is mainly due to the custom implementations for the natural logarithm and sine functions. Note that the custom logarithm function does not test for invalid arguments, so for certain negative values, the program may run for a very long time and then fail. To use that much dreaded phrase, I'll leave it as an exercise to the reader to add the necessary tests; in this case, mind you, the exercise is a relatively trivial one.
100 INPUT Y# 110 S%=1 120 IF Y#>0 THEN 150 130 S%=-1 140 Y#=-Y# 150 X#=2.50662827563479526904# 160 X#=X#+225.525584619175212544#/Y# 170 X#=X#-268.295973841304927459#/(Y#+1) 180 X#=X#+80.9030806934622512966#/(Y#+2) 190 X#=X#-5.00757863970517583837#/(Y#+3) 200 X#=X#+0.0114684895434781459556#/(Y#+4) 210 GOSUB 10000 220 G#=Z# 230 X#=Y#+4.65# 240 G#=G#-X# 250 GOSUB 10000 260 G#=G#+(Y#-.5#)*Z# 270 IF S%>0 THEN 330 280 X#=3.141592653589793*Y# 290 GOSUB 11000 300 X#=-3.141592653589793/Y#/Z# 310 GOSUB 10000 320 G#=Z#-G# 330 PRINT G#,EXP(G#) 999 END 10000 Z#=0 10010 IF X#>.5 THEN 10050 10020 X#=X#*2.718281828459045# 10030 Z#=Z#-1 10040 GOTO 10010 10050 IF X#<1.5 THEN 10090 10060 X#=X#/2.718281828459045# 10070 Z#=Z#+1 10080 GOTO 10050 10090 X#=X#-1 10100 XX#=X# 10110 N%=1 10120 ZZ#=Z#+XX# 10130 IF ZZ#=Z# THEN RETURN 10140 XX#=XX#*X#*N% 10150 N%=N%+1 10160 XX#=-XX#/N% 10170 Z#=ZZ# 10180 GOTO 10120 11000 N%=X#/6.283185307179586# 11010 X#=X#-N%*6.283185307179586# 11020 Z#=X# 11030 XX#=X#*X# 11040 XZ#=X# 11050 N%=2 11060 XZ#=-XZ#*XX#/N%/(N%+1) 11070 N%=N%+2 11080 ZZ#=Z#+XZ# 11090 IF ZZ#=Z# THEN RETURN 11100 Z#=ZZ# 11110 GOTO 11060