Header Ads Widget

Logic gates……The building blocks of digital systems.

what are logic gates

The basic building blocks of any digital system are logic gates. These gates perform very basic function on the digital inputs like addition, multiplication and inverting bits. In general we have three basic logic gates i.e. “OR”, “AND” and “NOT” gate. There are many other logic gates which are combinations of these three basic logic gates. We will see here gates with two inputs but we can have gates with more than two inputs also based on requirement. Each logic gate can be made out of discrete components like Diode, Transistor and Resistor etc. The basic circuits of these logic gates, symbol of gates and respective truth table is shown in image.

The logical operation which each gate performs and accordingly the output which we get, is shown is a tabular form. This table shows different combinations of ‘1’ and ‘0’ at input and its corresponding output which we get after performing logical operation. Since it shows the logically true output for different inputs, hence this table is called “Truth Table”.

OR Gate:

This gate performs the addition of bits at the input side and present at output. A simple “OR” gate can be made using two Diodes and one Resistor as shown in diagram. ‘A’ and ‘B’ denotes two digital inputs and ‘C’ denotes the output. This circuit can be used for testing purpose but in practical cases, the ICs for OR gates are not made in such simple way. IC 7432 is a 14pin IC containing 04nos. “OR” gates inside it.
Let us see the different input conditions and corresponding outputs.

Condition-1: As per operating principal of diodes if we apply 0V (digital-0) at both inputs, both the diodes will be not operational and hence the out voltage will also be 0V i.e. digital-0 (LOW), that is what the truth table says for A=0 and B=0.

Condition-2 & 3: If we apply +5V (digital-1) at any of the inputs A or B, the respective diode will start conducting and the output will be +5V i.e. digital-1 at point ‘C’. This condition gives the name of this gate as OR gate because if either ‘A’ OR ‘B’ is digital-1, the output of this logic gate is digital-1 i.e. HIGH. This is again shown in truth table of OR gate.

OR gate using discrete components

Condition-4: If we apply +5V or HIGH input at both ‘A’ and ‘B’, again both diode will conduct and the output at ‘C’ will be HIGH i.e. +5V.
Note: Since always there will be a voltage drop across diode in practical scenario, hence the digital HIGH will not be exactly +5V but near to it as shown in this diagram.

AND Gate:

This gate performs multiplication operation on digital input bits presented at input ‘A’ and ‘B’. An AND gate can be realized using two diodes and one resistor. This time the load resistor is connected between output pin and +5V supply and the direction of diodes are reversed. IC 7408 is a 14pin IC containing 04nos. AND gate.
Below are different conditions and its corresponding logical output from AND gate.

AND gate using discrete components

Condition-1:
Since the diodes are in reverse condition and input is given in cathode, when both inputs are LOW or digital-0, both diodes will conduct because their anode is at HIGH side and cathode is at LOW potential. Under this condition the output voltage is actually the voltage drop across the diode i.e. around 0.7V. In practical scenario this voltage is considered as LOW i.e. digital-0. This condition is shown in the diagram.

Condition-2 & 3: In case either of the two inputs is LOW and other is HIGH, one diode is forward biased and the other is having same potential at its anode and cathode, hence one diode conduct and the other if off. Due to one forward based diode, the voltage at output is again around 0.7V hence is LOW.

Condition-4: When input ‘A’ AND ‘B’ both are high, in this condition both diodes are off and hence the 5V appears at the output through resistor and hence the output is HIGH i.e. digital-1. This condition gives the name as AND gate.

NOT Gate:

This performs simplest operation of inverting the state of any digital input. Input HIGH is converted to LOW and input LOW is converted to HIGH. This is sometimes referred as Inverter also, as it inverts the state of input. This is the reason the output is shown as reverse of input by showing a bar over it, as we learned in digital number system. Refer to the simple transistor based NOT gate circuit, when input is HIGH i.e. 5V, the transistor conducts and act as closed switch hence the output at its collector is LOW. And when the input is LOW the transistor act as open switch hence the output is +5V which comes through resistor and hence output is HIGH. IC 7404 is a 14pin IC which contains 06nos. of NOT gate inside it.

