Alan Turing's 1950 manual for the Mark I electronic computer [pdf]

185 pointsposted a day ago
by lisper

45 Comments

adrian_b

14 hours ago

This Ferranti Mark I computer is notable because, despite being one of the earliest electronic computers, its instruction set included 4 instructions that are now included in most modern ISAs, but which have been missing for many decades from the instruction sets of most later computers, with the exception of the supercomputers made by CDC and Cray.

Those 4 instructions, with their mnemonics in the Intel/AMD x86 CPUs are:

LZCNT (leading zero bits count), which was named "The position of the most significant digit" in this manual.

POPCNT (population count), which was named "Sideways adder" in Mark I (it is listed in a table at the end of this manual).

RDRAND (read random number), which was named "The random numbers generator" in this manual.

RDTSC (read time stamp counter), "The clock" in this manual.

It is said that some or even all of these less usual instructions had been suggested by Alan Turing himself to the designers of Ferranti Mark I.

Another notable instruction of Ferranti Mark I was used to produce an audible beep, like the internal loudspeaker of the older IBM PC compatibles, "The hooter" in this manual.

dboreham

14 hours ago

Men in black always want popcount (it's been added to various architectures over the years at their request) so this makes sense given his background.

kichimi

13 hours ago

>Men in black always want popcount (it's been added to various architectures over the years at their request)

I've heard this a few times, do you have anything that explains this?

adrian_b

13 hours ago

It is said that NSA has requested the addition of POPCNT to the Control Data Corporation CDC 6600 (1964), as a condition for procurement.

The condition has remained in force later, so all its successors, like CDC 7600 (1969) or Cray-1 (1976), have included POPCNT.

POPCNT has been added to the x86 ISA by AMD, in "Barcelona", in 2007, presumably because some customer for AMD Opteron has requested it. This happened during the period when the AMD server CPUs were much better than the Intel Xeons, so any wise customer was buying Opterons, not Xeons. Intel has followed AMD and it has added POPCNT to Nehalem, in 2008/2009 (for server CPUs, Nehalem has been the first that was better for any purpose than the AMD server CPUs, unlike for consumer CPUs, where Intel had surpassed AMD already since the middle of 2007, with Core 2).

SoftTalker

11 hours ago

> POPCNT has been added to the x86 ISA by AMD, in "Barcelona", in 2007, presumably because some customer for AMD Opteron has requested it.

Might have been Cray, they were using Opteron in that era.

dbcurtis

7 hours ago

Back in my days as a CPU logic designer, I actually worked on a scientific mainframe where the MIB came by and said "We'll buy some if you add a vector pop count."

Anyway.... if you have cipher text that has been scrambled by a linear-feedback shift register, you can take two copies of the cipher text, shift one copy by N bits, XOR them together, and do a pop count on the result. Repeat for bunch of different N's. For some N that corresponds to the length of the LFSR the auto-correlation will be much better. So now you have at least that to go on... of course you don't know the feedback equation and you don't know the initialization constant, but you have the start of a handle.

solarexplorer

14 hours ago

IIRC it also introduced index based addressing. Before that, people just wrote self modifying code to index arrays...

adrian_b

12 hours ago

True.

The 8 index registers ("B-tube") are called B0 to B7 in this manual.

The B0 index register is hardwired to have the read-only value "0".

A read-only null register continues to be used in many modern instruction sets, e.g. in POWER or in Aarch64.

trebligdivad

6 hours ago

As bit-serial machines, popcnt etc would have been a bit easier than parallel machines. (Heck, I'm glad the world moved on from using teleprinter code for numbers and instructions; hideous isn't it?!)

fsckboy

10 hours ago

to save you time, this is a summary of the links various people here are posting:

popcnt of a word counts the number of bits that are "1"

https://www.talkchess.com/forum3/viewtopic.php?t=38521

the NSA wanted to do cryptanalysis on intercepted messages, and since the CDC 6000 had 60-bit words, one word was enough to store most alphabets they were interested in. They were able to:

    Split a message into lines
    Set a bit for each unique character they encountered per line
    Use popcount to count the distinct characters
    Use the count as a hash for further cryptanalysis
Curiously, popcount seems to have disappeared from instruction sets between the mid-1970s and the mid-2000s.

(of course for all we know this could be NSA disinformation ;)

That's the answer to the NSA question. There are other uses described here https://vaibhavsagar.com/blog/2019/09/08/popcount/ including for Hamming codes and Neural nets and more.

SilasX

12 hours ago

Semi-related: one thing I liked about the video game Turing Complete [1] is that, once you've built the computer and implemented its (binary) machine code ... it doesn't give you an assembly language, or suggest one!

It has you start programming in binary, and then just tells you how to make your own mnemonics to substitute for having to write out each 8-bit input. So you end up picking them based on what commands appear most often in practice.

One instruction I ended up creating was JNEQCI, "jump if not equal, comparing to immediate". (jump if not equal where the first operand is treated as a register and the second as a constant/immediate value)

[1] from LevelHead, and similar to nand2tetris in that you build a computer from its circuits and then program it

cmehdy

12 hours ago

All Zachtronics games are a strong recommend for anybody who doesn't already know them.

Exapunks and Opus Magnum are probably the more casual ones to get into, but everything they make is awesome and pretty challenging.

doormatt

11 hours ago

FYI, Turing Complete - while a fantastic game, is not made by Zachtronics.

SilasX

11 hours ago

Oops, fixed. Thanks. I had just lumped it in with all the others.

ahoka

11 hours ago

lisper

9 hours ago

Personally, I think the modern typesetting discards a lot of the essential value of the original. My interest in this manual stems not from any desire to program a Mark I, but because I want to connect with the past and understand what programmers of that era had to deal with. A big part of that was documentation that was not pristine, that was full of hand-written notes and symbols that they had to somehow make sense of nonetheless. It's like the difference between a real vintage airplane and a modern replica. The replica looks superficially the same, but when you look at the details it feels, well, modern. There's something radically different about flying a plane with period [1] vs modern [2] avionics.

[1] https://media.defense.gov/2015/Aug/03/2001266310/780/780/0/1...

[2] https://www.scalewings.com/sw-51-mustang/

Animats

10 hours ago

This is dated 1950, when the Manchester "Baby" was working, but the Mark I wasn't working yet. This was five years after Von Neumann's original draft of the EDVAC design. The EDVAC itself was delivered in 1949. Actual EDVAC report [2] (reset in Tex for readability) [3].

The EDVAC report is something everyone in computer science should read, if they haven't already.

The big problem in the early days was memory. Early memory systems were not only small, but were usually delay lines, where you have to wait for the slot you want to come around, like a disk. Not random access. Both the EDVAC and the MARK I had some true CRT-type random access memory, but not much of it. The Mark I had an index register, which was missing from the EDVAC. That was the last essential piece of CPU architecture needed to make programming reasonably sane. Otherwise you had to store into your program code to index.

[1] https://en.wikipedia.org/wiki/First_Draft_of_a_Report_on_the...

[2] https://archive.org/details/firstdraftofrepo00vonn

[3] https://archive.org/details/vnedvac

krunck

12 hours ago

"It is not difficult to see that information expressed with one set of symbols can be translated into information expressed with another sot by some suitable conventions, e.g. to convert sequences of decimal digits into sequences of O's and 1's we could replace 0 by 0000, 1 by 1000, 2 by 0100, 3 by 1100, 4 by 0010, 5 by 1010, 6 by 0110, 7 by 1110, 8 by 0001, and 9 by 1001."

I've never seen someone use this form of binary notation(little-endian?) when writing binary numbers.

Edit: I suppose he's writing the numbers in the order they'd be input into the machine.

retrac

9 hours ago

> in the order they'd be input into the machine

That is the usual why for little endian. Same reason why little endian byte ordering is used on the 8008 and successors. The processor needs the lower byte first, to calculate the carry over to the high byte. Bit serial machines (like the Mark 1 and most other early computers) operate in a similar manner, just one bit at a time, from least to most significant digit.

abecedarius

12 hours ago

I've read that since Arabic goes right-to-left, decimal numbers are little-endian there.

mikewarot

14 hours ago

My how things have changed.... he says "Desk Machine"... and of course I think Keyboard, Computer, Monitor, Mouse.. ;-) Instead of one of the Friden Calculators.

Like this one, seen in a storage rack somewhere deep inside a TARDIS.

https://en.wikipedia.org/wiki/Friden,_Inc.#/media/File:Fride...

hinkley

12 hours ago

Some of the control codes we use in ttys today came from teletype machines that were already around for five to ten years in 1950. Also when the 132 character wide terminal standard was born. Thats’s another valid interpretation of desktop.

adrian_b

12 hours ago

The width of 132 characters was the width of the line printers, which were the main output device of the first commercial electronic computers.

The line printers had been designed from the beginning as computer peripherals, because previously there was no need for such high printing speeds. They were called line printers because all 132 characters of a line were printed simultaneously, by impact.

The first computers were not multitasking, so they could not be used for anything else while printing. Because of this, a very high printing speed was necessary, which required the development of the line printers. Later, when printing no longer blocked the execution of other tasks, the very expensive line printers could be replaced in many cases by cheaper printers, like dot-matrix printers or daisy-wheel printers.

Many more recent operating systems, like Unix or MS-DOS, have kept the abbreviation LPT for printers, even if by that time the line printers were already obsolete and they were very seldom encountered.

All early experimental computers used teletype machines for interactive communication with the computer. In the later commercial computers, teletypes continued to be used for the operator console, while the batch jobs of the non-privileged computer users would have had only the line printer or the card puncher as output peripherals.

If there have ever been any teletypes with an output width greater than 80 columns, they must have been very seldom used. At the standard typewriter pitch of 10 cpi, 132 characters require paper with the width of 14 inches (including the perforated margins). That would have required a huge teletype. I do not believe that such a big teletype has existed.

Animats

2 hours ago

> All early experimental computers used teletype machines for interactive communication with the computer.

Some people liked Flexowriters instead of Teletypes. Flexowriters had upper and lower case characters, and a 6 bit code instead of 5 bits. Here's an LGP-30, from 1956, the first desk-sized "personal computer"[1] Vacuum tubes, drum memory, chrome bezel. Very 1950s.

[1] https://www.youtube.com/watch?v=7WaYYNUCWMY

zabzonk

11 hours ago

> do not believe that such a big teletype has existed.

Decwriter II, according to wkipedia - https://en.wikipedia.org/wiki/DECwriter. I've actually used one of these, but I can't remember the printing width.

adrian_b

11 hours ago

Thanks for the link.

Nevertheless, I see that Decwriter II was not a true teletype. It was a teletype emulator derived from a dot-matrix printer and it was introduced very late in the evolution of computers, in 1974, at a time when the true teletypes had already become obsolete and more than two decades after the line printers that have established the standard width of 132 characters.

Decwriter II could provide a width of 132 characters only because the dot-matrix printer on which it was based was built to be able to use the standard line printer continuous perforated paper of 14 inches, like most other dot-matrix printers.

It is likely that Decwriter II has been used much more often as a remote teleprinter than as an interactive teletype and in the latter case it was used only because some users were forced to use it because their bosses did not buy decent computer terminals for them.

jonjacky

4 hours ago

Those wide DECwriters were the standard console terminals for DEC systems in the late 1970s and early 1980s. It is the only kind of terminal shown on the cover and interior of DEC's VAX-11/780 Hardware Handbook [1] (especially see Preface p. x)

We had two of these, for our VAX 11/780 (delivered 1980) and PDP 11/23 (1981).

You wanted a printed record of everything that happened at the console. A system crash would print a register dump and other information that would scroll out of sight on a video terminal (there were no scrollback buffers then).

1. https://course.ece.cmu.edu/~ece447/s15/lib/exe/fetch.php?med...

flyinghamster

9 hours ago

Teletype Model 38 (essentially a wide version of the 33 with a two-color ribbon) could print 132 columns as well.

adrian_b

9 hours ago

That is interesting, but Model 38 was also a very late model (1972), launched at a time when teletypes were becoming obsolete and more than two decades after the line printers that have established the 132-character width.

The existence of such very late wide teletypes did not have any influence on the appearance of the 132-character width, which had been used in line printers since around 1950.

hinkley

10 hours ago

I did a lot of paper crafts with that wide format paper that one of my parents brought home from work pre-recycling. There was a certain thing I liked to make where the aspect ratio of the sheets was just perfect. That paper had neat green and white stripes on it too.

vessenes

14 hours ago

Boy I love this. Both for the pleasure of reading what Turing thought his ‘experienced’ operators needed to know, and also for the glimpse back at all the engineering, physical constraints, and solutions pulled together. Within a few pages we’re talking about where on a physical circle “tubes” physical bits reside, just, you know, as a starting intro. Really amazing.

joshdavham

13 hours ago

It’s interesting to see how he had to write math in this paper. Instead of being able to type it, he had to leave spaces and fill it with his own handwriting. Maybe LaTeX isn’t so bad after all.

analog31

13 hours ago

My parents wrote their graduate theses this way too, in the 1950s, except that the spaces were for chemical formulas.

larsga

12 hours ago

That was interesting. I just casually clicked on the link and before I knew it I had read 20 pages.

typon

13 hours ago

Am I tripping or is the linked manual for the Mark II, not the Mark I?

larsga

12 hours ago

It says very clearly on the title page it's for the Mark II, and in the text he says the advice is based on experience with the Mark I, so it's definitely for the Mark II.

adrian_b

12 hours ago

The manual is for the experimental Manchester Mark II, which is very similar to the commercial product derived from it, Ferranti Mark I.

So both the handwritten title about Ferranti Mark I and the typed title about Manchester Mark II are right. Only the name of the PDF file is wrong.

Manchester Mark I had been an earlier and simpler experimental computer, while Ferranti Mark I was a commercial product. It actually was the first commercial electronic computer, with its first delivery a little before UNIVAC I.

eschulz

12 hours ago

Good catch. It's for the Mark II and seems to be written based primarily on his experiences with the Mark I. I do not know if you are tripping.

adrian_b

12 hours ago

It is for Manchester Mark II, which is very similar to Ferranti Mark I, so both titles are correct.