Architecture of the Wang 600

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. The only instruction that is overridden is at 008, which is replaced with a "CA = KK; return" instruction where KK is wired to indicate the RAM size, as follows:

This allows the microcode to detect what size memory is currently installed in the machine.

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

Memory Usage

All memory in the calculator is organized as 4-bit words. Memory addresses are not byte-addresses, but 4-bit-word addresses.

Display

The display is a "multiplexed" style, regardless of whether it is NIXIE tubes or 7-segment. This means that the display only appears to be static, it is actually continuously flickering, but at a higher rate than the human eye can discern. The display is only lit as long as the calculator is actively refreshing. If the calculator is busy doing something else, the display will go blank (from lack of refresh).

The microcode refreshes the display by sequentially loading each digit from memory, and pausing for about 276 cycles (almost 700uS). This means the entire display (16 digits) is refreshed every 11mS, or about 90 times a second. The display decoders are fed directly from the output latch of RAM (RB) and the N register. N contains the column (digit) number to enable, and the RAM latch contains the code for the digit to be displayed, and both must be kept static during the pause.

The display decodes digit values differently depending on the column. Columns 0 and 13 are "sign" digits and will only display "+", "-", and blank. Column 12 is hard-wired blank on the circuit board, but internally the microcode maintains the digit value and even refreshes it. The columns will display symbols according to the following table:

For example, RE 01 will cause the contents of register 01 to be copied into 15 14, and then 15 14 will be formatted for floating point and scientific notation and stored, respectively, in 15 12 and 15 13. Which ever mode is currently selected via the "Fl ↔ Sc" pushbutton will determine which register (15 12 or 15 13) will be refreshed to the display.

Depending on the state of the mode switches, the display refresh routine will refresh from register 15 13 (Sci notation), 15 12 (Floating point), or 15 11 (Learn modes). These "registers" contain the pre-formatted pattern to be displayed in each case. For example, after PRIME, these registers will contain:

The "panaplex" display provides 9 segments per digit, plus decimal point. The 2 center vertical segments are not addressable through standard 7-segment decoders. The display hardware uses discrete logic to override the 7-segment decoder for "+" (plus), "-" (minus), and "." (dp), as well as to relocate the segments for "1" into the center segments to produce a more-symmetrical string of digits.

Printer

The printer is a rotating-drum style with 21 columns and 16 rows (symbols per column). The drum has the following characters in the columns/rows indicated:

Similar to the hard-wired-blank position on the display, column 15 of the printer is also not connected and cannot be printed.

When printing, the calculator builds a pattern in register 15 09 that represents the first 15 columns (0-14) to be printed. The last 5 columns are formatted "on the fly" based on context, modes, and operations being performed.

With the printer turned on, the drum rotates and the hardware keeps track of which row is currently positioned at the hammers. When an instruction with MOP == 1100 is executed, the current drum position is loaded into KA and the row position signal is loaded into KB<3>. The calculator uses that information to determine when a row is in position to print and which row it is. As a particular row comes into position, the calculator checks all codes in the pattern and each place it matches the current drum position it sets a "1" bit in the hammer shift-register (setting a "0" where they do not match). The hammer bit is set in KB<0> and an instruction with MOP == 0111 is executed to shift the hammer bit into the register. When all 20 bits have been shifted (columns 0-14 and 16-20), the hammers fire and print that row of selected characters. The calculator then waits for the next row to rotate into position, and repeats the process for the next row code. When all 16 rows have been processed, the paper is advanced.

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 600 used magnetic saturation like mainframe computer tape drives. It did work on audio cassettes, but Wang recommended high quality "metal" tape.

Because magnetic media only works when there are changes in magnetic fields, the encoding had to ensure that the magnetic field changed frequently. This means that, for example, a long string of zeroes must not result in a long period of blank tape. Instead, there is guaranteed to be a transition at the beginning of every bit, and a transition in the middle if the bit was a "1". This is known as "Biphase-Mark" encoding or BMC, a variation of Differential Manchester encoding. This is also the same encoding that was known as "FM" and used for single-density floppy disks, as well as other magnetic media of the time. A parity bit was added every 4 data bits to help detect errors.

