Basically, I want to turn a continuous "1" into a short "1" pulse then "0". I'm new to logic gates, apologies if it's too obvious.
-
\$\begingroup\$ You might also try looking up "half-monostable circuit" (aka edge-detector) \$\endgroup\$– TutMar 3, 2015 at 21:28
-
2\$\begingroup\$ If the input signal is continously "1", what determines when the pulse should happen? \$\endgroup\$– The PhotonMar 3, 2015 at 21:31
-
\$\begingroup\$ perfect application of a 555 timer with "one shot" set-up. \$\endgroup\$– KyranFMar 3, 2015 at 21:46
6 Answers
An XOR gate and a pair of inverters will do this if you don't need precise control over the pulse width.
simulate this circuit – Schematic created using CircuitLab
How it works:
An XOR gate output is high only when its inputs are at different states (i.e. 10 or 01). The two inverters add a small amount of delay to the signal seen on the bottom leg which gives you a brief moment when the inputs are different, leading to a pulse on the output whenever the line changes high or low. This is a very simple edge detector circuit.
If you need more delay you can add a resistor between the two inverters along with a capacitor between the resistor and input to the second inverter:
This adjusts the pulse delay by slowing down the signal even more. The values of the resistor and capacitor determine the delay. If you're going to be sticking analog elements into your digital design you may want to use Schmitt trigger inverters as they can better handle input signals which "wander" through the boundary between a logic 0 and logic 1.
In the simplest form a single non-inverting gate can be used with an RC differentiator input to give a single pulse output from a high going signal transition. The resistor/capacitor values shown are just for reference when a very short output pulse is needed. (See Figure 1.)
When the positive transition is received at C1 only a very short spike of current reaches the gate input. The gate outputs a high. The spike at the gate input quickly dissipates to ground by way of R1. As the spike dissipates it will have a typical RC droop curve but the digital gate turns this into a squared off low output. By varying the values of R1 C1 the width of the output pulse can be varied. Larger RC values would generate wider output pulses and vise-versa.
To be sure that extra pulses are not generated a schmitt trigger type gate can be used or a high value resistor can be added to give some positive feedback. (See Figure 2.)
Note that the gate input will also receive a negative voltage spike when the input switches back low. Most common gates will include protective diodes on the input pins that safely reroute low power over/under voltage spikes to ground or Vcc. Some gates (such as those rated as higher voltage tolerant) may not have such diodes, so adding external diodes can help in this case. (See Figure 3.)
simulate this circuit – Schematic created using CircuitLab
I've created pretty simple short pulse generator. If state changes from high to low on generator, there will appear high state on first inverter output, and first AND gate input. But on second AND gate input there will be still low state (beacuse RC is not charged) - and if on second inverter input we have low state, on output will be high - both outputs have high - so on circuit output there will be high state (until RC has less voltage than Vinlowmax (inverter parameter). To use this kind of circuit - use Schmitt inverters (for low-growing signals).
If you want signal on rising edge - delete one inverter.
-
1\$\begingroup\$ I'm confused why you needed the 2 NOT gates and the AND gate. Couldn't you build something like this: imgur.com/a/9k827 that would work the same way? Also why did you decide to put the resistor before the capacitor? \$\endgroup\$ May 28, 2017 at 15:27
one easy way to do this is with two d-flops and some logic gates. this will produce a pulse exactly one half a clock long, which is to say the output pulse is equal to one high pulse of the clock. it will never output a partial pulse. very similar but a bit simpler than Raivis's answer.
see a simulation here.
-
\$\begingroup\$ Hi, welcome to the site. This question is from two years ago. You should better concentrate in newer ones. \$\endgroup\$ Mar 23, 2017 at 5:33
-
3\$\begingroup\$ @ClaudioAviChami I understand. I usually find stackexchange through googling queries, so to me it is very usefull as a repository beyond just answering the question for the person who asked it. if this sort of use isn't welcome I won't do so any more. \$\endgroup\$ Mar 23, 2017 at 6:10
Input: oscilating pulses (Function Generator) + button;
Output: single pulse from oscilator;
Simulation on Falstad's