26

In an answer to Why did IBM System 360 have byte addressable RAM I wrote regarding the choice of byte size:

7 bits would be a perfect match for ASCII, but engineers would instinctively recoil from basing the word sizes on a prime number.

(Okay, someone else pointed out that EBCDIC actually uses 8 bits, but that would only be a concern for IBM in particular.)

Now it occurs to me to wonder, did anyone ever build a computer with a 7 bit byte? Or with a 14, 28 or 56-bit word?

rwallace
  • 60,953
  • 17
  • 229
  • 552
  • 2
    28 bits (as 32 - 4) as addresses appeared in a few machines. And computers were not designed to process 7-bit ASCII, but to do calculations; so that would be a more important consideration than prime numbers or not. – dirkt Jul 08 '20 at 04:40
  • When you say "use a 7-bit byte" I assume you mean the underlying hardware, not just software. (And for data, not address). As to bytes being 8 bits, I thought ASCII was a kludge to fit 7 bits of alphanumeric data inside an 8-bit byte and still have space left over for locale-specific characters. – smci Jul 08 '20 at 09:08
  • 6
    There were a number of computers with 6-bit bytes early on. – Hot Licks Jul 08 '20 at 13:14
  • 1
    And there were a number of computers which used "centesimal" arithmetic, though I don't recall what their word arrangement was. – Hot Licks Jul 08 '20 at 13:17
  • 1
    Not an answer, just to add confusion - IBM 705, 7080, 707x machines, while being decimal, used 7 bit I/O 'bytes' ... to be replaced at the latest machines with 9 bit fast channels :)) – Raffzahn Jul 08 '20 at 14:14
  • 5
    @smci In my era (1970s) the eighth bit was used on paper-tape and comms channels as a parity bit, to detect (but not correct) single-bit errors on the media. Wrong parity would stop a papertape reader on the faulted row, but for comms it would send ASCII NAK to elicit retransmission. I worked on ICL 1900 series mainframes, which had a word size of 24 bits (4 x 6-bit chars) so 7-bit data used (effectively) wide chars to distinguish upper and lower case and control characters, which did not exist in the native 64-char set. – Paul_Pedant Jul 08 '20 at 15:01
  • 7
    @smci, Re, "I thought ASCII was a kludge to fit 7 bits of alphanumeric data inside an 8-bit byte." ASCII wasn't created for computing. ASCII was created for the telegraph system. https://en.wikipedia.org/wiki/ASCII#History It was the wide availability of telegraph equipment (especially Teletype model 33 machines) that could be adapted as computer I/O devices that dragged ASCII into the computing world. – Solomon Slow Jul 08 '20 at 15:30
  • 8
    @Paul_Pedant: I think the idea behind parity was that in many cases, having a character be recognizably unreadable would be tolerable, but having it appear as the wrong character would not. If an "error character" appears in a place where t█e meaning is obvious, the recipient of a transmission may just fix it, but if such characters would render the meaning unclear, a retransmission can be requested. – supercat Jul 08 '20 at 16:33
  • 1
    @SolomonSlow: my point was that by the 1970s, ASCII became the standard, in computing. The US govt mandated it for federal govt computers in March 1968. That Wikipedia article is terrible about explaining the timeline of ASCII adoption in computing. – smci Jul 08 '20 at 18:04
  • 2
    @supercat I put a stock ordering system into a major supermarket in around 1974, where they had OCR readers in all the branches, sending requests over 4800 baud modems direct to the warehouse for despatch. Having a flicked bit send 200 cases of soup to Swansea was not an option. We ran about 5,000 orders each night, and also wrote the purchasing system. – Paul_Pedant Jul 08 '20 at 18:07
  • 3
    I once programmed on a CDC 6600 which had a word length of 60 bits. When coding in Fortran, character strings were represented as 10 6-bit bytes per word (upper-case only!). – Paul Sanders Jul 08 '20 at 21:12
  • 1
  • 2
    The question is somewhat ambiguous. The title says "use a 7-bit byte". The PDP-10 routinely use 7-bit bytes, by convention for text. However, the text says "build a computer with a 7 bit byte" which may imply 7 bits is the only byte size. – Lars Brinkhoff Jul 09 '20 at 06:01
  • Technically, the Motorola MC 14500 even used "1-bit" bytes. – tofro Aug 25 '23 at 14:26

8 Answers8

48

