 WANG 452 Version Française WikipédiA An american calculator labelled from 1973. Very fast and complete programmable calculator!

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:
• The RAM card with 256 or 512 bytes (the 256 one can be upgraded to 512)
• The ROM card that contains the specific programs for the 16 multipurpose keys
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:
• Temporary results will be computed on the left accumulator.
• Total will be stored in the right accumulator.
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:
• Operators +, -, ÷=, ×= act on the accumulator and automatically display the result.
• STORE copies the display to the accumulator.
• RECALL copies the accumulator to the display.
• TOTAL, similar to RECALL, and the accumulator is then reset to zero.

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 Function Codes LOGa(x) LOG10(x) LOGe(x) RAD->DEG SIN COS TAN √X a^x 10^x e^x DEG->RAD SIN-1 COS-1 TAN-1 X² 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215

 White Function Codes ×a π n, Σx, Σx² REC->POL SINh COSh TANh INT ÷a X! x, σ², σ POL->REC SINh-1 COSh-1 TANh-1 ABS 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315

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. 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 0023 0715 RECALL left display final value 0024 0903 STOP stop program 0025 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 0605 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.

Example : statistical approximation of the square root of 2

 09 00 LABEL 10 00 fx0 start of program f(0) 06 15 STO left init the random generator 00 00 0 and set to zero... 06 01 STO 01 the "under" counter 06 02 STO 02 and the "total" counter 09 15 RETURN 09 00 LABEL 10 01 fx1 start of program f(1) 06 00 STO 00 init the loop counter 02 02 STO+ 02 and update the "total" counter 07 15 RCL left start of main loop, recall the seed 13 01 π 02 15 + left 00 05 5 12 08 a^x compute (x+π)^5 06 15 STO left 13 07 INT 03 15 - left keep the fractional part 12 15 x² to the square 06 14 STO right 00 10 , 00 05 5 03 14 - right compared to 0.5 08 05 SKIP IF X>0 if "over", then jump 00 02 2 else, add two to the "under" counter 02 01 STO+ 01 00 01 1 update the loop counter 03 00 STO- 00 08 04 SKIP If X=0 if not null, then go on looping. 15 05 GOTO 14 13 -19 07 01 RCL 01 compute the frequency 06 14 STO right 07 02 RCL 02 05 14 ÷= right 09 15 RETURN This program uses random values . This is done with this recurrent formula . Then, the probability that is the same as the probability that . This way, after several tests, the frequency of the squared numbers under one half is close to square root of two over two. This frequency is the value returned, with this little difference that "2" is added for each value "under", so the frequency is This program doesn't work well as the random generator is not well balanced. Instead of the expected value of 1.41, it returns values close to 1.38 or 1.39. Usage: alea f(x) 00 : Call program 0 with a first random value. The counters a reset to zero. n f(x) 01 : Call program 1 with n tests to add. When finished, it returns the approximation of square root of two. Note : a hundred tests last for 34 seconds, the function power of the random formula takes a lot of time!

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 