whats the best way to implement a not gate.

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello everyone

 

so i recently began to study a bit of electronics from this site:

https://www.allaboutcircuits.com/

 

according to them logical inversion can be done in this way:

 

 

altough i guess it should be ok to do it like this:

 

 

the site describes the second one as "too crude to be of practical use" but does not quite clarify that.

 

please help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have to define the word: 

best

fast, low power, high output power, simple, small, cheap, ...

 

sub things, fast just in one edge (push or pull), low power (when shift, at one level, both lewels)

 

Is this a chip design, or made with components  

 

and many more things   

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It depends on what sort of performance you require. The second circuit is electrically slow and draws more current. Nevertheless, if you’re not looking for ultimate performance then you’ll see that circuit used a lot.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well the first one clearly uses more components and input power and is relatively less simple ,

 

but is there something which gives it an extra edge in chip design?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In reality (apart from silicon designers) then it's very unlikely anyone ever really implements NOT like this in transistors.  In logic gates (because things like FPGA tend to be a sea of NAND gates) then a NOT is simply a NAND with the inputs tied together ;-)

 

If doing it in 7400s or 4000s you might use something like a 7404 or a 4049 perhaps?

 

https://en.wikipedia.org/wiki/Inverter_(logic_gate)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

why would it draw more current

the first one requires more than one transistor in saturation while the other takes only one.

and why exactly slow?

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if that can be explained it will be clear since ics require performance and not really need to worry about most other factors.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am afraid that, without specifying, in the least, the values of resistors and the types of the input source and of the output load, a real comparison cannot be achieved concerning speed and supply current in the two logical states.

And, the voltages of the two logical levels (0 & 1) need to be specified, as well.

 

There are also other factors to be considered by professional engineers as the temperature sensitivity of the circuit.   

 

Kerim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can build easily (takes only a few minutes) and observe the behavior of those two circuits in LTSpice.

The first one can switch in MHz range, the second one could be used only up to a few tens of kHz or less if the asymmetry matters, I assume. The turn off is terribly slow (see the dead time before the start of the rising edge).

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simple circuit is slow because it takes time to charge & discharge the base capacitance through the base resistor. The switching, once it starts, is slow. One transistor is lower gain than several.

If you are building the circuit using a breadboard and discreet components the simple circuit is much faster to build.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

amihkan wrote:
the site describes the second one as "too crude to be of practical use" but does not quite clarify that.
Huh?  Sure it does:

 

https://www.allaboutcircuits.com/textbook/digital/chpt-3/not-gate/

The single-transistor inverter circuit illustrated earlier is actually too crude to be of practical use as a gate. Real inverter circuits contain more than one transistor to maximize voltage gain (so as to ensure that the final output transistor is either in full cutoff or full saturation), and other components designed to reduce the chance of accidental damage.

 

Shown here is a schematic diagram for a real inverter circuit, complete with all necessary components for efficient and reliable operation:

The single-transistor inverter circuit is 'too crude' because it lacks all of those qualities (and more).

 

The rest of that page goes into excruciating detail about the operation of the 'real' circuit, and other alternatives like an open-collector version.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The explanation on that site is pretty good, but

I don't like how they point their arrows in the

direction of electron flow instead of current.

 

--Mike

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The second implementation of an inverter uses what was known as "RTL" or "Resistor-Transistor Logic". There were several families of IC logic devices built around this architecture before TTL was invented. I built several products, in my early work years, using these. Well, they started out that way but were replaced by TTL before the product release. 

 

Yes, RTL is slower but can have relatively modest current demands. If you don't need the speed, then it works well.

 

CMOS, by the way, works MUCH better than EITHER of these. So, please don't spend too much time fretting over RTL/TTL. Neither is used much, these days. If I need some discrete solution that an IC just won't satisfy, I will often use the CMOS version of RTL and be done with it. 

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the 21st century you should never work with actual resistors and transistors on such a low level.  Only advanced circuit IC designers work at this level, and they use expensive and complex IC design software.  These diagrams that show these components are only models of what is happening inside the NOT gate chip such as a 74HC04.  The actual switching is done by MOSFETs that are acting like NPN transistors and resistors.

 

On rare occasions you might find that you need a inverter gate.  So use a cheap 74HC04 IC instead of spending hours wiring up a 1960s-era transistor-resistor design.   Plus it is likely that you can find some place in your code where the signal can be inverted using software.

 

Beware of websites that are trying to fill your head with information that you would never use in the real-world.

Last Edited: Fri. Mar 1, 2019 - 06:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A recent project (still unfinished)-: needed a few

inverters so I used a 74LS04 I had in the parts

