final Unit2
final Unit2
If the two voltage levels are 0 V and +5 V, then in the positive logic system the 0 V represents a logic ‘0’ and the
+5 V represents a logic ‘1’. In the negative logic system, 0 V represents a logic ‘1’ and +5 V represents a logic ‘0’.
If the two voltage levels are 0 V and −5 V, then in the positive logic system the 0 V represents a logic ‘1’ and the
−5 V represents a logic ‘0’. In the negative logic system, 0 V represents a logic ‘0’ and −5 V represents a logic ‘1’.
It is interesting to note, as we will discover in the latter part of the chapter, that a positive OR is a negative AND.
That is, OR gate hardware in the positive logic system behaves like an AND gate in the negative logic system.
The reverse is also true. Similarly, a positive NOR is a negative NAND, and vice versa.
LOGIC GATES
The logic gate is the most basic building block of any digital system,
including computers. Each one of the basic logic gates is a piece of
hardware or an electronic circuit that can be used to implement some
basic logic expression. While laws of Boolean algebra could be used
to do manipulation with binary variables and simplify logic
expressions, these are actually implemented in a digital system with
the help of electronic circuits called logic gates. The three basic logic
gates are the OR (+)gate, the AND (.) gate and the NOT (-) gate.
https://de-iitr.vlabs.ac.in/exp/truth-table-gates/theory.html
https://de-iitr.vlabs.ac.in/exp/truth-table-gates/simulation.html
OR Gate
An OR gate performs an ORing operation on two or more than two logic variables. The OR operation on two
independent logic variables A and B is written as Y = A+B and reads as Y equals A OR B and not as A plus B. An
OR gate is a logic circuit with two or more inputs and one output. The output of an OR gate is LOW only when all
of its inputs are LOW. For all other possible input combinations, the output is HIGH. This statement when
interpreted for a positive logic system means the following.
The output of an OR gate is a logic ‘0’ only when all of its inputs are at logic ‘0’. For all other possible input
combinations, the output is a logic ‘1’. Figure 4.3 shows the circuit symbol and the truth table of a two-input OR
gate. The operation of a two-input OR gate is explained by the logic expression
Y = A+B
As an illustration, if we have four logic variables and we want to know the logical output of (A+B+C+D), then it
would be the output of a four-input OR gate with A, B, C and D as its inputs.
OR Gate
An OR gate performs an ORing operation on two or more than two logic variables. The OR operation on two
independent logic variables A and B is written as Y = A+B and reads as Y equals A OR B and not as A plus B. An
OR gate is a logic circuit with two or more inputs and one output. The output of an OR gate is LOW only when all
of its inputs are LOW. For all other possible input combinations, the output is HIGH. This statement when
interpreted for a positive logic system means the following.
The output of an OR gate is a logic ‘0’ only when all of its inputs are at logic ‘0’. For all other possible input
combinations, the output is a logic ‘1’. Figure 4.3 shows the circuit symbol and the truth table of a two-input OR
gate. The operation of a two-input OR gate is explained by the logic expression
Y = A+B
As an illustration, if we have four logic variables and we want to know the logical output of (A+B+C+D), then it
would be the output of a four-input OR gate with A, B, C and D as its inputs.
AND Gate
An AND gate is a logic circuit having two or more inputs and one output. The output of an AND gate is HIGH only
when all of its inputs are in the HIGH state. In all other cases, the output is LOW. When interpreted for a positive
logic system, this means that the output of the AND gate is a logic ‘1’ only when all of its inputs are in logic ‘1’
state. In all other cases, the output is logic ‘0’. The logic symbol and truth table of a two-input AND gate are
shown below:
The AND operation on two independent logic variables A and B is written as Y = AB and reads as Y equals A AND
B and not as A multiplied by B. Here, A and B are input logic variables and Y is the output. An AND gate performs
an ANDing operation:
NOT Gate
A NOT gate is a one-input, one-output logic circuit whose output is always the complement of the input. That is,
a LOW input produces a HIGH output, and vice versa. When interpreted for a positive logic system, a logic ‘0’ at
the input produces a logic ‘1’ at the output, and vice versa. It is also known as a ‘complementing circuit’ or an
‘inverting circuit’. Figure 4.10 shows the circuit symbol and the truth table.
The NOT operation on a logic variable X is denoted as X or X . That is, if X is the input to a NOT circuit, then its
output Y is given by Y = X or X and reads as Y equals NOT X. Thus, if X = 0Y = 1 and if X = 1Y = 0.
EXCLUSIVE-OR Gate
The EXCLUSIVE-OR gate, commonly written as EX-OR gate, is a two-input, one-output gate.
_ _
Y = (A⊕B) = AB+AB
NAND Gate
NAND stands for NOT AND. An AND gate followed by a NOT circuit makes it a NAND gate
___
Y = A.B
In General
______
Y = (A.B.C.D.)
NOR Gate
NOR stands for NOT OR. An OR gate followed by a NOT circuit makes it a NOR gate.
___
Y = A+B
In General
________
Y = (A+B+C+D)
Universal Gate
1. OR, AND and NOT gates are the three basic logic gates as they together can be
used to construct the logic circuit for any given Boolean expression.
2. NOR and NAND gates have the property that they individually can be used to
hardware-implement a logic circuit corresponding to any given Boolean
expression. That is, it is possible to use either only NAND gates or only NOR
gates to implement any Boolean expression.
3. This is so because a combination of NAND gates or a combination of NOR gates
can be used to perform functions of any of the basic logic gates.
It is for this reason that NAND and NOR gates are universal gates.
Digital Logic Design
ASSOCIATIVE LAW:
A binary operator * on a set S is said to be associative whenever (x * y) * z = x * (y *
z) for all x, y, z Î S, for all Boolean values x, y and z.
COMMUTATIVE LAW:
A binary operator * on a set S is said to be commutative whenever x * y = y * x for all
x, y, z є S
IDENTITY ELEMENT:
A set S is said to have an identity element with respect to a binary operation * on S if
there exists an element e є S with the property e * x = x * e = x for every x є S
BASIC IDENTITIES OF BOOLEAN ALGEBRA
• Postulate 1(Definition): A Boolean algebra is a closed algebraic system
containing a set K of two or more elements and the two operators · and
+ which refer to logical AND and logical OR •x + 0 = x
•x·0=0 •x+1=1 •x·1=1 •x+x=x
•x·x=x • x + x’ = x • x · x’ = 0 •x+y=y+x
• xy = yx
•x+(y+z)=(x+y)+z
• x (yz) = (xy) z
• x ( y + z ) = xy + xz
• x + yz = ( x + y )( x + z)
• ( x + y )’ = x’ y’
• ( xy )’ = x’ + y’
• (x’)’ = x
DIGITAL LOGIC DESIGN
DeMorgan's Theorem
(a) (a + b)' = a'b' (b) (ab)' = a' + b'
Generalized DeMorgan's Theorem
(a) (a + b + … z)' = a'b' … z' (b) (a.b … z)' = a' + b' + … z‘
Basic Theorems and Properties of Boolean algebra Commutative law
Law1: A+B=B+A Law2: A.B=B.A
Associative law
Law1: A + (B +C) = (A +B) +C Law2: A(B.C) = (A.B)C
Distributive law
Law1: A.(B + C) = AB+ AC Law2: A + BC = (A + B).(A +C)
Absorption law Law1: A +AB =A Law2: A(A +B) = A
Solution: A(1+B) Solution: A.A+A.B
A A+A.B
A(1+B)
A
Boolean Function
A Boolean function expresses the logical relationship between binary variables and is evaluated by
determining the binary value of the expression for all possible values of the variables.
A Boolean function can be represented in a truth table. The number of rows in the truth table is 2n,
where n is the number of variables in the function. The binary combinations for the truth table are
obtained from the binary numbers by counting from 0 through 2n - 1.
Algebraic Manipulation (Minimization of Boolean function)
Boolean algebra is a useful tool for simplifying digital circuits.
• Why do it? Simpler can mean cheaper, smaller, faster.
• Example: Simplify F = x’yz + x’yz’ + xz.
F= x’yz + x’yz’ + xz
= x’y(z+z’) + xz
= x’y•1 + xz
= x’y + xz
Example: Prove
x’y’z’ + x’yz’ + xyz’ = x’z’ + yz’
• Proof:
x’y’z’+ x’yz’+ xyz’
= x’y’z’ + x’yz’ + x’yz’ + xyz’
= x’z’(y’+y) + yz’(x’+x)
= x’z’•1 + yz’•1
= x’z’ + yz’
Binary Arithmetic
Mathematical operations include addition, subtraction, multiplication, and division. Binary addition
follows rules similar to decimal addition. When adding with binary numbers, there are only four
conditions that can occur:
The first three conditions are easy because they are like adding decimals, but the last condition is
slightly different. In decimal, 1 + 1 = 2. In binary, a 2 is written 10. Therefore, in binary, 1 + 1 = 0,
with a carry of 1 to the next most significant place value. When adding larger binary numbers,
the resulting 1s are carried into higher-order columns, as shown in the following examples.
COMBINATIONAL CIRCUITS
Combinational Logic
• Logic circuits for digital systems may be combinational or sequential.
• A combinational circuit consists of input variables, logic gates, and output variables.
For n input variables, there are 2n possible combinations of binary input variables .For
each possible input Combination ,there is one and only one possible output
combination. A combinational circuit can be described by m Boolean functions one for
each output variables. Usually the input s comes from flip-flops and outputs go to flip-
flops.
Design Procedure
The different steps involved in the design of a combinational logic circuit are
as follows:
1. Statement of the problem.
2. Identification of input and output variables.
3. Expressing the relationship between the input and output variables.
4. Construction of a truth table to meet input–output requirements.
5. Writing Boolean expressions for various output variables in terms of input
variables.
6. Minimization of Boolean expressions.
7. Implementation of minimized Boolean expressions.
HALF ADDER A N D F U L L A D D ER
What is Adder?
● Types of adder:
Half adder
Full adder
● Half adder : The half adder accepts two binary
digits on its inputs and produce two binary digits
outputs, a sum bit and a carry bit.
Symbol Truth
Symbol Truth
Table
B A Table
B A C
S
0 0 0
0 0
0 1 0
0
2-input Ex-OR 2-input AND 1 0 0
0 1
Gate Gate 1 1 1
1
1 0
1
1 1
0
● Half adder truth table
S= A B Cin
C=AB +Cin(A B)
Complements:
In digital computers to simplify the subtraction operation & for logical
manipulation complements are used. There are two types of
complements used in each radix system.
i) The radix complement or r’s complement
ii) The diminished radix complement or (r-1)’s complement
Subtractors
Decoder
0 0 0
0 0 1
SEQUENTIAL CIRCUITS
Flip-Flops
• A flip-flop is a storage element based on the gated latch principle.
• It can have its output state changed only on the edge of the controlling clock signal
• We consider two types:
Edge-triggered flip-flop is affected only by the input values present when the
active edge of the clock occurs
Master-slave flip-flop is built with two gated latches
The master stage is active during half of the clock cycle, and the slave stage is
active during the other half.
The output value of the flip-flop changes on the edge of the clock that activates
the transfer into the slave stage.
S-R Latch using NOR Gates
Master-Slave D Flip-Flop
Excitation Tables
Registers and Counters
A Simple Shift Register
An n-bit register is a
cascade of n flip-
flops and can store
an n-bit binary data
A counter can count
occurrences of
events and can
generate timing
intervals for control
purposes
Counters
Counters are a specific type of
sequential circuit.
• Like registers, the state, or
the flip-flop values
themselves, serves as the
“output.”
• The output value increases
by one on each clock cycle.
• After the largest value, the
output “wraps around” back
to 0.
• Using two bits, we’d get
something like this:
Counters
Counter is a device which stores (and sometimes displays) the number of times particular
event or process has occurred, often in relationship to a clock signal. A Digital counter is a
set of flip flops whose state change in response to pulses applied at the input to the counter.
Counters may be asynchronous counters or synchronous counters. Asynchronous counters
are also called ripple counters
In electronics counters can be implemented quite easily using register-type circuits such as
the flip-flops and a wide variety of classifications exist:
Asynchronous (ripple) counter – changing state bits are used as clocks to subsequent
state flip-flops
Synchronous counter – all state bits change under control of a single clock
Decade counter – counts through ten states per stage
Up/down counter – counts both up and down, under command of a control input
Ring counter – formed by a shift register with feedback connection in a ring
Johnson counter – a twisted ring counter
Cascaded counter
Modulus counter.
Benefits of counters