Professional Documents
Culture Documents
Logic Gates & Boolean Algebra-1
Logic Gates & Boolean Algebra-1
A logic gate is a device that acts as a building block for digital circuits.
They perform basic logical functions that are fundamental to digital circuits.
Most electronic devices we use today will have some form of logic gates in
them. For example, logic gates can be used in technologies such as
smartphones, tablets or within memory devices.
AND Gate
The following illustration and table show the circuit symbol and logic
combinations for an AND gate. (In the symbol, the input terminals are at left
and the output terminal is at right.) The output is "true" when both inputs
are "true." Otherwise, the output is "false."
Logic diagram
Truth Table
OR Gate
The OR gate gets its name from the fact that it behaves after the fashion of
the logical inclusive "or." The output is "true" if either or both of the inputs
are "true." If both inputs are "false," then the output is "false."
Logic diagram
Truth Table
NOT Gate
A logical inverter, sometimes called a NOT gate to differentiate it from other
types of electronic inverter devices, has only one input. It reverses the logic
state. If the input is 1, then the output is 0. If the input is 0, then the output
is 1.
Logic diagram
Truth Table
NAND Gate
The NAND gate operates as an AND gate followed by a NOT gate. It acts
in the manner of the logical operation "and" followed by negation. The
output is "false" if both inputs are "true." Otherwise, the output is "true."
Logic diagram
Truth Table
NOR Gate
The NOR gate is a combination OR gate followed by an inverter. Its output
is "true" if both inputs are "false." Otherwise, the output is "false."
Logic diagram
Truth Table
XOR Gate
The XOR ( exclusive-OR ) gate acts in the same way as the logical
"either/or." The output is "true" if either, but not both, of the inputs are
"true." The output is "false" if both inputs are "false" or if both inputs are
"true." Another way of looking at this circuit is to observe that the output is 1
if the inputs are different, but 0 if the inputs are the same.
Logic diagram
Truth Table
XNOR Gate
Logic diagram
Truth Table
Boolean Algebra
Commutative law states that changing the sequence of the variables does not have
any effect on the output of a logic circuit.
Associative law
This law states that the order in which the logic operations are performed is
irrelevant as their effect is the same.
Distributive law
Distributive law states the following condition.
AND law
These laws use the AND operation. Therefore they are called as AND laws.
OR law
These laws use the OR operation. Therefore they are called as OR laws.
INVERSION law
This law uses the NOT operation. The inversion law states that double inversion of a
variable results in the original variable itself.
Important Boolean Theorems
Following are few important boolean Theorems.
Boolean function/theorems Description
Here the left side of the equation represents the output Y. So we can
state equation no. 1
Karnaugh-map or K-map
The Boolean theorems and the De-Morgan's theorems are useful in
manipulating the logic expression. We can realize the logical expression
using gates. The number of logic gates required for the realization of a
logical expression should be reduced to a minimum possible value by K-
map method. This method can be done in two different ways, as
discussed below.
Sum of Products (SOP) Form
It is in the form of sum of three terms AB, AC, BC with each individual
term is a product of two variables. Say A.B or A.C etc. Therefore such
expressions are known as expression in SOP form. The sum and
products in SOP form are not the actual additions or multiplications. In
fact they are the OR and AND functions. In SOP form, 0 represents a
bar and 1 represents an unbar. SOP form is represented by .
Given below is an example of SOP.
Product of Sums (POS) Form
It is in the form of product of three terms (A+B), (B+C), or (A+C) with
each term is in the form of a sum of two variables. Such expressions are
said to be in the product of sums (POS) form. In POS form, 0 represents
an unbar and 1 represents a bar. POS form is represented by .
Given below is an example of POS.
DeMorgan’s Theorems
DeMorgan’s Theorem uses two sets of rules or laws to solve various
Boolean algebra expressions by changing OR’s to AND’s,
and AND’s to OR’s.
Boolean Algebra uses a set of laws and rules to define the operation of a
digital logic circuit with “0’s” and “1’s” being used to represent a digital input
or output condition. Boolean Algebra uses these zeros and ones to create
truth tables and mathematical expressions to define the digital operation of
a logic AND, OR and NOT (or inversion) operations as well as ways of
expressing other logical operations such as the XOR (Exclusive-OR)
function.
DeMorgan’s Theory
DeMorgan’s first theorem states that two (or more) variables NOR´ed
together is the same as the two variables inverted (Complement) and
AND´ed, while the second theorem states that two (or more) variables
NAND´ed together is the same as the two terms inverted (Complement)
and OR´ed. That is replace all the OR operators with AND operators, or all
the AND operators with an OR operators.
DeMorgan’s First Theorem
DeMorgan’s First theorem proves that when two (or more) input variables
are AND’ed and negated, they are equivalent to the OR of the
complements of the individual variables. Thus the equivalent of
the NAND function will be a negative-OR function, proving that A.B = A+B.
We can show this operation using the following table.
0 0 0 1 1 1 1
0 1 0 1 0 1 1
1 0 0 1 1 0 1
1 1 1 0 0 0 0
We can also show that A.B = A+B using logic gates as shown.
DeMorgan’s First Law Implementation using Logic Gates
The top logic gate arrangement of: A.B can be implemented using a
standard NAND gate with inputs A and B. The lower logic gate
arrangement first inverts the two inputs producing A and B. These then
become the inputs to the OR gate. Therefore the output from the OR gate
becomes: A+B
Then we can see here that a standard OR gate function with inverters
(NOT gates) on each of its inputs is equivalent to a NAND gate function. So
an individual NAND gate can be represented in this way as the equivalency
of a NAND gate is a negative-OR.
0 0 0 1 1 1 1
0 1 1 0 0 1 0
1 0 1 0 1 0 0
1 1 1 0 0 0 0
We can also show that A+B = A.B using the following logic gates example.
Then we can see that a standard AND gate function with inverters (NOT
gates) on each of its inputs produces an equivalent output condition to a
standard NOR gate function, and an individual NOR gate can be
represented in this way as the equivalency of a NOR gate is a negative-
AND.
Combinational Circuits
Combinational circuit is a circuit in which we combine the different gates
in the circuit, for example encoder, decoder, multiplexer and
demultiplexer. Some of the characteristics of combinational circuits are
following −
• The output of combinational circuit at any instant of time, depends
only on the levels present at input terminals.
• The combinational circuit do not use any memory. The previous
state of input does not have any effect on the present state of the
circuit.
• A combinational circuit can have an n number of inputs and m
number of outputs.
Block diagram
Half Adder
Half adder is a combinational logic circuit with two inputs and two
outputs. The half adder circuit is designed to add two single bit binary
number A and B. It is the basic building block for addition of
two single bit numbers. This circuit has two outputs carry and sum.
Block diagram
Truth Table
Circuit Diagram
Full Adder
Full adder is developed to overcome the drawback of Half Adder circuit.
It can add two one-bit numbers A and B, and carry c. The full adder is a
three input and two output combinational circuit.
Block diagram
Truth Table
Circuit Diagram
Half Subtractors
Half subtractor is a combination circuit with two inputs and two outputs
(difference and borrow). It produces the difference between the two
binary bits at the input and also produces an output (Borrow) to indicate
if a 1 has been borrowed. In the subtraction (A-B), A is called as
Minuend bit and B is called as Subtrahend bit.
Truth Table
Circuit Diagram
Full Subtractors
The disadvantage of a half subtractor is overcome by full subtractor. The
full subtractor is a combinational circuit with three inputs A,B,C and two
output D and C'. A is the 'minuend', B is 'subtrahend', C is the 'borrow'
produced by the previous stage, D is the difference output and C' is the
borrow output.
Truth Table
Circuit Diagram
Multiplexers
Multiplexer is a special type of combinational circuit. There are n-data
inputs, one output and m select inputs with 2m = n. It is a digital circuit
which selects one of the n data inputs and routes it to the output. The
selection of one of the n inputs is done by the selected inputs.
Depending on the digital code applied at the selected inputs, one out of
n data sources is selected and transmitted to the single output Y. E is
called the strobe or enable input which is useful for the cascading. It is
generally an active low terminal that means it will perform the required
operation when it is low.
Block diagram
Demultiplexers
A demultiplexer performs the reverse operation of a multiplexer i.e. it
receives one input and distributes it over several outputs. It has only one
input, n outputs, m select input. At a time only one output line is selected
by the select lines and the input is transmitted to the selected output line.
A de-multiplexer is equivalent to a single pole multiple way switch as
shown in fig.
Demultiplexers comes in multiple variations.
• 1 : 2 demultiplexer
• 1 : 4 demultiplexer
• 1 : 16 demultiplexer
• 1 : 32 demultiplexer
Block diagram
Truth Table
Decoder
A decoder is a combinational circuit. It has n input and to a maximum m
= 2n outputs. Decoder is identical to a demultiplexer without any data
input. It performs operations which are exactly opposite to those of an
encoder.
Block diagram
2 to 4 Line Decoder
The block diagram of 2 to 4 line decoder is shown in the fig. A and B are the two
inputs where D through D are the four outputs. Truth table explains the operations of
a decoder. It shows that each output is 1 for only a specific combination of inputs.
Block diagram
Truth Table
Logic Circuit
Encoder
Encoder is a combinational circuit which is designed to perform the
inverse operation of the decoder. An encoder has n number of input
lines and m number of output lines. An encoder produces an m bit binary
code corresponding to the digital input number. The encoder accepts an
n input digital word and converts it into an m bit another digital word.
Block diagram