• Please review our updated Terms and Rules here

Interest in I4004

Got it mostly figured out. P1 (R2,R3) points to the dividend. P3 (R6,R7) points to the divisor. P4 (R8,R9) points to the quotient.

I don't know what P2 (R4,R5) points to, but it's not the remainder. for example, when I divide 9999999 by 2, the register that P2 points to contains all zeros. When I divide 1000 by 3, the register that P2 points to contains 1000. When I divide 22 by 7, the register that P2 points to contains 600000. ???

The quotient is a 16 digit number with the decimal point in the middle. For example, dividing 9999999 by 2 gives 4999999500000000 which is 4999999.500000000

More about P2:

When 1000000 is divided by 3, P2 points to 1
When 100000 is divided by 3, P2 points to 10
When 10000 is divided by 3, P2 points to 100
When 1000 is divided by 3, P2 points to 1000
When 100 is divided by 3, P2 points to 10000
When 10 is divided by 3, P2 points to 100000
When 1 is divided by 3, P2 points to 1000000

I did some more experimenting. First, the quotient has it decimal point at half way. The divisor looks to be first divided by 10. The R register has the dividend pushed to the bottom end of the number if the result overflows, other wise it is 0.
So, reading high memory to low( which is how number are stored ) the dividend number 0000000460000000 is 4.6. The divisor 0000000200000000 looks like 2.0 but is really 0.2 the quotient will be 0000003200000000 or 32.0 ( note the 10* because the divisor is really 0.2 ). Underflows are just truncated.
Note, as I said the decimal point is assumed to be in the center. This is mainly important for divide!
Dwight
 
I thought I'd mention, the inputs are assumed to have a decimal point as well in the center ( except the /10 of the denominator ). For the most art, this makes little difference since the result is a ratio. Where it does make a difference is on the compliance of the values. It seems to make some difference. It does a poor check to make sure that the divider isn't bigger than the dividend. It does this by counting comparing the leading zeros. The remainder R, makes more sense when the decimal point is adjusted 8 places to the right for the remainder. As an example:
11.0 divided by 300.0 displays .36666666 with R = 0.2
On my calculator I multiply .36666666 by 30 and get 10.9999998. If I add 0.0000002 I get 11.0.
So the only thing that is confusing is that the divisor is divided by 10. But if the decimal point is in both the dividend and the divisor, the remainder is correct but shifted 7 places to the left.
So, the remainder is correct but you need to put the decimal point of the input data in the right place.
I think things work correctly if you assume the divisor is divided by 10 but maybe it makes more sense if you assume the dividend it multiplied by 10. It is getting to complicated for my head but the key is putting the decimal points in the input data, then the remainder makes sense.
Dwight
 
I thought I'd update this as finally have my hardware working. It has been a long project, coming along in spurts.
When I made my hardware, I'd thought I might get some of the levels wrong. I'd used two buffer, a 74LS244 and a 74LS240, thinking if I got things wrong, I could simple swap the two. As it turned out, I got the key board levels write and half the display controls inverted. Swapping the buffers would have killed the keyboard.
I made change to the display code. That was when I found that the order of the display was wrong. I'd made the scan left to right but the code was right to left. I had to rewrite the display code anyway so it wasn't a really big deal. It is only a tiny part of the overall code that I had to change.
I'll have a video on the virtual "West Coast VCF Computer Festival" and hope to be available for questions then.
Dwight
 
NCR display boards with Intel 4003's

NCR display boards with Intel 4003's

continuing my clean up & finally found these pcb's I bought with Intel 4003 on them

2kNofi7.jpg


xAw0tu5.jpg


While both are populated the same one had NOT been soldered.

So my plan is to carefully remove the components and take some high resoultions scans or like so foke here can then have access if they wish.

Maybe there is a direct way to scan into a pcb cad package the track layout straight from the board I will remove parts from.

Any thoughts

KWZDxYW.jpg


DchEI1d.jpg


some of my Intel chips ready for building my I4004 system (one day really hope I will )
 
If you want to go a little cheaper, the 4040 runs all the instruction of a 4004. If you pair it with a 4289, you can even uses RAM as part of the address space. It also covers 8K of instruction space. If you use a 4004 you can drive RAM but the writes need to be mapped as ROM I/O, even if intend to map them in the instruction space as reads.
With two of those boards, you have enough display to create the maneuver board display. The manuever board takes most of 4K of space. There are a few holes around page boundaries but the last page is unused. One could easily put the display there. In the maneuver board, they don't use any of the RAM outputs. It is a large waste but then there is no need for a level shifter as it uses the 4289 outputs. The original design use the 4008/9 chips to interface to TTL levels. It also used 13 ea 1702As. I could have done that but at prototype board cost, I couldn't justify the additional cost of 12 more 24 pin sockets. The original spread the 16 displays across the top of the board.
I did have to rewrite the display code. I made my display to be scanned left to right. When I finally got code running, I found that it was intended to be right to left. There is one more piece of code there in the NPS library. It is to be used as a load calculator for a helicopter. I suspect it is a little less complicated than the maneuver board that has to determine sines and cosines.
One has to really watch the load of a helicopter. The ground effect give the impression of having enough lift but you go a little higher and the blades stall.
You don't see the 11 jumpers on the bottom of my board because of a dumb layout error.
I'm not sure I'll ever be running a large ship and need the results of a maneuver board calculation but just in case, I'm prepared!
Another handy chip to get are the 4265 chips. These are rare but usually go for cheap because few people actually used them. If I'd have known I was going to rewrite the display code I might have use several of them.
Dwight
 
