The OR gate
As an exercise to practice some topics on analogue electronics at the bench, I developed an OR gate using two 1N4004 diodes.
The bibliography I used was the classic “Electronic Devices and Circuit Theory” from Boylestad, in its chapter on diodes.
I also modelled the circuit in LTSpice. I am here going to add the graphics outputs from this simulation.
BOM
- Two 1N4001 diodes
- One 10kOhm resistor
- Two 5V DC power supplies
- One yellow LED to be connected at the output
- some wires
The experiment
The circuit is this one:
At the cathode of each 1N4001 diode I placed a 5V power supply. At the bench, this power supply is a switched dc one. To get a zero, I just turn it off, and to have 5V at the input, I just turn the dc power supply on.
I added an yellow LED at the output so I could have a visual signalling of the output as I changed the inputs. The LED would turn on if either one of the inputs are logical 1.
Here is a picture of the hardware setup made at the bench:
The LTSpice simulation
At the LTSpice, I modelled the input power supplies as pulses with the following characteristics:
Input A:
– Vinitial = 0;
– Von = 1V
– Tdelay = 0;
– Trise = 10ns;
– Tfall = 10ns;
– Ton = 500ns;
– Tperiod = 1ms;
Input B:
– Vinitial = 0;
– Von = 1V
– Tdelay = 100ns;
– Trise = 10ns;
– Tfall = 10ns;
– Ton = 250ns;
– Tperiod = 500ms;
I used the transient simulation at 8ms.
I placed one voltage probe at each input and a voltage probe at the output, getting thus the following simulation output:
In this time diagram, it is poossible to see the truth table from the inputs and output. Naming the first graph in black as input A and the second graph in blue as input B, we get the following truth table:
A | B | OR |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
And of course, at the simulation itself it is possible to zoom in this graph to get few periods and analise it with more details. Yes, it is much more fun to play with LTSpice and the setup at the bench than read this article!
Youtube video
I made a video on my youtube channel Café no Boole. There I explain the hardware setup, analyse the simulation and show it in real time at the bench.
Although it is spoken in portuguese, it is fun to watch.
I encourage you to watch it, like it and subscribe to the channel.
As a final remark, the hardware setup allowed me to take some nice pictures and edit them in snapseed. Two of these pictures are showed at the beginning of this article.
This is all, folks. Next article I will write about the AND gate that I developed in the same conditions.