2

I know of two circuits which can act as edge detector:

  1. A clock connected as a voltage source across a RC component where resistance is composed of a diode and a resistor and this in series with another enter image description here enter image description here

  2. A clock and its inverted output connected to AND gate. enter image description here

Respective images are pulses generated for a given square wave.

Which one of them is more prevalent and versatile in logic design ? because in books only 2nd is used for synchronising outputs.

I think RC circuit helps us to adjust duration of the pulse so it is better.

Kutsit
  • 251
  • 6
  • 16

3 Answers3

1

The answer is none of the above, both of them, and it depends on the application.

The RC solution has a strong dependency on signal slew rate, loads its input, and might not be adequate for logic-level circuitry, while being perfectly fine to trigger a 555 and some mostly-analog applications.

The gate solution is rather common to generate a glitch in logic circuits, with pulse-width being tuned by either adding inverters in the chain, adding capacitance to the nodes, or tuning the characteristics of the inverters.

As anything in engineering, the RC solution is good enough in many cases. If you need to add some constraints to it (e.g., independence of input slew rate, independence of source impedance, guaranteed pulse voltage, reliable pulse width) you will soon find that it becomes too complicated to be practical, so variants of the gate solution become more practical.

You will exclusively find variants of the gate solution implemented inside logic ICs. I’ve used relatively long chains of purposefully slow inverters to provide carefully sequenced guaranteed-reliable asynchronous pulses to operate IC-wide logic after an input event with 100MHz interface clocks. Given that the width of the pulses scales with the speed of the logic inside the IC, this solution is guaranteed to work for all performance corners of the technology.

Edgar Brown
  • 8,336
  • 2
  • 16
  • 53
-1

I don't want to sound like a racist, but your second example is a classic "race condition" that would cause an undergrad in a digital design course to get a 0% for the answer. The propagation delay through the inverter will likely cause either setup or hold time of the AND/NAND gate to be violated, resulting in an unstable circuit. Forget any design that looks like this. Prop delay is temperature-dependent, and what works on your little breadboard circuit won't necessarily work when it is in its final configuration in a closed box in a warm room.

Why do you need a positive edge detector? If we know the reason, it might simplify designing a circuit to fit your needs.

flounder
  • 472
  • 3
  • 7
  • Every single designer that has ever put together an edge-triggered flip flop would disagree with you. As well as anyone that has ever designed any asynchronous logic domain. It is only a “race condition” if you don’t know what you are doing. – Edgar Brown Feb 18 '19 at 00:58
-2

I don't think either of these circuits would be used in practice. I would use a flip-flop as a synchronous edge detector.

EDIT: Each of these circuits provides a pulse that is highly dependent on poorly controlled characteristics of the circuit. The tolerances of resistors and capacitors are fairly large, and the delay through an inverter varies significantly with supply voltage and temperature.

Neither circuit is readily synthesizable in an FPGA or ASIC. They are both hacks.

Elliot Alderson
  • 31,192
  • 5
  • 29
  • 67
  • Do you mean they are just used to give an idea of what happens in easy terms to first year undergraduates ? – Kutsit Feb 17 '19 at 19:19
  • 1
    The gate delay edge detector is widely used. While it may be less likely to use this in an FPGA or ASIC development with synchronous clocking domains, this was a tried and true technique for edge detection in asynchronous systems based on 74xx logic. – Jack Creasey Feb 17 '19 at 22:20
  • Quite the opposite, within an IC the most accurate way to match the propagation delay of a set of gates is to use another set of gates. Even though different die would have faster or slower characteristics, all of the gates in one die would be relatively well-matched. You just have to know what you are doing. I have never had a yield issue from this type of circuits. – Edgar Brown Feb 18 '19 at 01:03
  • @EdgarBrown Yes, you can match gate delay to gate delay, but if you need to match a pulse width to a synchronous clock you will have trouble. You can overspecify the number of gates used to generate the delay but then you run the risk of creating a pulse that is two clocks wide under slow conditions. You don't even have individual gates like this in an FPGA, so a series string of inverters will be optimized to a single inverter, which will then be folded into a LUT. It's just not a robust way to do synchronous design. – Elliot Alderson Feb 18 '19 at 02:10
  • @EdgarBrown Yes, I agree. I have done things like this in the bad old days when doing board-level 74xx designs. But not anymore, not for synchronous designs when trying to avoid metastability. – Elliot Alderson Feb 18 '19 at 02:12
  • If you are generating pulses in this way it should be rather obvious that you are dealing with an asynchronous domain (which can safely coexist within synchronous ones). So your point about synchronous design is completely moot and misleading. Also, I know people that do large fully-asynchronous designs in FPGAs, so I know for a fact that it is possible. There are even some in opencores (https://opencores.org/articles/1096267240). – Edgar Brown Feb 18 '19 at 02:22