Alan Turing’s 1950 manual for the Mark I electronic computer [pdf]
archive.computerhistory.org
archive.computerhistory.org
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.
I've heard this a few times, do you have anything that explains this?
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).
Might have been Cray, they were using Opteron in that era.
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.
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.
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
Exapunks and Opus Magnum are probably the more casual ones to get into, but everything they make is awesome and pretty challenging.
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.
It’s not very readable as it doesn’t use a language familiar to me (and, likely, most readers of HN)
[1] https://media.defense.gov/2015/Aug/03/2001266310/780/780/0/1...
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...
The SSEM/Baby had evolved into the Mark 1 by 1949.
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.
PS: interesting tidbit, apparently "old" Arabic was reading numbers strictly from right-to-left (eg one-and-ten-and-hundred), but later switched to a more "western convention" of starting with the major digits. Would be interesting how it worked in the original Hindu system (where the Arabs learned of the decimal system).
Agreed re little-endian being at least as natural, and apparent historical accidents.
(Edit: I'm doubting the advantage claimed below, now that I wrote it out. The mental ops are serial either way.)
There is a small advantage of big-endian for manual arithmetic which I only noticed the other day: in summing a column of numbers in carry-save style, it seems easiest to add the digits left-to-right in your inner loop, with a one-digit mental scratchpad and a one-line accumulator. Pretty much opposite of what I was taught in grade school.
("Carry-save" means expanding the range of digits from 0-9 to 0-a (10), and delaying carry propagation until the very end. So the scratchpad digit may need incrementing before going into the accumulator, depending on the next single-digit addition, but carries never propagate further than that one place per step until you reach the bottom line. This seems to help in bounding the needs for short-term memory and avoiding variation in steps which could throw you off, as a fallible human.)
I'm not arguing origins. I am saying that irrespective of the path by which it arrived at that, in modern English at least, the order in which things are read in the order they are spoken, as is the case for the rest of the symbols in our written language (and therefore the "natural order"), is big-endian.
Something else may have been "natural" for some other languages spoken at some other time and place, but...
One little, two little, three little endians...
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.
Like this one, seen in a storage rack somewhere deep inside a TARDIS.
https://en.wikipedia.org/wiki/Friden,_Inc.#/media/File:Fride...
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.
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.
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.
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...
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.
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.
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.