Architecture of the Wang 1200

Block Diagram

In the above diagram, fine lines represent single-bit (and serial) data paths, while thicker lines represent multiple bits of data in parallel (typically 4). Note, the hardware implements both parallel and serial paths, depending on registers and access operations.

Hardware Registers

The registers in the block diagram are explained here:

Microcode Execution Sequence

Microcode execution happens continuously, as long as the calculator has power. Each instruction contains the address of the next instruction, so there is no traditional "Instruction Counter" that increments. There is a "current instruction address" register, and two stack registers, used to control the flow of the microcode. In addition, certain keyboard conditions cause a hard-coded address to be forced into the current address register.

In normal operation, the current address is applied to the ROM and the resulting 42-bit word is latched into the instruction register. For normal instructions, the "next address" field of the instruction is fed-back into the current address register, with the low-order 2 bits coming from a decoding of the condition address fields, JL and JH.

For "call" instructions, the previous value of the current address register is saved into the "STACK1" register, also saving the "STACK1" previous contents into "STACK2".

For "return" instructions, the contents of the "next address" field is ignored and the current address register is loaded from STACK1 with the low-order bit forced to "1", and STACK1 is loaded form STACK2.

Note, a return instruction always returns to the odd address after the call-from address. This means that call instructions should always be at even addresses.

Microcode instruction execution sequence is terminated, and a new instruction address is forced, when certain keys are pressed. Because this is handled in hardware, these keys will immediately terminate any routine in progress and force the calculator to jump to the function programmed for that key.

In addition, the microcode logic allows for hard-wired overriding of certain instructions. There are 12 locations reserved for overrides.

TBD what the overrides do.

Microcode Instruction Timing

The system clock starts with a 4MHz crystal that feeds a flip-flop (producing a 2MHz signal), and a 5-bit Johnson Counter producing a series of "phase" clocks which repeat at 400KHz. One microcode instruction is entirely executed within the Johnson Counter cycle. This establishes the microcode instruction time (a "cycle") of 2.5uS, or 400,000 instructions per second.

The phase-clock signals, in combination with the 4MHz and 2MHz clocks, orchestrate the operation of the calculator. Early pulses are used to prepare hardware and save ("freeze") data, middle pulses are used to serially transfer data around the calculator registers, and late pulses are used to finish-up and finalize operations (such as accessing RAM or loading the next microcode instruction). Here are some key timing signals:

The instruction cycle is divided into three main phases: Early Latching, Serial Data Transfer, and Late Latching. The following activities are performed in the various phases:

Some notes on timing:

In summary, interpreting (and writing) microcode instructions requires careful consideration of these timing anomalies.

Editor's Note: While the schematics seem to imply that input data is forced into KA and KB on every instruction while KBD == 1, proper operation seems to dictate the KA and KB are latched only on instructions that use KBD in a conditional address (JL == 110). Also, unlike the schematics, KBD must be reset when JL == 110 and not exclusively by ST == 1001 (RESET).

Here is some sample microcode

Microcode Instruction Format

Each microcode instruction is 42 bits long. The instruction fields are as follows (layout for Solid State ROM).

The instruction fields have the following effects on the hardware.

The notation REG<n> refers to Bit "n" of register "REG".

Bit Assignments for I/O Ops

Carriage Function (Output) Codes
KAKBfunction
00xxspace (sp)
01xxbackspace (bs)
02xxtab
03xxcr/lf
04xxshift up
05xxshift down
08xxindex
09xxset tab
10xxclear tab

Print (Output) Character Codes
KA\KB 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 - y q p = j / , ; f g
01 w s i ' . ½ o a r v m
02 b h k e n t l c d u x
03 9 0 6 5 2 z 4 8 7 3 1
S
H
I
F
T
E
D
_ Y Q P + J ? , : F G
W S I " . ¼ O A R V M
B H K E N T L C D U X
( ) ¢ % @ Z $ * & # !
 