The PDP-10 had 'byte instructions' that could process a sequence of bytes of size 1 to 36 bits. The byte pointer was a word containing an 18-bit word address (and the usual index/indirect indications) plus position and size of the byte within the word.

It was common to use 7-bit byte sequences for ASCII text, which gave 5 characters per word and one (usually) unused bit.

There were monitor calls (system calls) that accepted strings of 7-bit characters packed in this way.

So: at the hardware level, bytes were variable-sized. At the software convention level, a byte was frequently 7 bits.

See section 2.3 in the KA-10 system reference manual.

Seth P
  • 103
  • 2
dave
  • 35,301
  • 3
  • 80
  • 160
  • 4
    PDP-10 flexibility in this way was very useful as operating systems also used sixbit encoding in places, e.g., for representing filenames in the file system in TOPS-10. – davidbak Jul 08 '20 at 11:35
  • 5
    See also RFC 4042. :-) – Lars Brinkhoff Jul 08 '20 at 16:08
  • 2
    Side note: In a BASIC program, the line number was stored as 5 7-bit bytes in a word, and the left over bit was set to 1 to indicate this was a line number. I discovered this when I tried to create a BASIC program with a conventional text editor. It looked fine, but it didn't work because that extra bit wasn't set. (Wow, this was like 40 years ago.) – Jay Jul 08 '20 at 20:15
  • 1
    Sure. SOS used to set line numbers too. I think most of the language processors knew to ignore them. – dave Jul 09 '20 at 00:32
  • 1
    The same answer applies to the PDP-6. It had byte manipulation instructons like those of the PDP-10. – Walter Mitty Jul 09 '20 at 11:42
  • @davidbak Yes. I remember packing filenames into the PDP-10 36-bit word in one of my CS courses. – Simon F Jul 17 '20 at 13:47
15

The VT52 text terminal certainly doesn't qualify as a full computer, but it does have a processor running software out of a ROM. The RAM holding the displayed text is 2048 7-bit bytes. The character generator ROM is also 7 bits wide.

Lars Brinkhoff
  • 3,111
  • 16
  • 35
11

The second-generation Soviet computer Minsk-32 (the series size is 2889 machines, 1968-75, civilian use, one of the rare early mainframes noted for use in Antarctica) used a 37-bit word and 7-bit representation of alphanumeric characters (5 in a word). Yes, the concept of "bytes" is difficult to apply to a similar old computer (which continued the line of vacuum tube machines), but special commands for the convenience of operations with 7-bit blocks took place in the command architecture.

Wheelmagister
  • 2,131
  • 6
  • 15
7

The well-known IBM 1401 technically had a 7-bit byte (plus parity). It was designed around the common format of IBM punched cards, which it was designed to process; these had ten "digit" rows and two "zone" rows, of which one digit and optionally one zone (for which the zero row also counted as a third zone) could be punched simultaneously in each column.

This essentially meant that each column of a card contained a value that could be encoded in 6 bits - 4 representing a BCD digit, and two more indicating the zone (no zone, first zone, second zone, or zero row). To this, the 1401 added a "word mark" bit for internal use, for a total of 7 bits.

Chromatix
  • 16,791
  • 1
  • 49
  • 69
6

Yes; there have been several (although, to my knowledge, none in the most simple sense where seven binary bits are treated strictly as as a base-7 system of Peano-like numbers). Instead, they are systems in which at least one (typically, two or three) carry are treated as separate state-modification bits.

The most oldest/most simple example (although it may not meet the definition of a Turing-complete computer) is the ancient 5/2 abacus.

