WANG 452

Version Française
WikipédiA



An american calculator labelled from 1973. Very fast and complete programmable calculator!

Features Keyboard Arithmetic calculations Scientific calculations Registers Programmation Memory



Features
It's a surprising programmable calculator
  • 13 digits precision, exponent up to 99
  • Scientific ans statistical functions
  • 16 registers, direct and indirect addressing
  • Programmation with conditional jumps and one subprogram level
  • 64 steps expandable to 320.
On the back side is located a connector to receive a punched card reader, the WANG C-10 or C-11.
Unfortunately, I never saw nor read more about it.

This serie of calculators, WANG 400 (including models 400, 450, 452, 462) contain a mother board with several daughter boards. Two of them are important: Note that only those two cards make the various versions of the WANG 400 serie different.

This is fully detailed and documented on the excellent web page of
Rick Bensene that you can find here (in english).


Keyboard
The keyboard is divided in 5 zones:
  • In the center, the numeric pad to enter numbers.
  • On both sides of it, two identical groups operating on the left and right accumulators.
  • Above, 16 multipurpose keys.
  • On the top, a line of selectors defining the function of the 16 keys.
  • On the right, some keys mostly dedicated to programming.


Arithmetic calculations
Let's compute the following :

Note that we'll have to store some temporary results. Let's say that: Note: When switched on, the calculator appears to be in an unknown state, so press PRIME (red key) to reset it.
Note Left accumulator Right accumulator Display
First temporary result
8.9 STORE 43 + 12 ÷=
+4.325000000000
That we store on the right STORE
+4.325000000000
Second temporary result
52 STORE 4.1 ×=
+213.2000000000
Added to the right +
+217.5250000000

Précisions:

Scientific calculations
Here, we'll have to use the 16 multipurpose keys. To make them act as scientific functions (the ones labelled on the white and black strips), the white or the black switch must be down as the SP key.
For the white funtions, SP down
and the white key K(x) down
For the black funtions, SP down
and the black key k(x) down
Let's compute the following :

One accumulator is enough, let's take the left one!
Note Left accumulator Display
Select white functions π
 STORE
+3.141592653590
Calculate the denominator
5 X!
+120.0000000000
And divide !
÷=
+.0261799387799
Select black functions
√X
+.1618021593800

Some particular functions:
  • In YELLOW, four functions with a constant value "a". This value is simply the content of the left accumulator.
  • In RED, polar to rectangular coordinates conversions.
    • x in the left, y at display REC->POL returns the angle on the right and the radius at display.
    • raduis on the left, angle at display POL->REC returns x at display and y on the right.
  • In GREEN, statistical functions. To start, you must reset some registers with Clear Regs.
    • For each value, enter it at display and n, Σx, Σx² adds it to the serie returning the number of values entered. At any time you have:
      • Register 0 = n
      • Register 1 = Σx, the sum
      • Register 2 = Σx², the sum of squares
    • At any time, pressing x̄, σ², σ compute the mean, the variance and standard deviation:
      • Register 3 = σ², variance n-1
      • Register 4 = σ, standard deviation n-1
      • Display = mean, Σx÷n


Registers
The WANG 452 gives access to 16 registers. To use them, every of the 16 multipurpose keys represent one register (note the numbers on the labels). In additon, you must use one of the selectors to indicate what you want to do with the register. The SP must be down except for the Ex function where it must be up.
The functions are the ones you already know for the accumulators:
  • T : Total, display register and reset it to zero
  • + : add to register and display result
  • - : substract from register and display result
  • × : multiply register by display and display result
  • ÷ : divide register by display and display result
  • St : store display into register
  • Re : display register
  • Ex : exchange display and register
Note: left accumulator is Register 15, right accumulator is Register 14.

Programmation

Ask for an access to my Cloud to get the User's Manual and technical schematics.
A big thank to Jan van der Veen for a copy of his technical manual that allowed me to complete my tables!
His museum can be found here.

To program, press the LEARN button.

The display turns as the one shown right:
  • 4 digits for the step number (from 0000 to 0063 or 0319 according to the version)
  • 4 digits for the instruction code that you read in two parts from 00 to 15 each
