Preview Mode Links will not work in preview mode

Episode 16 Notes - How Capable was the 4004?

Nov 7, 2019

The Intel 4004 was the first commercial microprocessor. There is a lot that can be said about this achievement, but what exactly was the chip like to work with? The fact of the matter is that the 4004 would live it's life as a controller for simple devices, but didn't really show up as a CPU powering computers. It's not really possible to make a definitive conclusion as to why this is, you can't prove a negative. However, I think that the underlying architecture of the chip made it more suitable as a microcontroller-like device rather than a general purpose computer.

First off, the 4004 is a 4-bit processor. That means that it is primarily designed to work with 4-bit binary numbers. That immediately puts limits on what the chip is capable of, and you can see those limits directly in the pinout. The chip only has 16 pins, so there isn't much space to start work with. The data bus is only 4-bits wide. There are an additional 4 pins that are used in multiplex with the data bus to form an address bus for accessing memory. Technically, the address bus is 12-bits wide, the full address is sent out over 2 successive clock ticks, but it only uses 8 pins. The remaining 8 pins are used to provide power to the chip, reset/test triggering, two clock inputs, and semaphore for controlling memory chips.

To further complicate things the 4004 isn't a Von Neuman architecture computer. This makes the chip somewhat exotic since most modern computers are Von Neuman architecture machines. That means that, among other things, executable code and generic data are both stored in one shared address space. Instead, the 4004 is closer to a Harvard architecture, it has a separate address space for code and data. While there are some side issues caused by this design choice, the largest problem is that it imposes even more limitations on programmers. The limited memory the chip can address is broken into two smaller segments. You only address up to 640 bytes of memory for data, and 4096 bytes for executable code. That segmentation makes the 4004 look a lot more like a microcontroller than a microprocessor.

Outside the strange memory mapping you get something a little more familiar. The CPU is register based, with 16 general purpose registers. Each are 4-bits wide, and named R0 through R15. There is an additional 4-bit accumulator for storing the result of calculations and a 12-bit program counter for storing the location of the currently executing instruction. That's all pretty standard, later Intel chips would also be register based. If you've used any x86 chips before, you may see what's missing here. There are no pointer registers. That's because the 4004 doesn't implement any real form of a stack. The only thing that comes close is the internal call stack, which is comprised of three 12-bit registers. You aren't going to be getting anything recursive running on here very easily.

All tolled, the details of this 4004 make it a reasonable controller for computerized machines but not a very capable general purpose processor. The biggest issue that I can see just from the spec sheet would be implementing any kind of interface beyond a simple front panel. Text processing would be exceedingly difficult. In the now standard ASCII scheme a single character is 8-bits which would take up two registers on the 4004. That means that doing a simple operation like a string compare would take a lot of juggling. Then we run into the issue of having limited space for code, each machine code instruction on the 4004 is either 5 or 8 bits wide. For simplicity, if we say a program is totally composed of 8-bit instructions then we can have, at most, 4096 instructions. That isn't really enough to get much done. That being said, the 4004 is still quite a feat for such an early microprocessor. In the coming years, Intel would put out much more capable chips.

To learn more about the history of the 4004, you can listen to my episode on the topic here.