The TK-82C that arrived in my family's living room in 1984, as I told in 1984, São Paulo: what Brazil's market reserve actually built, was a small black box with a flat keyboard, plugged into the television. What was inside it is not a secret, and it was never meant to be: the manuals and magazines of the time printed the addresses, the chips and the clock speeds for anyone who wanted to look. This post opens the box. It explains how any microcomputer is wired, from that Brazilian clone of the Sinclair ZX81 to the IBM PC and the Raspberry Pi, and it does the arithmetic by hand, from the makers' own documents. The history, machine by machine and generation by generation, is in the Learn article Microcomputers by category and generation; here the question is only how they work.

Five parts and a bus

Intel defined the microcomputer in the user's manual of its 8080 processor in September 1975: the processor sits on one chip, and "when this processor is combined with memory and I/O circuits, the computer is complete" (Intel, 8080 Microcomputer Systems User's Manual, 1975). Five parts, then:

  1. The processor, the central processing unit (CPU), which fetches instructions from memory one after another and carries them out.
  2. The clock, a crystal oscillator that sets the pace of every step.
  3. Read-only memory (ROM), which holds the program the machine runs when it is switched on: on a home computer of the 1980s, the interpreter.
  4. Random-access memory (RAM), read-write memory for the user's program, its data and often the screen.
  5. Input and output (I/O): the keyboard, the television or monitor, the cassette recorder, the printer port.

What joins them is the bus, a set of parallel wires. Some carry the address, the number of the memory cell or port the processor wants; some carry the data, the byte being read or written; the rest carry control signals that say whether this is a read or a write, memory or I/O, and when the value is valid. The Altair 8800 of January 1975 made the bus visible. Every board plugged into "a 100-line buss", and the front panel showed it in lights: "16 used for the address buss, 8 for the data buss", with the rest for status (H. Edward Roberts and William Yates, Popular Electronics, January 1975). Sixteen lights for the address and eight for the data: that is what "an 8-bit word/16-bit address computer", the magazine's own description, looked like.

Counting address lines

Each address line is one bit. A processor with n address lines can put 2ⁿ different numbers on them, so it can reach 2ⁿ bytes. The arithmetic is doubling, and it is worth doing once by hand:

Address linesBytes reachable (2ⁿ)In binary unitsProcessor that had them
8256256 bytes(one page of memory)
101,0241 KiB
1665,53664 KiBIntel 8080, ,
201,048,5761 MiBIntel 8086 and 8088
2416,777,21616 MiB
324,294,967,2964 GiBIntel 80386

Each row checks against a maker's document. Intel's 8080 has "a 16-bit address bus" and can "directly address and retrieve as many as 65,536 bytes" (Intel, 1975). Zilog's Z80 keeps "the 16-bit address of the current instruction" in its program counter (Zilog, Z80-CPU Technical Manual, 1977). IBM wrote that the 8088 in its Personal Computer "supports 20 bits of addressing (1 megabyte of storage)" (IBM, Personal Computer Technical Reference, August 1981). Motorola's 68000 has "a 24-bit address bus" and a 16-megabyte range (Motorola, MC68000 16-Bit Microprocessor, April 1983); a careful reader of that data sheet will see its address pins listed as A1 through A23, with no A0: two signals, the upper and lower data strobes (UDS and LDS), choose whether a transfer uses bits 8 to 15 of the data bus, bits 0 to 7, or both, as the data sheet's Table 4-1 shows. And Intel gave the 80386 a "physical address space" of "2³² bytes, or 4 gigabytes" (Intel, Introduction to the 80386, April 1986).

When IBM wrote "1 megabyte" for 2²⁰ bytes it meant 1,048,576, not a million. Why there are two kinds of kilo and mega, and how to tell which one a label means, is in Bits, bytes and the two kinds of kilo.

A Brazilian reader worked the 16-line case out for himself in in March 1985. The Z80, he wrote, is an 8-bit processor that can pair two internal registers to form a 16-bit word; its 16 address bits are named A15 down to A0, "so the processor is able to access 65536 (2¹⁶ or 64 K) bytes of memory" (our translation, as for every quotation from Portuguese in this post) (Micro Sistemas no. 42, March 1985).