Editing keys

  • PRIME : back to step 0000
  • STEP : one step ahead
  • SET P.C. : followed by 4 digits, go to the specified step
  • SELECT : followed by one function key (or a digit if it's under 10):
    • SELECT 5 : Insert step, the new one has the default 0803 code
    • SELECT 6 : Delete current step
    • SELECT 7 : Verify program (must end with 0914)
    • SELECT 15 : Mode "2 keys" for entering program using the 16 multipurpose keys to generate programmation codes.
    • SELECT 14 : Exit from "2 keys" mode.
  • Any other : Generate programmation code and go to next step.


Convention : nn represents a register number (from 00 to 15) that you get using one of the 16 keys.

Arithmetic functions

Function Codes
digits 0-9 0000 à 0009
decimal point 0010
Set Exp 0011
Change Sign 0012
Clear Regs 0014
Clear Display 0015
Function Codes
TOTAL reg nn 01nn
+ reg nn 02nn
- reg nn 03nn
× reg nn 04nn
÷ reg nn 05nn
STORE reg nn 06nn
RECALL reg nn 07nn
Exchange reg nn 14nn
Note : when using the left accumulator, you use register 15. For the right accumulator, it's register 14.

Then, using "+" on the left accumulator generates the code 0215.
RECALL on the right accumulator generates the code 0714.
Indirect function Codes
TOTAL reg *(nn) 1511 + 01nn
+ reg *(nn) 1511 + 02nn
- reg *(nn) 1511 + 03nn
× reg *(nn) 1511 + 04nn
÷ reg *(nn) 1511 + 05nn
STORE reg *(nn) 1511 + 06nn
RECALL reg *(nn) 1511 + 07nn
Exchange reg *(nn) 1511 + 14nn


Scientific functions

Black FunctionLOGa(x)LOG10(x)LOGe(x)RAD->DEGSINCOSTAN√Xa^x10^xe^xDEG->RADSIN-1COS-1TAN-1
Codes1200120112021203120412051206120712081209121012111212121312141215

White Function×a&PIn, Σx, Σx²REC->POLSINhCOShTANhINT÷aX!x, σ², σPOL->RECSINh-1COSh-1TANh-1ABS
Codes1300130113021303130413051306130713081309131013111312131313141315


Labels and Jumps

Function Codes Note
LABEL + key 0900 + xxxx Sets a label, the key is the one you want.
LABEL + f(x)nn 0900 + 10nn Particular case: marks the beginning of a user defined function that you can call with one of the 16 keys with selector f(x) down. Function must end with RETURN.
LABEL + F(x)nn 0900 + 11nn Particular case: marks the beginning of a user defined function that you can call with one of the 16 keys with selector F(x) down. Function must end with RETURN.


Function Codes Note
Goto + key 0800 + xxxx Jump to the label xxxx.
GOSUB + key 1507 + xxxx Call subprogram starting at label xxxx
f(x) nn 10nn Call subprogram starting with 0900+10nn
F(x) nn 11nn Call subprogram starting with 0900+11nn
RETURN 0915 Back from a subprogram
GOTO + offset 1505 + offset The offset can be positive or negative to jump back (+/- 127)
GOSUB + offset 1506 + --dd + dddd Call a subprogram starting at dddddd steps (+ or -)
GOTO indirect 1511 + 00nn Jump ahead using the absolute value of register nn as offset.


Access to user defined functions.


Conditional jump Code Action
SKIP IF X=0 0804 Skip next two steps if display is null
SKIP IF X≠0 0904 Skip next two steps if display is not null
SKIP IF X≥0 0805 Skip next two steps if display is greater or equal to zero
SKIP IF ERROR 0905 Skip next two steps if there is an error and error is cleared
The two steps skipped are commonly used for a jump instruction GOTO + label / Goto + offset.
But you can imagine any other usage, for example recall a register that could be the result and stop:
0714    recall right accumulator
0903    stop program.


Miscellaneous

Function Code Note
STOP 0903 Stop program.
END 0914 Marks the physical end of program, used by SELECT 07.
Pause 0902 + 0903 Stop and display during 0.5 seconds.
Shift 0902 + 10nn Multiply display by 10^nn
Shift 0902 + 11nn Divide display by 10^nn
How to get some special codes:
  • 09nn : key SP down, selector 09xx, and press the function key nn
  • 15nn : key SP down, selector 15xx, and press the function key nn
  • 08nn : key SP down, no selector, and press the function key nn


Example : accuracy test

0000 0002      2  
0001 0000      0  
0002 0614      STORE right	right accumulator = 20, will be the counter 
0003 0002      2  
0004 0615      STORE left	left accumulator = 2, starting value 
0005 0715      RECALL left	(start of 1st loop) 
0006 1207      √X  
0007 0615      STORE left	replace left with its square root. 
0008 0001      1  
0009 0314      - right		Decrement counter 
0010 0804      SKIP IF X=0 	it's done when reaching zero 
0011 1505 1510 GOTO -6 		else, back to start of loop 
0013 0002      2  
0014 0000      0  
0015 0614      STORE right	counter = 20. 
0016 0715      RECALL left	(start of 2nd loop) 
0017 0415      ×= left		replace left with its square 
0018 0001      1  
0019 0314      - right		Decrement counter 
0020 0804      SKIP IF X=0 	it's done when reaching zero 
0021 1505 1511 GOTO -5 		else, back to start of loop 
0022 0715      RECALL left	display final value 
0023 0903      STOP 		stop program 
0024 0914      END 		Optional mark 
Again the famous Hebdogiciel test.

Starting from 2, take 20 times the square root.
Then 20 times the square.
Compare to 2.

To run the program, SET P.C. 0000 (back to first step)
Then GO key.

Here, the result is quite good!



Note for backward jumps : on one byte, -6 equals 256-6 = 250 = FA = (15)(10).


Exemple : rectangles method for integrals

0000 0900 1000 	LABEL f(x) 00	start of function 00
0002 0600      	STORE 0		bound a in register 0
0003 0915      	RETURN

0004 0900 1001 	LABEL f(x) 01	start of function 01
0006 0601      	STORE 1		bound b in register 1
0007 0915      	RETURN

0008 0900 1002 	LABEL f(x) 02	start of function 02
0010 0615      	STORE 5		n in register 5
0011 0701	RECALL 1
0012 0615	STORE left
0013 0700	RECALL 0
0014 0603	STORE 3		init register 3 with x=a
0015 0315	- left
0016 0705	RECALL 5
0017 0515	÷= left		   compute h=(b-a)/n
0018 0602	STORE 2		h in register 2
0019 0000	0
0020 0604	STORE 4		reset integral
0021 0703	RECALL 3	start of loop: recall x
0022 1015	CALL f(x) 15	compute f(x)
0023 0204	+ 4		add to integral
0024 0702	RECALL 2	
0025 0203	+ 3		add h to x
0026 0001	1
0027 0305	- 5		decrement counter
0028 0804	SKIP IF X=0	si 0, it's done
0029 1505 1508	GOTO -8		else, back to start of loop
0031 0702	RECALL 2	
0032 0404	×= 4		multiply integral by h
0033 0915	RETURN

0034 0900 1015	LABEL f(x) 15	start of function to integrate
0036 1215	X²
0037 0915	RETURN
To approximate the integral
We select the number n of intervals and let
Finally, , it's the rectangle method, a one that is not really accurate!

Into the program:
  • a in register 0, use function 0 to set its value.
  • b in register 1, use function 1 to set its value.
  • h in register 2
  • the successive values x=a+ih in register 3
  • the integral I in register 4
  • the counter n in register 5, use function 2 to set its value and this also calculates I
  • function 15 will be the one to integrate, it starts at step 0034
Comme exemple, on prend
  • 0 f(x) 00 : init a
  • 1 f(x) 01 : init b
  • 10 f(x) 02 : run with 10 intervals, I=+.2850000000000
  • 100 f(x) 02 : run with 100 intervals, I=+.3283500000000 (2 seconds !)
  • 1000 f(x) 02 : run with 1000 intervals, I=+.3332833500000 (22 seconds !)

Another example with
With 100 intervals, the machine returns I=+3.16... in 24 seconds.


Memory


How is a number represented in memory?

It takes 8 bytes and is stored in scientific notation with 13 digits. The signs nibble only uses the two lower bits.
  • bit 0 = 1 if negative mantissa
  • bit 1 = 1 if negative exponent
For example, number 452 = 4,52 × 10^2 will be:
45 20 00 00 00 00 00 02


Additional codes and registers!

There are two additionnal codes presented now:
Function Code Note
RECALL 0801 + NNnn recall register NNnn at display
STORE 0901 + NNnn store display into NNnn register
For the first 16 registers, they are useless and inefficient as they require two steps. But, they give access to additional registers that are mapped to the program memory.

  • With 64 steps: register 16 is at steps 56-63, register 17 at steps 48-55 ... until register 23 at steps 0-7
  • With 320 steps: register 16 is at steps 312-319, register 17 at steps 304-311 ... until register 55 at steps 0-7


Let's play with register 16.

First, write this little program to ease STORE and RECALL operations.
You'll use function 00 to recall the register and function 01 to store into it.

Note: if you have a 320 steps version, replace every occurence of step 0056 by step 0312.
0000 0900 1000	  LABEL f(x) 00
0002 0801 0100	  RECALL 16
0004 0915 		  RETURN

0005 0900 1001	  LABEL f(x) 01
0007 0901 0100	  STORE 16
0009 0915 		  RETURN
Now try this :
3 1/x f(x)01
to store 0.33333... into register 16. Then let's edit steps 56 through 63:
0303 0303 0303 0303 0303 0303 0302 0001
This means 3.333333333333 × 10^-1.

What happens if I put something else than digits into register 16? Edit step 0056 and put those codes:
1011 1213 1415 1011 1213 1415 1011 1213
And then f(x) 00 to recall this register, see image on the right !

Values from 10 to 15 display this:
  • 10 : is the decimal point
  • 12 : is the +
  • 13 : is the -
  • 11, 14, 15 : are spaces


The mysterious code 0013

Using the "2 steps" edition facility (SELECT 15), you can create the 0013 programming code.
What it does? I was expecting a hidden function or something else... but it appears to act as "Change Sign"... Too bad!

Depuis le 15 décembre 2007