More recent examples generally are cases where some form of binary-coded decimal is used, particularly those that use Chen-Ho encoding (which fit a better conception of the system being "7-bit", as Boolean logic/operations can still be (relatively) easily applied, as opposed to more packed (or packed/padded) 7-bit numbers, which require a variable number of instructions to ascertain certain binary/two's complement values.

Of these, the "two of seven" approach is most common. Examples: the IBM 650, the FACOM 128, and the "IBM 370 compatibility feature" (hardware emulation) built in to the IBM 7070/7074.

Geoff Nixon
  • 169
  • 2
3

The Norsk Data ND-505 had a 28-bit address bus.

snips-n-snails
  • 17,548
  • 3
  • 63
  • 120
  • 4
    So it did! But only physically not architecturally: "The only significant 28-bit computer was the Norsk Data ND-505, which was essentially a 32-bit machine with six wires in its address bus removed." – rwallace Jul 08 '20 at 01:13
  • 5
    @rwallace six? not four? – Omar and Lorraine Jul 08 '20 at 06:41
  • 15
    It has taken 14 years for the arithmetic in https://en.wikipedia.org/wiki/Special:Diff/56879895 to be challenged. – JdeBP Jul 08 '20 at 13:41
  • 4
    The question here talks about the bit size of bytes, not how many of them could be addressed. It seems to me that a machine having a 28 bit address bus wouldn't be particularly relevant to it. – Paul Humphreys Jul 09 '20 at 10:18
  • 5
    @OmarL - I haven't looked into this machine specifically, but machines with 32-bit wide memory interfaces frequently lack A0 and A1 address lines, i.e. if maximum address size is also 32 bits, they have 30 address lines. Presumably, this system had address lines A2-A27, hence the suggestion of 6 lines being removed. – occipita Jul 10 '20 at 01:23
2

The ADAU1701 is a 28-/56-bit DSP for audio processing. CHAR_BIT is probably 28 on that platform like most odd-sized DSPs but I'm not quite sure since I couldn't find its programming manual

phuclv
  • 3,592
  • 1
  • 19
  • 30
-1

Some famous Microchip PIC processors, such as the Microchip PIC 16F84 and the Microchip PIC 16F877A, have a "14-bit processor core". They execute all instructions out of a 14-bit-wide memory. In other words, their program memory has a 14-bit word. .

In addition to executable code, programs running on some (but not all) "14-bit processor cores" can read and write all 14 bits of any word in the non-volatile program memory. A few programs pack character map image data into 14 pixels per program word or 7-bit ASCII text into 2 ASCII characters per 14-bit program word.

Alas, programs running on the original PIC16F84 cannot read or write their own program flash memory (only execute), so if they use constant character data at all, they generally store one ASCII character per 14-bit program word.

David Cary
  • 216
  • 2
  • 7
  • 3
    Sorry but PIC16F84 is an extremely far fetched example which does not even have 7-bit bytes. It's an 8-bit processor and it having 14-bit instruction words is irrelevant. It has no mechanism of reading program memory directly so you can't store two 7-bit ASCII letters into single program word. The only ways to return a value from program code is to load it in W register, load it in the register file, or use the RETLW opcode which also returns a byte. – Justme Aug 25 '23 at 11:59
  • 1
    @Justme: Indeed, even when later parts with 14-bit code store added the ability to access it via program control, each word was split into a 6-bit part and an 8-bit part. Code could have used each word to store two ASCII characters, but there was no inherent support for doing so. – supercat Aug 25 '23 at 15:31
  • While it is true that some PIC programmers used the 14 bit word to store two 7 bit characters, doing so is not a feature of the CPU or the ISA. It's a software application that may happen on any CPU. – Raffzahn Aug 25 '23 at 17:16
  • 1
    @Justme: The original poster literally asked "did anyone ever build a computer with a 7 bit byte? Or with a 14, 28 or 56-bit word?". When someone claims that "it having 14-bit instruction words is irrelevant.", I feel that person didn't actually read the entire question. – David Cary Aug 27 '23 at 02:27
  • @DavidCary The MCU in question is not in itself a computer. The MCU can only move around and do calculations with 8-bit bytes of data. The program memory opcodes are 14-bit words, but due to Hardware architecture having separate data and instruction buses, the 14-bit instructions or program memory are not accessible to the programmer or the program running on the MCU in any way, except for the MCU being capable of reading and executing the 14-bit opcodes. – Justme Aug 27 '23 at 05:45
  • @Justme: Yes, the PIC16F84 is unable to read 2 arbitrary ASCII characters stored in a single program word; I hope my edits make that clear. If, hypothetically, the 14-bit program memory was not accessible to the program running on the MCU except for reading and executing the 14-bit opcodes, then it wouldn't be possible to map arbitrary image data into 14 pixels per program word. Fortunately, programs can read arbitrary 14-bit-wide data stored in program memory on the PIC16F18877 and the PIC16F877A and most Microchip PIC processors still in production (using NVMADRL and NVMADRH). – David Cary Aug 28 '23 at 22:50
  • It sounds like that's a Harvard-architecture processor, not a von Neumann one. In that case, it would be considered an 8-bit processor because it operates on 8-bit values. – Mark Dec 22 '23 at 04:39
  • @Mark: Yes, that's technically true -- the RAM operates on 8-bit values, while the flash memory operates on 14-bit values. Would you like to propose an edit? – David Cary Mar 21 '24 at 19:11