Where the TK-82C kept things

The TK-82C was sold as compatible with the Sinclair ZX81: Micro Sistemas listed it in January 1983 as "compatible with the Sinclair ZX81" (Compat. com Sinclair ZX81), with a Z80A at 3.25 MHz, 8 KB of ROM and 2 to 64 KB of user RAM (Micro Sistemas no. 16, January 1983). So the ZX81's manual, written by Steven Vickers for Sinclair Research, describes its memory too. Here is the map it gives, address by address (Sinclair Research, ZX81 BASIC Programming, 1981):

AddressesWhat is thereWhat the manual says
0 to 8191ROM: the BASIC interpreter"up to 8191. That makes altogether 8192 = 8*1024 bytes, which is why this ZX81 BASIC is sometimes called an 8K BASIC"
16384 to 16508System variables"set aside for specific uses by the system"
16509 upwardsThe BASIC program, then the display file, the variables and work spacethe program area that the system variables point into
up to 17407, or to 32767End of RAM: 1 KB, or 16 KB with the RAM pack"the addresses range from 16384 to 17407 (or possibly up to 32767 if you have a 16K RAM pack.)"

Check the arithmetic. 8 × 1,024 = 8,192 bytes of ROM, numbered 0 to 8,191. RAM starts at 16,384, which is 2¹⁴: in binary, a single 1 on address line A14 and zeros everywhere else, so the hardware can tell RAM from ROM by looking at one wire. 17,407 − 16,384 + 1 = 1,024 bytes, the standard machine's 1 KB; 32,767 − 16,384 + 1 = 16,384 bytes with the 16 KB pack. The manual also keeps the address of the first byte past the end of memory in a system variable called RAMTOP, at addresses 16388 and 16389, "e.g. 17K, or 17408, if you have 1K of memory": two bytes, because a 16-bit address needs two 8-bit cells.

The routine at 16514

Brazilian owners met these addresses in print. In June 1983 a Micro Sistemas reader published a renumbering routine for the TK82-C as a list of decimal numbers: a short BASIC loop, FOR N = 16514 TO 16565, POKEd them into memory, and LET X = USR 16514 ran them. He explained that the numbers "are nothing more than Z80 machine-code instructions", placed from address 16514 inside a REM line typed as the program's first line (Micro Sistemas no. 21, June 1983). Why 16514? The program area starts at 16509, by the manual's map; the first line's header, which begins with its line number in two bytes (stored, the manual notes, most significant byte first), and the REM keyword come first, and the routine begins five bytes in: 16509 + 5 = 16514. The manual draws the line layout as a diagram, which the copy read here does not carry as text, so the five bytes are taken from the address the magazine printed. The magazine's tips pages used the same address for years: a screen-saving routine ran "from address 16514 to 16526" (Micro Sistemas no. 42, March 1985).

The address itself is two bytes, and a Micro Sistemas lesson on number bases in April 1984 used it as an example: 16514 is 64 and 130 in decimal bytes, 40 and 82 in hexadecimal (Micro Sistemas no. 31, April 1984). By hand: 16,514 ÷ 256 = 64 remainder 130, because 64 × 256 = 16,384 and 16,514 − 16,384 = 130; and 64 = 4 × 16 + 0, so 40 hexadecimal, while 130 = 8 × 16 + 2, so 82. The address 16514 is 4082 in hexadecimal: the high byte 40 says "the first page of RAM", the low byte 82 says how far into it. Which of the two bytes is stored first in memory is the subject of Big-endian and little-endian.

The same reader of March 1985 tried an experiment that shows what one address line does. He put his routine at 16514 and called it from BASIC, and it worked; he called it at 49282 instead, "16514 + 32768", and it did not run: BASIC simply came back with its 0/0 report. In binary, 32,767 is fifteen ones and 65,535 is sixteen: "the only difference between the two binary numbers is the most significant bit (A15)" (Micro Sistemas no. 42). Adding 32,768 sets exactly that one line. The two addresses look unrelated in decimal and differ by a single wire in the hardware.