The timing of each bit was precise, because the tape read code had to be able to stay synchronized without saving state information or doing much processing. Each unit of output was 198 cycles (data bit width 396), and each program (tape image) was preceded by a 211,220 cycle (approximately 0.5 second) blank gap (no magnetic field transitions).

During read, the calculator waits for the "bit start" transition, then delays 272 cycles before sampling again. If the sample reveals that there was a second transition, then the bit is considered a "1", otherwise it is "0". From this stream, the calculator assembles nibbles and checks parity, loading data into memory.

Here is an example of writing 09 00 to tape and reading it back:

The code 09 00 is broken into two nibbles, and each assigned an odd parity bit. Then each 5 bit datum is encoded into the tape stream by converting "1" into either "1 0" or "0 1", and "0" into either "1 1" or "0 0", depending on the previous data to ensure that there is always a transition at the beginning of each bit. The resulting stream is fed to the record head and produces alternating segments of positive and negative magnetic fields on the tape.

During read, the changes between positive and negative magnetic fields show up as "blips" in the signal from the tape read head. These blips are fed into a "one-shot" flip-flop whose timing is set to about 97 cycles. This means that for 97 cycles after a transition there will be a "1" signal, and it will return to "0" after those 97 cycles.

The calculator monitors the signal from the one-shot. The first "1" it sees indicates the beginning of a bit. It then delays 272 cycles and checks the signal again. If it is still "1" (was actually re-triggered by a second transition) then the data bit is interpreted to be a "1". Otherwise, the data bit is interpreted to be "0". These bits are assembled into a 4-bit word and a parity bit, which is then checked for odd parity and, if correct, the data word is stored in memory.

A parity error will cause the calculator to turn on the Mach Error flag (ERR) and stop processing the tape.

Other problems with the tape will generally cause the calculator to "hang" with a blank display. Pressing PRIME is usually required in order to recover.

The calculator reads/writes the tape at about 1000 bits/second. Assuming standard tape speed, this makes a tape density of about 533 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) which would hold an overwhelming 90,000 program steps (on both sides) or 45 complete copies of the calculator memory (a program rarely consumed all of memory). For this reason, Wang data cassettes were much shorter, typically only having a few minutes of tape.

Expansion (Peripheral) Ports

CN-24

The CN-24 (Centronix 24-pin connector) is an output-only port, used primarily for printers and plotters. Only 6 bits of data output are provided. The pin-out is:

CN-36

The CN-36 (Centronix 36-pin connector) is bi-directional and multi-device (daisy-chained). The pin-out is:

The connector supplies the "always on" signals from N<0:3> and RB<0:3>, which are essentially display refresh data. This supports a device known as "Classroom Display" which was a large-digit remote copy of the main display.

The signals from IOB<0:2> are used to select devices on the daisy-chain. The following codes are used:

Devices 100 and 101

The "Group I/O" peripherals were fairly limited. The devices generally responded to a byte code from the calculator, and then asserted Learn (and strobed PRIME as needed) and pushed program steps to the calculator. The devices and/or operators orchestrated the interaction.

The protocol is as follows (GROUP y xx xx command):

Note: The calculator cannot tell the difference between codes sent by device and codes entered from keyboard.
Device 01X

The protocol is as follows (I/O 13 xx command):

If the result code is not 00, the calculator sets OV (Prog Error).

Each byte sent from device is "seen" by the calculator as keyboard input, and is acknowledged by the act of reading that "keyboard code".

Each byte sent from the calculator is acknowledged by the device by sending a dummy "keyboard code".

The "I/O 13 xx" devices may not have been limited to the Model 630 Fixed/Removable Disk. The protocol is a block input/output of program steps, but could be used for (extended) register data as well. Sufficiently sophisticated code in ROM could allow all of RAM to be used for registers, and/or implement a simple "operating system" that demand-paged program and register data in RAM.