bin.  The project uses a mega328 to control some

555 timers which generate sound effects, and the

problem I ran into was due to the output pins

defaulting to inputs at power-on.

 

The floating output pins triggered all of the sound

effects whenever the project had power applied.

The inverter interprets these floating pins as logic

high and pulls its outputs low, keeping the sound

effects from triggering.

 

--Mike

 

EDIT: wording

 

Last Edited: Fri. Mar 1, 2019 - 07:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Totally disagree with Simonetta...

 

You use what is appropriate. Of course, that requires some level of knowledge about how things work and how to determine some sort of "optimum" for your situation. Example: suppose that I have a pretty dense circuit board and need several open collector/drain drive devices to control several pieces of hardware. These pieces of hardware are scattered across the board and running traces to them  from any central location will be a significant pain. So, rather than using some quad open-drain inverter, I might choose several SOT-23 NMOS devices that can be driven from various port pins around my MCU.  Doing this allows me a much greater choice of trace routing and less cluttering of an already tight layout. I might do that. I have done that. No sweat. 

 

The blanket statement that "nobody does that" simply does not add up. You do what is best for your application.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I also think the 1980s are calling and want their 74HC04 back. If you need a single inverter, why not use something like an SOT-package 74LVC1G04?

- John

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here’s an example of how thry used to build logic back in the 1950’s -
http://static.righto.com/sms/2JMX.html

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avr-mike wrote:

A recent project (still unfinished)-: needed a few

inverters so I used a 74LS04 I had in the parts

bin.  The project uses a mega328 to control some

555 timers which generate sound effects, and the

problem I ran into was due to the output pins

defaulting to inputs at power-on.

 

The floating output pins triggered all of the sound

effects whenever the project had power applied.

The inverter interprets these floating pins as logic

high and pulls its outputs low, keeping the sound

effects from triggering.

 

--Mike

 

EDIT: wording

 

Wouldn't a 10K pull-down resistor on the pin work just as well?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Re: IBM logic card... note the symbol used for an NPN transistor. THAT is really early. And that is how some of those very early transistor-based computers were built - one or two gates per card. And there was not yet the idea of standardized NAND or NOR gates.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Fri. Mar 1, 2019 - 10:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

christop wrote:

Wouldn't a 10K pull-down resistor on the pin work just as well?

 

Just looked at the 555 datasheet to see whether

a resistor could be used to hold reset pin 4 low.

With up to 0.4mA reset current and a threshold

as low as 0.4V the resistor value would have to

be no more than 1K.

 

Four of the 6 inverters are in use, so not wasted.

 

--Mike

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Here’s an example of how thry used to build logic back in the 1950’s - http://static.righto.com/sms/2JM...
I used to have a couple of those cards... bought in 1968/69 from Jock Ellis's disposals place in the laneway next to MaGrath's electronics store... now all part of Melbourne Central railway station. Knowing how much of a hoarder that I am, I probably still have them!

Ross McKenzie ValuSoft Melbourne Australia

Last Edited: Fri. Mar 1, 2019 - 11:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From what I understand after reading a datasheet on the 555, the minimum of 0.4V on RESET means your circuit needs to pull the voltage on that pin to below 0.4V to guarantee that the 555 will reset, not that it requires 0.4V on the pin. (The maximum, listed as 1V, means that some 555s may reset if you apply 1V or less, but there's no guarantee that it will work every time or with every 555.)

 

A pull-down resistor will put close to 0V on the pin, resetting the 555 with negligible current (only as much current as the resistor will draw--0.5mA when VCC=5V and R=10K).
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ross, that's about ten years before I knew about the place! Good ol' McGraths - grumpy old men in grey coats!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

christop wrote:

From what I understand after reading a datasheet on the 555, the minimum of 0.4V on RESET means your circuit needs to pull the voltage on that pin to below 0.4V to guarantee that the 555 will reset, not that it requires 0.4V on the pin. (The maximum, listed as 1V, means that some 555s may reset if you apply 1V or less, but there's no guarantee that it will work every time or with every 555.)

 

A pull-down resistor will put close to 0V on the pin, resetting the 555 with negligible current (only as much current as the resistor will draw--0.5mA when VCC=5V and R=10K).

 

The other piece of info from the datasheet I used

was the Reset Current.  This is specified to be a

maximum of 0.4mA.  The block diagram shows a

PNP transistor in there which is why it's higher

than you'd expect/hope with more modern chips.

 

To turn that transistor on, you need to pull up to

0.4mA through it and also not exceed the 0.4V

spec.  If the pull-down resistor is more than 1K,

it's not guaranteed to work.

 

--Mike