A screen in 793 bytes

The ZX81 keeps its picture in ordinary RAM, in a block the manual calls the display file, "the memory copy of the television picture". It "begins with a NEWLINE character, & then has the twenty four lines of text, each finishing with a NEWLINE", 32 characters to a line (Sinclair Research, ZX81 BASIC Programming). A full screen is therefore:

1 + 24 × (32 + 1) = 1 + 24 × 33 = 1 + 792 = 793 bytes.

On a standard machine with 1 KB, 793 bytes would leave 1,024 − 793 = 231 bytes for the system's work space, the program and its variables together, before even counting what the system variables point to. The designers' answer is in the manual: "When the total amount of memory (according to the system variable RAMTOP) is less than 3 1/4 K, then a clear screen ... consists of just twenty five NEWLINEs", and the lines grow only as characters are printed on them; with more memory, the screen "is padded out with 24*32 spaces". Twenty-five bytes instead of 793: the small machine shrank its own screen to leave room for the program. That is the TK-82C on a 2 KB budget, and the reason the 16 KB pack mattered.

The clock

Everything a microcomputer does is counted in clock cycles, and the period of one cycle is the inverse of the frequency. Intel's 1975 manual advertised the 8080 with "instruction times as short as 2 µsec" (Intel, 1975), and Popular Electronics gave the Altair's "add/subtract time" as 2 µs (Popular Electronics, January 1975): at two microseconds each, at most 500,000 of the shortest instructions a second. The CHM credits the 4004 of 1971 with "up to 90,000 operations per second in four-bit chunks" (CHM, Timeline, 1971).

The IBM PC's speed shows how practical the choice of a clock was. IBM's technical reference explains: "The processor is operated at 4.77 Mhz. This frequency is derived from a 14.31818 Mhz crystal which is divided by three for the processor clock and by four to obtain the 3.58 Mhz color burst signal required for color televisions" (IBM, 1981). Do the divisions:

  • 14.31818 ÷ 3 = 4.77273 MHz, the processor clock;
  • 14.31818 ÷ 4 = 3.57955 MHz, the colour burst signal that, in IBM's words, colour televisions required.

One crystal served both the processor and the colour display. The period of one clock is 1 ÷ 4.77273 MHz ≈ 209.5 nanoseconds, which IBM rounds to 210: "At the 4.77 Mhz clock rate, the 8088 bus cycles are four clocks of 210 ns or 840 ns. I/O cycles take five 210 ns clocks or 1.05 microsec" (same source). Four cycles of 210 ns are 840 ns, five are 1,050 ns: the processor could fetch at most about 1.19 million bytes a second from memory, 1 ÷ 840 ns, and fewer from the ports.

The 640 KB line

The 8088 could address a megabyte, but a PC user of the 1980s heard about 640 KB. The line comes from IBM's own memory map in the same 1981 reference (IBM, 1981):

Start (decimal)Start (hexadecimal)Use in IBM's 1981 map
000000Read-write memory: 16 KB to 64 KB on the system board, more on cards
640KA0000Reserved
704KB0000Display buffers: monochrome, then colour and graphics
768KC0000Memory expansion area and reserved space
top 48 KBto FFFFFBase system ROM

The arithmetic: 640 × 1,024 = 655,360, which is A0000 in hexadecimal, because A0000 = 10 × 16⁴ = 10 × 65,536 = 655,360. Everything from there to the top of the megabyte, 1,048,576 − 655,360 = 393,216 bytes or 384 KB, went to video, expansion cards and ROM. Programs lived below the line. The machine had a megabyte of address space and at most 640 KB of it for programs, by design, and later PCs kept the map for compatibility.

What "8-bit" and "16-bit" measure

