This is my first attempt at the ALU - preserved here with all the mess - nothing tidied up. ALU inputs:
ALU outputs:
After much research the ALU design is a simplified/extended version of the AYTABTU ALU and is shown below. The total is 13T per bit slice.
For:
And, here it is, one bit slice of the ALU. Note that the two and three input NOR gates are one transistor with 10k resistors to base and 1k to 3.3V. This doesn't work for more than three inputs, so the four input NOR gates (11 and 14 above) are diodes from all the inputs and then a 10k to base. Getting all of this wired up took me a couple of days and it's still very fragile (too many long bare wires that touch if components are moved). It needs laying out on perfboard. The Ripple Carry bottleneck. This is going to be the main bottleneck of the whole CPU, so when I tidy this up it'll get a page of it's own. It makes a nice story, first I was worried about the component (leg) count so I designed a very efficient memory cell, then I was worried about the overall speed so I optimised the ripple carry. First I hacked up something that looked like half the ripple carry. 16 NOR gates, 10k from the output of one to the base of the next. 5k from base to ground (assume 3 input NOR, each with 10k to ground). 1k load. It runs at about 140 kHz so I would expect the whole thing to run at 70 kHz, or about 6 times slower than the memory. This is a bit disappointing, if not completely unexpected. It's time to work out how speed-up capacitors work. Okay - RC should be considerably less than the switch time which is 1/140000 for 16T. R is 10k so C should be much less than 44 pF. 12 pF runs 25% faster. More analysis. I've ruled out one-transistor solutions (see Outtakes) so that leaves speeding up the current design. It's gates 10 and 13 that matter, an even then it's only the carry path that is slow, so the other inputs can be diodes (so I don't have to worry about input inpedance). Its capacitance that is the killer, so I can:
With a 1k load (my standard) I get a very sharp cut off with the 2N 3904 B311 NPN transistors I'm using (my next order is different, I have to check again). Here it is the voltage across the transistor as a function of bias voltage (somewhat crude): So with <0.63V input for OFF and >0.70V for ON I have great switching, that's only 0.07V to switch over, so much less charge to store for the same capacitance. Note - Baker Clamps and Schottky diodes so that the transistor never saturates Note - interesting post saying that it's the OFF time that slows everything down http://www.diyaudio.com/forums/power-supplies/260132-switching-transistor-off.html Note - NPN + PNP push-pull |