50-Year-Old Program Gets Speed Boost

At first glance, getting a computer program to run faster than the first electronic computers might seem trivial. After all, most of us carry enormously powerful processors in our pockets every day as if that’s normal. But [Mark] isn’t trying to beat computers like the ENIAC with a mobile ARM processor or other modern device. He’s now programming with the successor to the original Intel integrated circuit processor, the 4040, but beating the ENIAC is still little more complicated than you might think with a processor from 1974.

For this project, the goal was to best the 70-hour time set by ENIAC for computing the first 2035 digits of pi. There are a number of algorithms for performing this calculation, but using a 4-bit processor and an extremely limited memory of only 1280 bytes makes a number of these methods impossible, especially with the self-imposed time limit. The limited instruction set is a potential bottleneck as well with these early processors. [Mark] decided to use [Fabrice Bellard]’s algorithm given these limitations. He goes into great detail about the mathematics behind this method before coding it in JavaScript. Generating assembly language from a working JavaScript was found to be fairly straightforward.

[Mark] is also doing a lot of work on the 4040 to get this program running as well, including upgrades to the 40xx tool stack, the compiler and linker, and an emulator he’s using to test his program before sending it to physical hardware. The project is remarkably well-documented, including all of the optimizations needed to get these antique processors running fast enough to beat the ENIAC. We won’t spoil the results for you, but as a hint to how it worked out, he started this project using the 4040 since his original attempt using a 4004 wasn’t quite fast enough.

The 4004 Upgrade You’ve Been Waiting For

You know how it is. You have an older computer, and you can’t run the latest software on it. Time to upgrade, right? Well, if you have been in this situation a very long time, [ryomuk] may have an answer for you. The emu8080on4004 project (Google Translate) offers a way to run 8080 code on a 4004 CPU. Finally!

The 4004 development board is a homebrew affair, and the emulator works well enough that an 8080 Tiny BASIC interpreter ran with very few changes to the source code. You can see it working in the video below. It would be cool to run CP/M, but we imagine that would be a little harder, especially resource-wise.

A few things are missing. For example, the DAA instruction doesn’t exist, and there are no provisions for interrupts. There’s only one I/O port, and using the IN instruction will block until you receive a serial port character. There is an option to implement the parity flag in the 8080 flags register, but its operation is untested.

Still, pretty impressive for a 4-bit CPU running at 740 kHz with very little memory. If you want to see more about the development board itself, check out the second video below. Want to know more about the chip that launched a family of processors that is still around? Read its biography. You can also read about the designer who put his signature on the die.

Continue reading “The 4004 Upgrade You’ve Been Waiting For”

Calculating Pi On The 4004 CPU, Intel’s First Microprocessor

These days we are blessed with multicore 64-bit monster CPUs that can calculate an entire moon mission’s worth of instructions in the blink of an eye. Once upon a time, though, the state of the art was much less capable; Intel’s first microprocessor, the 4004, was built on a humble 4-bit architecture with limited instructions. [Mark] decided calculating pi on this platform would be a good challenge. 

It’s not the easiest thing to do; a 4-bit processor can’t easily store long numbers, and the 4004 doesn’t have any native floating point capability either. AND and XOR aren’t available, either, and there’s only 10,240 bits of RAM to play with. These limitations guided [Mark’s] choice of algorithm for calculating the only truly round number. Continue reading “Calculating Pi On The 4004 CPU, Intel’s First Microprocessor”

The Surprising Story Of The First Microprocessors

If you maintain an interest in vintage computers, you may well know something of the early history of the microprocessor, how Intel’s 4-bit 4004, intended for a desktop calculator, was the first to be developed, and the follow-up 8008 was the first 8-bit device. We tend to like simple stories when it comes to history, and inventions like this are always conveniently packaged for posterity as one-off events.

In fact the story of the development of the first microprocessors is a much more convoluted one than it might appear, with several different companies concurrently at the forefront of developments. A fascinating recent IEEE Spectrum piece from [Ken Shirriff] investigates this period in microprocessor design, and presents the surprising conclusion that Texas Instruments may deserve the crown of having created the first 8-bit device, dislodging the 8008 from its pedestal. Continue reading “The Surprising Story Of The First Microprocessors”

4004 ROM Emulator Allows Fast Development On Slow Computers

Developing for extremely old computers is a chore; not only are you limited by assembly or pure machine language, there’s also the issue of burning ROMs to actually run your programs. [Frank Buss] came up with a neat solution to developing for the venerable 4004 CPU – build a ROM emulator using a modern microcontroller.

The build started off with a ZIF socket for the 4004 CPU and a 256 byte 4001 ROM chip emulated on a PIC micro. The CPU looked a little lonely sitting in the ZIF socket all by its lonesome, so [Frank] updated his board to allow a 4002 RAM chip to be plugged in as well.

Because [Frank] chose a 4004 for his entry for this season’s retrochallenge competition, we need to point we’re offering a prize for loading our retro site with this CPU. Yes, it’s most likely impossible but nothing worth doing is easy.

You can check out a video [Frank]’s ROM emulator after the break.

Continue reading “4004 ROM Emulator Allows Fast Development On Slow Computers”

Intel 4004 Internals

The silicon wizards at Flylogic have certainly posted an interesting chip this time around. The Intel 4004 was the first widely used microprocessor. The logic gates are much larger than you’d find in modern chips. The unique feature is that each gate is designed to make the most efficient use of the silicon instead of the standardized shapes you find now. They’ve uploaded a full image of the chip.

For an introduction to silicon hacking, we reccomend [bunnie]’s talk from Toorcon and [Karsten]’s talk from 24C3. You can find many more posts on the topic in our silicon tag.