A processor has more than one width, and the advertising picked one. The data bus is the number of bits moved to or from memory at once; the registers are the width the processor computes with; the address bus is the reach. The makers' documents show them differing:

  • The Z80 computes 8 bits at a time but pairs registers into 16-bit words to hold addresses (the Micro Sistemas reader of 1985, above).
  • The 8088 is, in IBM's words, "an 8-bit bus version of the 16-bit 8086 processor": 16 bits inside, 8 at a time on the bus, so every 16-bit word costs two bus cycles of 840 ns on the PC (IBM, 1981).
  • The 68000 was sold as a "16-Bit Microprocessor" with "32-bit registers" and a 16-bit data bus (Motorola, 1983); a Brazilian magazine called the Macintosh clone built on it a "32-bit micro" (micro de 32 bits) (Micro Sistemas no. 50, November 1985).
  • The of 1985 was a 32-bit processor from the start (Arm Newsroom), and the Raspberry Pi 5 runs a "quad-core 64-bit Arm -A76" at 2.4 GHz (Raspberry Pi, Introducing Raspberry Pi 5, 28 September 2023).

So when two sources call the same machine 16-bit and 32-bit, both may be reading a real number off the data sheet. Ask which width they mean.

Reading a 1983 specification sheet

Micro Sistemas's table of the Brazilian micros in January 1983 is a good exercise, because its editors explained every column (Micro Sistemas no. 16, January 1983). Its column UCP, the Portuguese abbreviation of central processing unit, gave "the name of the microprocessor, the size of the word used (in bits) and the clock frequency (in MHz)". Memory came in three columns: system memory (ROM, where the monitor and usually BASIC live), user memory (the minimum and maximum RAM), and storage. Take the row for the TK 82-C:

  • UCP: "Z80A, 8 bits, 3.25 MHz". An 8-bit word, so 16 address lines and 64 KB of reach; one clock period is 1 ÷ 3.25 MHz ≈ 308 ns.
  • Video: TV, black and white, a text display of 24 by 32: the 793-byte display file above.
  • System memory 8 KB ROM, user memory 2 to 64 KB RAM: the 0 to 8191 and 16384 upwards of the manual's map (the 64 KB maximum replaces, rather than adds to, the internal RAM, the Centre for Computing History notes for the ZX81).
  • Storage: cassette at 500 bits per second. A full 16 KB program, 16,384 bytes of 8 bits, is 131,072 bits; at 500 bits per second that is 262 seconds, about four and a half minutes, before any synchronization or gaps. How the bits became sound on the tape is told in Storage devices, from the delay line to the cold archive and its companion post.
  • Price: Cr$ 79,900 with 2 KB, Cr$ 113,700 with 16 KB, in December 1982 cruzeiros (same source). The 14 KB of extra RAM cost Cr$ 33,800, about 42% of the base machine's price: memory was the expensive part.

The same table shows the machines' families in its compatibility notes ("compatible with the Sinclair ZX81", "compatible with the Apple II", "compatible with the TRS-80 Model III", each Compat. com in the table), which is what a buyer needed to know to find software, and the policy that made those clones is in The Brazilian market reserve, in theory and in practice.

The same five parts today

Forty years on, the five parts are still there, mostly inside one chip. The Raspberry Pi 5 of 2023 puts a 64-bit processor running at 2.4 GHz beside 4 or 8 GB of RAM for 60 or 80 dollars (Raspberry Pi, 28 September 2023). Compare the clocks: 2.4 GHz ÷ 3.25 MHz ≈ 738, so the Pi's clock ticks about 740 times as often as the TK-82C's, on each of four cores, and 8 GB is 8 × 1,073,741,824 = 8,589,934,592 bytes against the TK-82C's 16,384, a ratio of 524,288, which is 2¹⁹. Apple's M1 of 2020 holds "16 billion transistors" on one chip (Apple Newsroom, 10 November 2020), against the 4004's 2,300 (CHM, The Silicon Engine, 1971).

And the Raspberry Pi 500, the Pi 5 inside a keyboard that plugs into a screen, is sold by a company that says its form "harks back to the great 8-bit and 16-bit computers" of the 1980s (Raspberry Pi, Raspberry Pi 500 on sale now). Open one and the parts have names a reader of the 1975 Intel manual would recognize: a processor, a clock, memory, input and output, and the lines that join them. The numbers on the lines are just much bigger.

Sources