Search › A-Z › U › UNIVAC I

UNIVAC I

1951 Open source · MIT Online

This is a from-scratch, in-browser emulator of the UNIVAC I, the Eckert-Mauchly computer that Remington Rand sold from 1951. It is a decimal machine with 1000 words of twelve characters in mercury delay lines, 100 channels of 10 words, and a word of memory can be reached only in the one minor cycle in ten when it comes round.

So where a program sits in memory decides how fast it runs. The emulator steps one minor cycle at a time, 40.44 microseconds, and its timing agrees with the 610 cells of the latency tables in Remington Rand's Advanced Programming course that were compared. A map of the delay lines shows the word being waited for. By default it runs a demonstration written for this site, one loop placed three ways: 4.2 seconds as written, 2.9 seconds by the tables, 5.4 seconds when every word has just gone by. All three print the same answer.

The surface is the Supervisory Control: the panel from the 1954 manual, with its Static Register neons, Interrupted Operation switch and Initial Read, the typewriter and its keyboard, a monitor oscilloscope and ten UNISERVOs. Other configurations run the royal flush routine from the 1953 programming manual, whose printed listing has a bug shown here, and the demonstration routine of the Preliminary Description of the UNIVAC, whose multiply and divide match the document's own tables row by row.

Because the entire machine is plain JavaScript, it plugs into the shared debugger: step an instruction at a time, watch the Control Counter and the Time Selection Counter, disassemble each word's two instructions, set execution breakpoints and write watchpoints, and read all of memory with no side effects.

Runs on: Web browser

UNIVAC I Online Emulator

Play UNIVAC I using JavaScript directly in your browser.

Configurations

ConfigurationEmulatorMachineOSLegal
Latency demonstration (written for this site)UNIVAC IUNIVAC IopenOpen ⛶
Royal flush routine (1953 manual)UNIVAC IUNIVAC IgreyOpen ⛶
Demonstration routine of U-300 (Eckert-Mauchly, 1950)UNIVAC IUNIVAC IgreyOpen ⛶
Cleared memory, console onlyUNIVAC IUNIVAC IopenOpen ⛶

Machines emulated

Chips

Notes

Embedding

The core has no dependencies and no DOM, so it runs under Node as well as in a page. Load it, add the console if you want one, and own the loop. One tick() is one minor cycle, 40.44 microseconds, so 24,725 ticks are a second of machine time.

<script src="univac.js"></script>        // window.Univac, the machine
<script src="univac-render.js"></script> // window.UnivacView, the console on a canvas

var m = new Univac();
m.loadTape(0, tapeText, 'program', true);  // UNISERVO 1, with a write-protect ring
m.initialRead();                         // first block to 000..059, C cleared
while (m.irTimes) m.tick();                // about 15 seconds of IR timer
m.pressStart();                          // the Start Bar
m.advance(m.t + Univac.MC_PER_SEC);       // one second of machine time
MemberWhat it does
m.tick(), m.advance(t)One minor cycle, or run to minor cycle t unless a breakpoint or watchpoint stops it.
m.stepInsn()Runs to the time out before the next instruction, through any fetch between.
m.wordText(a), m.setWordText(a, s)A memory word as twelve characters. Tape text uses the same form, one word a line, with \r for carriage return, \i ignore, \t tab, \l shift lock, \u unshift, \o one shift, \p printer stop, \b printer breakpoint and \s a space. # starts a comment line and #block pads to the next 60-word block.
m.keyText(c), m.wordRelease(), m.eraseKey()The keyboard. It works only while Input Ready is lit.
m.printer.linesWhat the Supervisory Control printer has typed.
m.pair, m.printMarksThe latency figures on the emulator's own panel.

Debugger integration

The plug-in is univac-debug.js, with a new decoder, /debugger/src/cpus/univac1.js, which disassembles a word as its two instructions. Each disassembly line carries the real address, as in @025, because the shared address fields are hexadecimal and this machine is decimal: location 025 is 0x19 there, and a breakpoint or a jump to it takes 19.

Registers. C is packed BCD: it shows 025 for location 025, and digits typed there write back. A word is twelve characters, so rA, rX, rL, rF and CR are split into .H and .L, packed BCD while the characters are digits, with F standing for anything else. Typing F into a field writes a minus. The console's own panel shows them as text. TSC is the Time Selection Counter, CY the cycle counter (0 alpha, 1 beta, 2 gamma, 3 delta), PC the Program Counter and MINORCYC the running count.

Memory. The memory chip is word addressed, so the disassembler, the PC and breakpoints follow the machine's addresses. Its hex column can show one byte a word, so it shows the code of the last character. chars shows the twelve seven-bit codes of each word, check pulse included; rI, rY and rV show the long registers. Reads go straight to the arrays with no side effects, which is more than the real console could do: it read memory by printing it or by looking at it on an oscilloscope.

Single step runs to the time out before the next instruction, one instruction at a time, passing through alpha and beta when a new pair is needed. The Interrupted Operation switch on the console steps the machine as the manual describes, down to one addition. Execution breakpoints are on a line, checked on beta time out before the pair is fetched. Write watchpoints hook the one memory write path. Pausing the debugger stops the emulator's clock and leaves the machine's own state alone.

