Menu

all about electronic and microcontrollers

Friday, December 30, 2016

Logic Gates

In this article I will put on the paper some theoretical knowledge about the Logic Gates.
I will discuss about:
·         Logic Gates
·         Truth Table
·         Logic circuits/network
I will explain how logic gates are used and how truth tables are used to check if combinations of logic gates carry out the required functions.
Logic Gates
A large number of electronic circuits (in computers, control units, embedded systems etc.) are made up of logic gates. These process signals are represented by true or false flag. Signals can be represented as ON or OFF, 1 or 0 as well.
The most common symbols used to represent logic gates are shown below. For sure there are many different logic gates but we will concentrate on these.
Truth Table
Truth tables are used to show logic gate functions. The NOT gate has only one input, but all the others have two inputs.
When constructing a truth table, the binary values 1 and 0 are used. Every possible combination, depending on number of inputs, is produced. Basically, the number of possible combinations of 1s and 0s is 2n where n
= number of inputs. For example, 2 inputs have  combinations, 3 inputs have  combinations and so on. The next section shows how these truth tables are used.
Description of the logic gates
NOT gate
The output (X) is true (1 or ON) if:
Input A is NOT TRUE (0 or OFF)

Truth table for: X = NOT A
AND gate
The output (X) is true (1 or ON) if:
INPUT A AND INPUT B are BOTH
TRUE (1 or ON).

Truth table for: X = A AND B



OR gate
The output (X) is true (1 or ON) if:
INPUT A OR INPUT B is
TRUE (1 or ON).

Truth table for: X = A OR B


NAND gate
The output (X) is true (1 or ON) if:
INPUT A AND INPUT B are
NOT BOTH TRUE (1 or ON)
Truth table for: X = NOT A AND B


NOR gate
The output (X) is true (1 or ON) if:
INPUT A OR INPUT B are
NOT BOTH TRUE (1 or ON)
Truth table for: X = NOT A OR B


XOR gate
The output (X) is true (1 or ON) if:
INPUT A OR (NOT INPUT B)
OR (NOT INPUT A) OR INPUT B
is TRUE (1 or ON)
Truth table for:
X = A OR (NOT B) OR (NOT A) OR B



Logic circuits/network
Logic gates can be combined together to produce more complex logic circuits (networks).
The output from a logic circuit (network) is checked by producing a truth table.

Two different types of problem are considered here:
·         drawing the truth table from a given logic circuit (network)
·         designing a logic circuit (network) from a given problem and testing it by also drawing a truth table.

Example:
Produce a truth table from the following logic circuit (network).

Note:
To show how this works, we will split
the logic circuit into two parts (shown by
the dotted line).

First part
There are 3 inputs; thus we must have  (8) possible combinations of 1s and 0s.

To find the values (outputs) at points P and Q, it is necessary to consider the truth tables for the NOR gate (output P) and the AND gate (output Q).
P = A NOR B
Q = B AND C

We get:




Second part
There are 8 values from P and Q which form the inputs to the last OR gate.
Hence we get X = P OR Q which gives the following truth table:
Which now gives us the final truth table for the logic circuit given at the start of the example:


So as you can see the possibilities are unlimited. You can design which circuit you like. Good luck.

No comments:

Post a Comment

If you do not understand something, or if you make some aplication helped by this blog, let me know.