Skip to main content

Designing AND gate using Diodes

An AND gate has two or more inputs and a single output. The definition of AND gate states that if one of the inputs is 0 the output will be 0. The figure below shows the structure of the AND gate.

For a two-input AND gate, the relationship between input and output is shown in the truth table below.
You will notice that if any-one of the input is 0 then the output is 0.
Now let us try to understand how you can build AND gate using diodes. But first, you must understand the basic principle on which the diode works.
Look at the figure of the diode below. If you apply some positive voltage V(in) which is greater than Vth (Breakdown voltage of diode) at point A then the diode will act as a closed switch or it will be forward biased. Thus the diode will start conducting. On the other hand, if you apply some negative voltage V(in) which is less than Vth, the diode will not conduct and will act as an open switch. This is called reverse biased.

Having understood the working of the diode, let us now take a look at the circuit diagram of the AND gate.
Construction:- V1 and V2 are input voltages. R2 and R3 are the source resistances. R2 and R3 are equal and R1 >> R2, R3. D1 and D2 are the diodes. R1 is a pull-up resistor. Vr is clamped to 5 volts. Vout is the output voltage.

Working:-
Case 1:- V1 = 0, V2 = 0
In this case, since the V1 and V2 are at 0 levels the current flows from Vr to V1 and V2 and goes to ground. Diodes D1 and D2 are forward biased in this case. Thus the output voltage is 0.

Case 2:-  V1 = 0 V2 = 5 V
In this case, diode D2 is reverse biased providing a high impedance path. But diode D1 is forward biased since V1 = 0 providing low impedance path. Thus the current flow through V1 to the ground and again Vout is 0. 

Case 3:- V1 = 5 V, V2 = 0
This case is similar to case 2. Here instead of D2, D1 is reverse biased and D2 is forward biased generating 0 v output signal.

Case 4:- V1 = 5 V, V2 = 5 V
In this case both D1 and D2 are reverse biased providing high impedance path. Thus the only way for the current to flow is to Vout. Thus the output generated is HIGH (5 v) in this case.

Comments

Popular posts from this blog

Iris Detection | Python | OpenCv

 Hello there! Welcome to another blog. In this blog you are going to learn to detect iris using OpenCv python. Here is the video in case you missed it. So, let's get started. We will start by importing the necessary libraries. import cv2 import numpy as np Now, let us import the face and eye classifier files and set the camera resolution as follows. eye = cv2.CascadeClassifier( 'haarcascade_eye.xml' ) face = cv2.CascadeClassifier( 'haarcascade_frontalface_alt.xml' ) Kernal = np.ones(( 3 , 3 ) , np.uint8) #Declare kernal for morphology cap = cv2.VideoCapture( 0 ) cap.set(cv2.CAP_PROP_FRAME_WIDTH , 320 ) ##Set camera resolution cap.set(cv2.CAP_PROP_FRAME_HEIGHT , 240 ) In a while loop let us capture an image frame, flip it(in case your camera captures inverted images) and convert it into a gray scale image. ret , frame = cap.read() ##Read image frame frame = cv2.flip(frame , + 1 ) ##Flip the image in case your camera

Object Distance Calculation Using Contour Area Method In Python - Opencv

Today we will discuss how you can find the distance of an object from the camera using python OpenCV. Check out the video below. Before we continue, you should know how to detect a colored object. Click this link to check out my previous blog on object detection and tracking. I hope after checking out my previous blog, you are able to write your own code to detect and track objects. We will take forward the Object detection and tracking code to find the distance of an object from the camera. So let's start. Let us first understand the principle using which we will find the distance of the object from the camera. Principle:- Area enclosed by the contours of an object decreases as the object moves farther from the camera. This simply means that, if your object is near to the camera, the object will appear bigger. Thus the pixel area occupied by the object will be very large. As you move the object farther from the camera, the object size in the image will start to d

Object Detection And Tracking using Python - Opencv

Let us discuss today how you can detect and track an object in real-time. We will be using Python language and Opencv library for this purpose. Check out the video below. If you have read my previous blogs, you can directly skip down to the contour part. As usual, we need to make a few assumptions for the proper working of this application. This background is always static i.e. there is no addition or subtraction of objects in the background scene. The background-color is always constant. It does not change with time. The object that will be used for writing/painting is of a different color than the background to give us sufficient contrast between foreground and background. We are ready to begin now. Let us start by installing necessary python libraries for our project using  pip install.  We will be needing  Numpy  and  Opencv  libraries. Now create a python project and create a new script. Import the required libraries into python script as shown below. import cv2