Architecture

The UNIVAC I was the first American computer sold for commercial use. Eckert and Mauchly designed it, and the first was accepted by the Census Bureau in 1951, by which time their company belonged to Remington Rand. Forty-six were built. It is a decimal machine with memory in mercury delay lines, and tape was its main way in and out.

  • Memory. 1000 words in 100 channels of 10. Each channel is a loop of sound in mercury and returns its words in turn, once in a major cycle of ten minor cycles, 404 microseconds. A word is available for one minor cycle in ten, and the Time Selection Counter says which. Here that is not a delay added to an access: an access is a wait for the counter to agree, as it was in the machine. The timing was checked against eleven of the latency tables printed in Remington Rand's Advanced Programming course, 610 cells, with no differences. Reading and writing a word take one minor cycle.
  • Characters. A word is twelve characters of seven pulses: a check pulse making the count odd, two zone pulses, and four numeric pulses in excess-three. Numbers are a sign and eleven digits, all less than one. Digits are worked serially and decimal correction is done as the manual shows, so 4 + (-) gives 3 and (-) + (-) gives a space, because these are what the adder does, not special cases. The Periodic Memory Check and the High Speed Bus odd-even check are real here, and a word with an even count of pulses stops the machine. The only way to make one is to read a tape into rI without clearing it, which the manual warns about.
  • Registers. rA, rX, rL and rF of one word, rV of two, rY of ten, rI and rO of sixty, the Control Counter and Control Register. rV and rY are delay lines too, which explains the manual's odd rules. rV keeps a word by whether its place is even or odd, so words can land reversed and an address ending in 9 wraps within the channel. rY needs no wait, since all ten words go through in ten minor cycles from wherever the counter stands. Those behaviours come from the model and match pages 34 and 35.
  • Instructions. A word holds two, left then right, each two digits, one unused digit and three of address. The 43 orders of code C-10 are here. Each pair takes the four stages alpha, beta, gamma and delta, with the time-out minor cycles the course's charts show. Multiply and divide follow the program counter steps of the U-300 tables, and their partial results match those printed tables row by row. A transfer in the left half takes its address from the right half, and overflow fetches the pair at 000.
  • UNISERVOs. Ten tape units, 60-word blocks, forward and backward reads, writing at 100 or 20 pulses to the inch, rewinds, write-protect rings and interlocks. The computer carries on during a read or write and stalls only when an interlock says it must. Timing is from the manuals: about 85 ms a block, 0.6 s to reverse, 1.5 s for the first block, 2 minutes to rewind a full reel. The manuals disagree on the first block, giving 1.0 to 1.8 s.
  • Supervisory Control. The panel follows Chart F, left to right, except that its voltage monitor section is left out. The neons of the Static Register are its 27 flip-flops and the switches under them set them. Interrupted Operation has its five positions and does what the manual says of each. The typewriter prints ten characters a second and takes a thirteenth "ignore" after each word. At Computer Digit it prints those symbols as the manual lists: x for ignore, / for carriage return. At Normal it obeys them and prints lower case unless shifted. In Computer Digit, lines wrap at the 39 characters the manual says to set.

The software. The default, the latency demonstration, was written for this site. One five-line loop sums 1 to 1000, placed three ways: as written, by the minimum latency tables, and with each word just gone by. All three print 500500. It takes 4.2 s, 2.9 s and 5.4 s. The royal flush routine is Example 2 of Programming for the UNIVAC Fac-Tronic System (January 1953), pages 193 to 196, with hands written for this site, typed in with Fill as an operator would. The printed listing has a bug: it shifts the card with .2, leaving the suit in digit 4, but its suit constants are in digit 5, so it always answers NO ROYAL FLUSH. Run here as printed, it does. One character is changed to .3, and the tape says so. The demonstration routine is from the Preliminary Description of the UNIVAC (U-300, copyright 1950, February 1956 printing), "embodying all instructions". Its lines and its values of x0, y0, y1, z0, z1 are the document's. The tables of c, the raw data and the block at 060, which the document leaves open, are written for this site. Its product, quotient and extract come out as the document prints them. It stops to ask for two typed words at the end, and that is the routine, not a fault. Its page 28 prints 76 000 where its own text and logic say 76 480, and the second is used.

Not modelled. Faults: nothing here can fail, so the duplicated-circuit comparators, the tank heaters and most error neons never act. Power sequencing: the machine is shown warmed up. Block subdivision, bad spots on tape, the High-Speed Printer, UNITYPER and UNIPRINTER; a tape is text you load. The Secondary Selector, and the true waveform of the oscilloscope: its trace is drawn from register contents. Non-digit characters are handled by the manual's tables, and where they say nothing the model follows the adder as it infers it: a carry into a character is dropped, and a space added to a digit is treated as a numeric -2. The High Speed Bus speaker follows word transfers, not pulses, so it is a sketch of the real sound, off unless you switch it on. The delay-line map, the registers as text, the figures, SPEED and LOAD are the emulator's own and are not on a real UNIVAC.