Keyboard (Input) Character Codes
KA\KB 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
00 - y CODE
sp
sp q p = j CODE
-
/ CODE
/
CODE
g
, ; f g
01 w s CODE
bs
bs i ' . [
(½)
CODE
w
o CODE
o
CODE
m
a r v m
02 b h CODE
tab
tab k e n t CODE
b
l CODE
l
CODE
x
c d u x
03 9 0 CODE
cr/lf
cr/lf 6 5 2 z CODE
9
4 CODE
4
CODE
1
8 7 3 1
08 _ Y Q P + J ? : F G
09 W S |
SET TAB
I " {
(¼)
O A R V M
10 B H K E N T L C D U X
11 ( ) ^
(¢)
% @ Z $ * & # !
04 SEARCH
(ON)
05 SEARCH
(OFF)
06 CODE
MEMO
MEMO (OUT)
07 CODE
B.L.
BACK LINE

Internal Character Encoding
CACB
32103210
SHIFTUNDERLINEtiltrotate

Memory Usage

All memory is organized as 8-bit words (bytes). Memory addresses are byte-addresses.

Line/Tape buffer is used to place text during RECORD mode, and holds lines read from tape during PLAY mode.

Aux Line/Tape buffer is used to hold SEARCH text, and additional/previous text during ADJUST and JUSTIFY.

Keyboard FIFO appears to be intended to simulate interrupt-driven keyboard input. The microcode frequently calls a "keyboard poll" routine that takes a keyboard code (if ready) and appends it to the FIFO by indexing with FIFO tail count and incrementing that tail count. Other routines "pop" the first keyboard code off the FIFO using a shift-left method. The FIFO tail count occupies only the low-order nibble of 0xdf.

LocationBits
CACB
32103210
15,6-------naj
15,5-UART------
15,4JUSTIFYADJUSTSKIPkeyAUTO-PARA+LINEPARA+WORD
15,3--------
14,0learn(c)-learn(d)--endpage
15,x--------
endpage=4:play, 5:stop, 6:eject, 0:*play, 1:*stop, 2:*eject

Cassette Tape

Most cassette storage of the era used audio modulation, similar to the "musical tones" of a modem, and used standard audio cassette tapes. But the Wang 1200 used magnetic saturation like mainframe computer tape drives. It did work on audio cassettes, but Wang recommended high quality "metal" tape.

The Wang 1200 Series used a dual-channel recording system, consuming both "sides" of a cassette in a single pass. This means that each cassette had, in affect, only one "side". This also means the Wang 1200's had special tape drives (heads) such that both "front" and "back" sides could be recorded at once - these were called "two head" drives, not to be confused with Stereo cassette drives that had two heads (channels) on each side of the tape.

The two channels were used to record "0" and "1" bits separately, i.e. one channel recorded only "0" bits while the other recorded only "1" bits. A transition on a given channel indicates a bit of that channel's type ("0" or "1"). It appears that there were never transitions on both channels at the same time. For at least this reason, that it would be impossible to determine which bit belonged in what order in the re-assembled data.

Here is an example of writing "now" to tape:

The unit of time for transitions was 50 cycles. In other words, there could/would be a transition (bit) every 50 cycles. This results in a data rate of 4000 bits per second. Assuming standard tape speed, this makes a tape density of about 2133 bpi (compare to mainframe "9-track" tapes which were 800 or 1600 bpi, and later 6250 bpi). The smallest common audio cassette was 15 minutes (C15, 7.5 minutes per side) which would hold about 225,000 bytes, not counting overhead for line-buffer formatting.

There was no parity or other error detection or correction encoded, so the only way to gain reliability was to "double record" each line for redundancy (consuming twice as much tape).

Each "block" written to tape has the following format:

  1. 19,562-cycle gap
  2. 66-bit header (?)
  3. 1708-cycle gap (?)
  4. 100-byte line, filled with 0xaa
  5. 27,928-cycle gap (867+27061) (?)

Each line takes 92,498 cycles on tape, or about 0.46 second. This equates to about 978 lines per C15 tape.