Gate Combinations:

what are NOR and NAND gates

There are many combinations of these basic logic gates to get other gates, but for simplicity we will discuss two basic extended gates i.e. “NOR” and “NAND” gate, other two are “XOR” and “XNOR” gates. As the name suggest and depicted in this image, NOR gate is a combination of “NOT” and “OR” gate. Similarly the NAND gate is combination of “NOT” and “AND” gate.

NOR Gate: To understand it simply connect the output of “OR” gate to a “NOT” gate to get a “NOR” gate. It means that the truth-table of NOR gate will be simply reverse of OR gate i.e. ZERO is replaced by ONE and ONE by ZERO due to NOT gate at the output side. The circle at the output of gate is representing NOT gate. IC 7402 contain 04nos. NOR gate, which is a 14pin IC.

NAND Gate: Similarly connect output of “AND” gate to “NOT” gate to get NAND gate. Hence the output in truth table will be simply reverse of AND gate i.e. ZERO is replaced by ONE and ONE by ZERO as NOT gate is present at output side. The circle at the output of gate is representing NOT gate. IC 7400 is a 14pin IC containing 04nos. NAND gate in it.

We have basically two different types of digital gate ICs, one which uses transistor inside called TTL i.e. “Transistor-Transistor Logic”. The other uses MOSFETs for its construction and is called CMOS logic gates. Under both categories we again have different range of ICs which can operate at different speed and different environmental conditions. Some are manufactured to operate at normal temperature levels and some at extreme temperatures which are used in industrial and military applications.

Operating voltage range for such TTL gates are 4.75V to 5V and for CMOS type is 3V to 15/18V.

input output levels of TTL logic gates

As we saw earlier that HIGH and LOW levels cannot be ideally 0V and 5V due to voltage drop in different components and also considering there can be noise voltage induced while output of one logic gate is fed to other logic gate for complicated functions in digital circuits, the LOW and HIGH is agreed as voltage range rather than a fix voltage.

As shown in diagram, for TTL logic gates for input side, 0V to 0.8V is considered as LOW(0) and 2.0V to 5V is considered as HIGH(1). That means if the input voltage is anywhere above 0.8V and below 2.0V, will be undetermined by logic gate and no operation will be performed. It will be neglected by gates.

Similarly, for output side 0V to 0.4V is to be considered as LOW (1) and 2.7V to 5V should be considered as HIGH (1) and anything above 0.4V and below 2.7V should be ignored.

For CMOS gates operating at 5V
Input: 0V - 1.5V is LOW and 3.5V - 5V is HIGH
Output: 0V - 0.05V is LOW and 4.95 - 5V is HIGH
For CMOS gates operating at 15V
Input: 0V - 4V is LOW and 11V - 15V is HIGH
Output: 0V - 0.05V is LOW and 14.95V - 15V is HIGH.

truth table of logic gates

So, in all cases we see that the input side is given larger window as digital signals coming from any other circuit or field may induce some electrical noise. Electrical noise is nothing but unwanted interference of electromagnetic waves induced in any wire which changes the current flowing through it hence inducing change in voltage at the other side of wire. Electrical noise is always expected in any circuit especially in industrial environment. Also, everywhere we are surrounded by lots of electromagnetic waves around us like, mobile signals, satellite TV signals, radiations coming out from Microwave oven, laptops operating at high frequency etc.

Here is the summary of truth table of all the five gates we have seen above. Using these we can have complicated logical operations by using any combination of these small logic gates.

That’s all about the basics of digital logic gates, keep visiting for more interesting topics and share comment if any topic is to be elaborated in more detail.



Post a Comment

1 Comments

  1. Open gate with cell phone I would like to say that this blog really convinced me to do it! Thanks, very good post.

    ReplyDelete