NAND Issues Resolved

A project log for CBJT Logic

Complementary bipolar junction transistor logic - like CMOS, but with NPNs and PNPs

ted-yapoTed Yapo 01/15/2017 at 17:1110 Comments

Yes, it was poor layout on the prototype. A long alligator lead used to pull one NAND input high had enough inductance to resonate with the input network and cause problems. I was able to simulate it in LTspice by adding an inductor where the long lead was. The yellow trace is the base of the upper NPN, and shows ringing like I saw on the hardware:

The 200 nH value was a complete guess - the actual inductance would depend on how I draped the alligator lead on the workbench, but the qualitative behavior was the same as I observed.

To fix the problem, I tied the upper input high with a very short wire. The circuit doesn't show the resonances anymore, but the propagation delay is still relatively long and somewhat sensitive to input pulse width. For instance, with a 1 MHz input signal, the propagation delay is around 16.5 ns, rising to 19.7 ns at 10 MHz:

On a longer timescale, the 10 MHz output still looks usable - I think you could go even higher:

Edge Rates

The fact that this circuit had issues with long leads on a "DC" input made me wonder about the edge speeds - that's what determines how much you have to worry about layout. The conservative rule of thumb is that you have to treat wires electrically longer than 1/6 of the transition time as transmission lines and terminate them at one or both ends to suppress waveform-distorting reflections. So, I decided to measure the edge rates.

In the book, "High Speed Digital Design: A Handbook of Black Magic", Johnson and Graham describe five methods for estimating the rise time of logic signals:

  1. Differentiating the step response to yield the impulse response then taking the standard deviation
  2. 10%-90% direct measurement
  3. 20%-80% direct measurement
  4. Center slope measurement
  5. Maximum slope measurement

(1) is interesting but too involved for now. (2) and (3) are complicated by the ringing, overshoot and odd shape of the waveforms. That leaves (4) and (5), which measure the slope of the rising edge, either at the center of the edge, or at the position of maximum slope. I just used cursors to measure the slope somewhere around the middle:

The measured slew rate is 440 mV / 960 ps = 0.458 V / ns. According to this site, this is about half the slew rate of 74HC logic at 5V supply, which is about 0.9V/ns. But, the supply here is 1.1V, only 22% as high as the 74HC. According to Johnson and Graham, this translates into a CBJT rise time of:

The same calculation for 74HC logic at 5V supply yields 5.5ns rise time, which agrees with 5ns figures I've seen quoted elsewhere. So, CBJT logic has edge rates about twice as fast as 74HC. While at first this might sound good, it means complications for laying out projects with CBJT logic. Light travels 72cm in 2.4ns, so you might have to treat wires as short as 12cm as transmission lines (assuming velocity factor = 1). You could add some more parts to slow the rise time (a simple RC network on the output would do it), but it detracts from the simplicity of the design. Maybe you can just add an extra RC at the output when you have a long run to drive.


K.C. Lee wrote 01/15/2017 at 22:16 point

The oscillation might be cause by current flowing back from output to input as it is only a diode drop away.  Add a bit of LC and you have an oscillator.  

Seems like that you might have to buffer both the inputs even if it is static level.  This type of logic gate is fussy enough to make it unsuitable for general use.

  Are you sure? yes | no

Ted Yapo wrote 01/15/2017 at 23:17 point

Yeah, I would hope that anyone looking at this project gets the joke.  I suspect most people building logic from discrete components know that in 2017 it rarely, if ever, makes sense from a practical perspective, and they're doing it for other reasons, be they pedagogical or simply perverse.

  Are you sure? yes | no

Eric Hertz wrote 01/16/2017 at 11:23 point

...are those last two terms so different as to require an "or" rather than an "and"?

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/16/2017 at 14:52 point

... says the guy who built a clock out of diodes ;-)

But for me it's not a joke at all and I'm really interested by practical applications and implications :-D

  Are you sure? yes | no

Ted Yapo wrote 01/16/2017 at 17:02 point

@esot.eric. You must have had a few of the same teachers as I did!

@Yann Guidon / YGDES I think a few missed the diode joke :-)

On the other hand, you have people who use tens of thousands of transistors (#TritiLED) to more than a quarter million (arduinos) just to blink an LED.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 01/16/2017 at 20:40 point

that's really nothing compared to billions and billions of transistors for cat pictures.

  Are you sure? yes | no

Ted Yapo wrote 01/16/2017 at 20:51 point

New contest: cat picture with minimum transistor count. Maybe use compressed sensing with a can-opened transistor like #Germanium Vision

Extra points if it's a dog :-)

  Are you sure? yes | no

David H Haffner Sr wrote 01/15/2017 at 20:40 point

Right now I'm using the parts in the libs, they seem to have everything I need for right now, its for a project in the future which requires a stepper motor and LED driver (internal.) I know just what UR taking about when it comes to "parasitics," especially when designing logic touchy! 

I remember building a solid state self-tuning Tesla Coil W/560 coil wrappings-30AWG and because I was not careful with good soldering practices, the the tuning wire, that's between the coil and primary windings started "taking" to each other from a similar effect as your's above. 

Which caused many feedback burn outs!

  Are you sure? yes | no

David H Haffner Sr wrote 01/15/2017 at 19:17 point

Hey Ted, I downloaded LT spice and the component lib is awesome, how confident are you in the simulation waveforms?

  Are you sure? yes | no

Ted Yapo wrote 01/15/2017 at 20:09 point

It depends on what you're doing.  If you're using LT parts, they're probably accurate.  With other parts, the models may or may not be the best available.  For high-speed or high-precision designs, you also need to manually add components to simulate parasitics - my problems above are a perfect example: the long wire behaves as an inductor in the circuit; without it, the simulation didn't show the problem at all.  For less demanding designs, you can usually just plop all the components in and be fairly confident in the results.

There are many SPICE models on the web and available directly from manufacturers, too.  It's easy to add them to LTspice - you can even paste simple models (like for a diode or transistor) right into the schematic.

It's no substitute for real measurements, but you can do "cut and try" design much faster in SPICE than with a soldering iron.  Except for cases like the above, when I've done basic design in LTspice first, stuff pretty much "works" first try in real life.  The design might need tweaking, but simulation will get you close.  The best part may be that the measurement capabilities in simulation are just awesome compared to making real measurements.

As far as LTspice itself, I have no complaints.  I started with SPICE as an undegrad c. 1990 (my professor called lines in the files "cards"), and think I started with LTspice itself around 2001/2002  - I remember taking my laptop on a vacation around that time just so I could play with it.  It also runs great on linux - what's not to like?

  Are you sure? yes | no