Last edited:
As for the boards, they can be used as is. I see no reason to strip them. You just need another red led and another two transistor to complete the display. You don't even have to match the transistors, you just get something that can drive 30 or 50 ma.
My guess is that the boards were driven from several outputs of the 4002 chips.
Dwight
 
As for the boards, they can be used as is. I see no reason to strip them. You just need another red led and another two transistor to complete the display. You don't even have to match the transistors, you just get something that can drive 30 or 50 ma.
My guess is that the boards were driven from several outputs of the 4002 chips.
Dwight

Hi Dwight, the reason I mentioned 'stripping them' was NOT desoldering them BUT one board had NEVER BEEN soldered. Components simply placed. So my thought was before I actually solder the components to this board was to carefully take all components off it, and take some very high-quality pics or scans of the track pattern so someone else can get to make identical or near-identical boards
 
I did a talk on my board at the "Virtual Vintage Computer West 2020". It is currently up on youtube. Just do a search for the quoted text. My talk starts at 2:54:37 and ends at 3:14:15. It was recorded before I had my display working correctly for the original program but the hardware was functional, it just needed some software patches for the display.
There are a lot of other excellent talks worth listening to. The chart to the left gives you the approximate time ( of day day for us ) and order of the talks. At least two of the talks were combined together so don't expect the hour difference times to be exact, from the chart. There were many excellent talks worth checking out.
Dwight

PS the computer I was running on belonged to my son, Emmett. My name is really Dwight.
Also I think microphone@vcfed.org is still working for questions. Or any question for me can be put here for all to share.
 
Last edited:
I thought I'd post here as this may be a better place to post than the Intel Library stuff.
As I believe I mentioned, I'd gotten EPROMs with the labels A0740 to A0743. I'd believed that the 4th EPROM had some bit rot. As it turned out the code was intact. This was the resident 4004 assembler that ran on the SIM4-01/02 boards. The was written by Tom Pittman, in the early Intel days.
Daver2 and I have been try to get code up and running on simulators.
Daver2 has had some issues with the code from the web but I was using my own simulator code so didn't run into such problems. I've been bringing it up in stages so that I can check the things are moving along as expected. The use is describe in the MCS4 Users Manual, found on bitsavers. Look at Appendix F.
It is designed to work with a ASR33 that has a modification to pause the tape reader. Only 3 bits of the SIM4's I/O are used. One bit of ROM input, for tape reader input, one bit of the RAM output port is used for the TTY punch and another bit of the RAM output is used to throttle the tape reader.
I wanted to check out the code in a simulation, expecting to debug much of the code. As it turned out, it didn't need any. It looks like the parts that I thought were damaged in the EPROMs were likely remnants of previous hand edits an not really issues with the code. There were a few other places where entrants into routines seemed to enter into mid two byte instructions. As it turned out this was some of Tom's clever byte savings. It would clearly make today's programmers cringe. Tom used a number of tricks that some of the emulators has issues with, as they did not properly emulate edge cases properly.
We have now resurrected, this code from the past. It can likely run on a 4004. Tom uses the fact that it is a 4 level stack( one level for the PC ). It uses the fact that it can overwrite the last level to change modes. This means it has to be a 4004 and not compatible with a 4040 that has an enhanced stack. It also needs real 4002's. it needs a minimum of three but can use more. This is storage for labels extracted on the first pass. The more RAM you have the more labels it can hold.
Dwight
 
I thought I might add this here. There are several simulators for the 4004 on the web. There is a mostly undocumented operation of the 4004 when you do a fourth JMS without a return. It over writes the last stack value. What the document doesn't say is what it over writes it with. Tom's assembler expects the 4004 to do what the actual silicon does. Here is a simple program to verify your version of simulating the 4004. Do note, the 4040 has a deeper stack and this code will produce the wrong result if run on a 4040. Tom's assembler will also fail on a 4040.
This code is written to be compatible with Tom's assembler.
Dwight

Code:
/ STACK TEST FOR 4004, NOT 4040
/ ENDS WITH 15 IN ACC SIMULATION IS CORRECT
 JMS L1
 LDM 0
  JUN ENDTEST
L1,  JMS L2
  BBL 1
L2, JMS L3
  BBL 2
L3,  JMS L4
  BBL 3
L4,  BBL 4
OVER,  LDM 15
ENDTEST,  JUN ENDTEST
$
 
Last edited:
Say you want to do something with the 4004 but you don't want to invest hundreds of dollars without knowing if it will even work. Ok, here is something you can do on a budget. Here is a cheaper way to do it. First use a 4040. These are cheaper and easier to find. Get an Arduino MEGA ( or clone ) and 8-Bit-Force's 4004 shield. Wire up an adapter socket for a 4040 to 4004. You can then simulate what ever project you'd like. It is a little more expensive than a full software simulator but it will run like the real thing, using a real processor.
For using the 4040 to 4004 here is the wire table. The 4040 will do all 4004 code that doesn't depend of the 4004 stack overflow actions.

