• Please review our updated Terms and Rules here

4004/4040 Projects

Slob

Experienced Member
Joined
Oct 20, 2017
Messages
181
Location
Kentucky USA
On my “bucket list” was building a 4004 single board computer. I’ve collected the parts over the years but have tried to use them and generally failed. Over the last few years, Github projects popped up that made this fairly easy and productive. I couldn’t decide which to build so I wire wrapped both of them.

The first, designed by Jim Loos (at https://github.com/jim11662418/4004-SBC), was fairly straightforward to build and didn’t need any unusual parts besides the 400x family chips (but see below). The firmware included tic-tac-toe and number guessing. Arithmetic and I/O port examples are also included in the menu-driven system. Some small modifications I made to the hardware were the use of a DC-DC converter hidden on the back of the board, optional use 4002-2 and 4040 sockets, and the use of a 2764. You can’t add the 4002-2’s without modifying the setup of the 4265 to four input ports in the firmware.

The second (and considerably more complex) project was by Ryo Mukai of Japan (at https://github.com/ryomuk/test4004). This uses external non-400x family, +5V logic based RAM (paged, yet). The RAMs were a bit tricky to find; I used Jim’s RS-232 hardware and a 27C256 due to parts availability (parts in my house); I used a 4201 clock generator; there is a 4040 socket; a DC-DC converter was also used for the +5/-10 from 12V wall wart input. I added the 4265 from Mr. Loos’s design but this is not used in the stock firmware. The stock firmware does floating point math fairly well and also does square root calculations to 15 or 16 digits, very, very cool (but not very fast!). While I was doing this, he updated the project to use bigger RAMs and actually wrote an 8080 emulator that runs on the 4004 (VERY slowly, but can run Tiny and otherwise BASIC). Crazy, but absolutely amazing!

I built quickie oak/stained frames for them with Lexan backs to “display” the wire wrapping. The 4040 CPU's, as expected, run the firmware on both boards perfectly (although you need to remove the 4004’s first, of course). The sockets are high quality machine pin - I learned the “good socket” lesson long ago. I have wire wrapped projects almost 25 years old that still work fine with this type of socket, untouched!

At first, I didn’t have the proper crystals for these projects (and apparently neither did Mr. Loos). Incredibly, I bid on, and won, a bag of 100 on eBay at a silly low price, actually lower than Q1 price from someone else. So now, I have a “lifetime” supply of proper CTS 5.185 Mhz crystals for the 4004/4040. If anyone plans on actually building a 4004 or 4040, I can send you some, PM me (while supplies and/or I last, ha ha). If Mr. Loos or Mr. Mukai read this forum, some are reserved for you, although I can ship them in the US only.

Interesting point in making “retro” looking projects. “Period”, large diameter 0.1 uF disk bypass capacitors (big like they once were, in the 60’s to 80’s) are apparently getting thin on the ground and expensive once you find them.

j1.jpgj2.jpgt1.jpgt2.jpg
 
Congratulations on getting these up and running. The layout planning and craftsmanship make them works of art.
 
That is cool. I'm glad to see others taking up the challenge of creating 4004/4040 projects. I have a couple other possible projects but for now I do need to get my Maneuver Board into a box. As for the crystals, I don't see the need to run at the maximum speed. Do note that they do have a minimum speed. The CPU's registers are dynamic and will drop out if you don't keep the minimum clock speed.
If I had to do mine over, I'd make at least one change and that is to use 2 ea of the display driver chips instead of just one. I'm pushing it a little past its recommended max when all digits are displayed.
The code for the Maneuver Board is on github, should you want to add CORDIC for trig functions. That part of the code was written by Gary Kildall. It is for tangent but could easily be adapted for sine and cosine, with different coefficients. I only met him once before he was gone :(
I've got several 4265's someplace I suppose I should create a project for them. I suppose I'd use a 4040 to take full advantage of them.
With the 4040, you can use RAM in the instruction space and a 4289.
Dwight
 
Ha ha, I’m working on it…although I wrapped an 8008 about 25 years ago, it was just a demo board and couldn’t run SCELBAL…
 
This is my build of jim Loos’s 8008 SBC. A few differences were the use of a crystal, not an oscillator can (spare 4049 gates were used). I added a power good display, and used a DC-DC converter for the -9VDC (serial interface built with old-time RS-232 chips). I used a 27C256 (I have lots). I added a not very useful but somewhat cool-looking front panel that displays the addresses and the ROM data/instruction at that address (driven by HCT373’s), and the first five bits of the output port. The past few projects have put a dent in my pre-“high efficency” red LED parts supply (that have a deeper red color than modern LED’s do). I used ALH and ALL to latch the addresses and the ROMREAD for the data. This is not really good enough, so I might modify the first GAL to improve this or do something with a spare socket on the board.

I found a few mistakes in the schematics, but nothing that an experienced person would not notice and correct before building it. The monitor is good but you really have to read the source code in order to use it properly. The code to read BIN and HEX uses inobvious features of the AS assembler and I basically had to recreate what was probably the “makeall” batch file to make all of the .HEX and .BIN files (unless I missed something in the readme). I did find that the “pi1000” program somehow produced an inaccurate answer for pi, but the 100-digit version worked fine. Haven’t figured that out yet. This is probably an issue in the originial source code.

I would like to update the well known MIL monitor source so that it will compile properly with the AS assembler and be usable here (split octal issue). I used another assembler for the code used to compile the MIL monitor in my emulator and it output code with a bug that renders it unusable. I don’t know if it’s a bug in the assembler that I used, or a problem in the emulator code, or in the original Dunfield transcription (it isn’t the known fixed bug in the Dunfield transcription).

The wire-wrapping was tougher than building the 4004’s, mostly due to the highly multiplexed 8008 and higher density. I could not come up with a “good” layout minimizing distance and wrapping to my satisfaction. And, I picked up and put down this project several times while building it. It was interesting to compare the speed ofr my ESP8266 8008 emulators to this (the emulators are faster, but not as much as I would have thought).

A fun project! I put it in a box made from some small oak scraps I had left over from other projects.
 

Attachments

  • 8_TOP.jpg
    8_TOP.jpg
    728.4 KB · Views: 33
  • 8_BOTTOM.jpg
    8_BOTTOM.jpg
    922.8 KB · Views: 32
  • 8_BACK.jpg
    8_BACK.jpg
    417.3 KB · Views: 26
  • 8_FRONT.jpg
    8_FRONT.jpg
    142.2 KB · Views: 26
Well done. Please let me know about the mistakes in the schematics that you found so I can correct them.
 
Last edited:
Well done. Please let me know about the mistakes in the schematics that you found so I can correct them.
They were, that on the VCC/GND page, the LS245 is connected to -9 instead of ground, there is only one GAL and one LS273 shown, and there are two LS367's shown (there's only one AFAIK). I would (and did) put bypass caps on the GAL, ROM, RAM, and 4049 especially with wire wrapping but that's probably overkill and possibly useless given that they are CMOS parts.

BTW, I've been looking at www.smbaker.com with the new "front panel" 8008 board that Dr. Baker built (there is also a YouTube video). He also made a FORTH that he thinks should run on your design. I got that to compile but I could not get it to work. This may be a "make" problem or starting address problem on my side.
 
Back
Top