# using NAND gate to create square pulse

#### minhduc515

Joined Jun 15, 2017
3
I am trying to create a digital clock, using 74ls90,74ls47

I have some question when trying to create 1 Hz square pulse

This picture is my teachers's simulation

I have searched on internet, and i known that i can use Ne555, or crystal, but i can't find any document about using NAND gate to create pulse

Anyone can help me explain that circuit ? And how i can choose value of resistor, capacitor ? (eg :R43 = 4k7, R44 = 1k, C3 = 100uF ..)

#### EM Fields

Joined Jun 8, 2016
583
I am trying to create a digital clock, using 74ls90,74ls47

I have some question when trying to create 1 Hz square pulse

This picture is my teachers's simulation

I have searched on internet, and i known that i can use Ne555, or crystal, but i can't find any document about using NAND gate to create pulse

Anyone can help me explain that circuit ? And how i can choose value of resistor, capacitor ? (eg :R43 = 4k7, R44 = 1k, C3 = 100uF ..)

https://www.fairchildsemi.com/application-notes/AN/AN-118.pdf

#### Bordodynov

Joined May 20, 2015
2,661
Used 74LS00.
See

#### Bordodynov

Joined May 20, 2015
2,661
I made this scheme to show the error of simulation of logic circuits in analog devices. Usually models of logic chips are built on digital elements with great simplification of properties of real elements. This speeds up the simulation, but may not reflect reality. This is especially true for TTL circuits.

#### Bordodynov

Joined May 20, 2015
2,661
In my calculations, the frequency was approximately equal to 16 Hz. To get 1 Hz, you can apply a four-bit binary counter that is mentioned at the beginning.

#### minhduc515

Joined Jun 15, 2017
3

#### djsfantasi

Joined Apr 11, 2010
6,847
The two NAND gates, along with the resistors and capacitor, form a common circuit for an oscillator or astable multivibrator.

An explanation of how this works can be found here. Click on the link.

#### DickCappels

Joined Aug 21, 2008
6,593
The bit of information that might be missing is that the nand gates in your schematic are wired to act as inverters rather than gates. Therefore explanations of the RC oscillators using inverters are applicable to your circuit.

#### Bordodynov

Joined May 20, 2015
2,661
See

#### DickCappels

Joined Aug 21, 2008
6,593
What is the purpose of R3?

#### Bordodynov

Joined May 20, 2015
2,661
The circuit is not symmetrical for better triggering of oscillations. In the first stage, the lower output transistor is transferred to the amplification mode. In the second cascade, the Darlington is translated into the amplification mode. The circuit works without this resistor.
Here you can play:

#### Attachments

• 5 KB Views: 5

#### djsfantasi

Joined Apr 11, 2010
6,847
Your last schematic shows AND gates; not NAND gates... I wouldn't expect that circuit to oscillate.

#### Bordodynov

Joined May 20, 2015
2,661
Your last schematic shows AND gates; not NAND gates... I wouldn't expect that circuit to oscillate.
In all schemes, the hierarchical block 2NAND is used. The output pin of the symbol is surrounded by a small circle. For me, this is a sign of inversion (NOT).
If you have LTspice, then you can check everything. See LS.zip.

#### DickCappels

Joined Aug 21, 2008
6,593
Your last schematic shows AND gates; not NAND gates... I wouldn't expect that circuit to oscillate.
Notice the bubble on the outputs denoting inversion?

@Bordodynov what device is the nang gates? (74LS00?)

#### Bordodynov

Joined May 20, 2015
2,661
Yes! 74LS00.

#### djsfantasi

Joined Apr 11, 2010
6,847
In all schemes, the hierarchical block 2NAND is used. The output pin of the symbol is surrounded by a small circle. For me, this is a sign of inversion (NOT).
If you have LTspice, then you can check everything. See LS.zip.
Oops, you're correct. I missed the bubble. Sorry.

#### minhduc515

Joined Jun 15, 2017
3

#### djsfantasi

Joined Apr 11, 2010
6,847
It said that the frequency of the square wave is given by f = 1 / 2.2 R1C1. But how it is derived?
I believe the link I provided in post #7 addresses this question. But I personally don't know how it is derived.

#### MrAl

Joined Jun 17, 2014
7,814
I have found this site about NAND gate waveform generator, that similar to my simulation : http://www.electronics-tutorials.ws/waveforms/generators.html

It said that the frequency of the square wave is given by f = 1 / 2.2 R1C1. But how it is derived?
Hi there,

It is derived through the use of circuit analysis, assuming some threshold values for the Schmitt Trigger gates. Notice that down the page a little they have "1.6v" and "0.8v". Those are the upper and lower threshold voltages. The gate changes state when one of those levels is reached on the input, and that starts the next half cycle.

If we look at this in somewhat simple terms with the output going to nearly zero for a low and to nearly Vcc for a high, we have two maiin equations:
Discharging: Vc(t)=Vc0*e^(-t/RC)
Charging: Vc(t)=(Vcc-Vc0)*(1-e^(-t/RC))+Vc0

These two are solved for t and that yields two different values for t we can call t1 and t2, then the total time is:
t_total=t1+t2
and so the frequency is:
f=1/(t1+t2)

So after solving these we get the true frequency.
Since the cap voltage Vc0 is the lower threshold when it starts to charge and the cap voltage Vc0 is the upper threshold when it starts to discharge, we have:
Discharging: Vc(t)=VH*e^(-t/RC)
Charging: Vc(t)=(Vcc-VL)*(1-e^(-t/RC))+VL

where VH and VL are the high and low thresholds respectively.

Also, since the charge time goes from VL to VH and discharge from VH to VL, we have:
Discharging: VL=VH*e^(-t/RC)
Charging: VH=(Vcc-VL)*(1-e^(-t/RC))+VL

so the only variable left in each equation is the time t.
You can try to solve those if you like and that will show you the true frequency. See if it matches their claim. It probably will not because they often use approximations found elsewhere that they did not check before creating their web pages.

Last edited:

#### Bordodynov

Joined May 20, 2015
2,661
See Ideal and Real (used CMOS)