Here is the wire connect chart for the adapter.
4004 4040
1 ---- 1 D0
2 ---- 2 D1
3 ---- 3 D2
4 ---- 4 D3
5 ---- 6, 7, 9 -V
6 ---- 10 Phase 1 clock
7 ---- 11 Phase 2 clock
8 ---- 16 SYNC
9 ---- 12 RST
10 ---- 13 TEST
11 ---- 23 CMROM
12 ---- 14, 15, 21 +V
13 ---- 17 CMRAM3
14 ---- 18 CMRAM2
15 ---- 19 CMRAM1
16 ---- 20 CMRAM0

4040 unused pins: 5, 8, 22, 24

Dwight
 
Say you want to do something with the 4004 but you don't want to invest hundreds of dollars without knowing if it will even work. Ok, here is something you can do on a budget. Here is a cheaper way to do it. First use a 4040. These are cheaper and easier to find. Get an Arduino MEGA ( or clone ) and 8-Bit-Force's 4004 shield. Wire up an adapter socket for a 4040 to 4004. You can then simulate what ever project you'd like. It is a little more expensive than a full software simulator but it will run like the real thing, using a real processor.
For using the 4040 to 4004 here is the wire table. The 4040 will do all 4004 code that doesn't depend of the 4004 stack overflow actions.

Here is the wire connect chart for the adapter.
4004 4040
1 ---- 1 D0
2 ---- 2 D1
3 ---- 3 D2
4 ---- 4 D3
5 ---- 6, 7, 9 -V
6 ---- 10 Phase 1 clock
7 ---- 11 Phase 2 clock
8 ---- 16 SYNC
9 ---- 12 RST
10 ---- 13 TEST
11 ---- 23 CMROM
12 ---- 14, 15, 21 +V
13 ---- 17 CMRAM3
14 ---- 18 CMRAM2
15 ---- 19 CMRAM1
16 ---- 20 CMRAM0

4040 unused pins: 5, 8, 22, 24

Dwight

Opps!!!!!
Note, the wires and pins are correct but the polarity of the rails got swapped. 4004 pin 5 is the positive voltage and 12 is the negative voltage.
Dwight

Here is the wire connect chart for the adapter.
4004 4040
1 ---- 1 D0
2 ---- 2 D1
3 ---- 3 D2
4 ---- 4 D3
5 ---- 6, 7, 9 +V
6 ---- 10 Phase 1 clock
7 ---- 11 Phase 2 clock
8 ---- 16 SYNC
9 ---- 12 RST
10 ---- 13 TEST
11 ---- 23 CMROM
12 ---- 14, 15, 21 -V
13 ---- 17 CMRAM3
14 ---- 18 CMRAM2
15 ---- 19 CMRAM1
16 ---- 20 CMRAM0

4040 unused pins: 5, 8, 22, 24
 
I thought I'd mention, I expect to exhibit 4004 stuff at the coming West Coast VCF, in August. I will have my SIM4 setup, the Maneuver Board and Erturk's Arduino, acting as a calculator with an interface for a real 4004. I only have the two 4004's so will be using a 4040 instead.
I've been writing some more 4004 code. As I mentioned before, I'd written a copy program to use the SIM4-01 and MP7-3 to copy 1702As without having to serially down load and then upload to the new EPROM copy of the first. The problem with this is that one has to remove the first EPROM to install the OneCopy EPROM. This is not what one would want to do regularly. After giving it some thought, I decided to add a 4th EPROM to the normal 3 EPROM programmer code. I've added two new functions to the A054x set. One is to do the OneCopy function and the other is an erase check program. As I noted before the OneCopy took a lot of effort to squeeze it into a single 1702A. I'd originally hoped that I could use the programming code in the A054x set but their original code is just an entire piece of code with no separate entry or exist for programming a single byte. I could use their serial In/out as well as a byte compare for the command interpreter. As you'll recall, I had to do quite a bit of optimization to pack the OneCopy routines into one 1702A. It had no command interpreter, as the sequence use the Test input and 4 LED's to sequence things.
Still, I didn't let that stop me. I had to write even more compact code, using every trick I could think of. I wanted to not only have the OneCopy function but also the Erase check. At first is looked like, even with my most clever code it just wasn't going to fit, Then I realized that the Erase check was really similar to the reading of the Master EPROM for the OneCopy code. I desided to do both operations at the same time. For the Erased check, I ignored the save RAM data and for the OneCopy I ignored the Erased status flags. This got it small enough.
The Erased check code keeps track of three things, If the EPROM reads all zeros, it return a 0, if the EPROM is all 1s ( FF hex ), it returns a 1. If it is mixed data, it returns X. Both the 0 and 1 could mean it was erased, depending on the state of the data complement switch, that controls a XOR on the data lines. Normally, a unprogrammed 1702A is all ones.
Dwight
 
Back
Top