Dfa Print Material
Dfa Print Material
DIGITAL LOGIC
CONTENTS
UNIT 1 : NUMBER SYSTEMS
UNIT 2 : BOOLEAN ALGEBRA
UNIT 3 : LOGIC GATES
UNIT 4 : COBINATIONAL CIRCUITS
UNIT 5 : SEQUENTIAL CIRCUITS
UNIT 6 : MEMORY ORGANIZATION
Subject Experts
Course Coordinators
July, 2011
© Krishna Kanta Handiqui State Open University.
No part of this publication which is material protected by this copyright notice may be produced
or transmitted or utilized or stored in any form or by any means now known or hereinafter
invented, electronic, digital or mechanical, including photocopying, scanning, recording or by
any information storage or retrieval system, without prior written permission from the KKHSOU.
The university acknowledges with thanks the financial support provided by the
Distance Education Council, New Delhi, for the preparation of this study material.
Printed and published by Registrar on behalf of the Krishna Kanta Handiqui State Open University.
Housefed Complex, Dispur, Guwahati- 781006; Web: www.kkhsou.org
COURSE INTRODUCTION
This is a course on Digital Logic. Digital logic has facinated many people over the years. Every-
thing in the digital world is based on the binary number system. Numerically, this involves only two
symbols: 0 and 1. Digital Logic is a method by which electrical circuits are provided with a limited ability
to make decisions. The most common use of digital logic today is in the control and arithmetic functions
of digital computers, without which modern life would grind to a halt.
The first unit discusses various number systems like decimal, binary, octal, hexadecimal and
their conversion from one form to another. The unit also includes the methods of addition and subtrac-
tion of binary numbers, complements and fixed/floating point representations. Concept of BCD, ASCII,
EBCDIC, Gray code etc are discussed at the end.
The second unit is on Boolean Algebra. The unit discusses various concept assotiated with
Boolean Algebra like Boolean operators, Boolean expression, representation of Boolean expression in
Canonical form, Karnaugh Map, Don’t care condition etc.
The third unit discusses various logic gates, their conversion, truth tables, and the most impor-
tant De-Morgan’s theorem.
The fourth unit focuses on combinational circuits. This unit gives us the concept various adders
and subtractors, multiplexers, demultiplexers, encoders, decoders etc. with their applications.
The fifth unit deals with sequential circuits which includes the concept of flip-flops, counters,
registers.
The sixth unit is the last unit of this course which is on memory organization. This unit gives us
the concept of RAM and its types, 2D and 3D organization of RAM, ROM, types of ROM, organization of
simple ROM cell etc.
Each unit of this course includes some along-side boxes to help you know some of the difficult,
unseen terms. Some “EXERCISES” have been included to help you apply your own thoughts. You may
find some boxes marked with: “LET US KNOW”. These boxes will provide you with some additional
interesting and relevant information. Again, you will get “CHECK YOUR PROGRESS” questions. These
have been designed to self-check your progress of study. It will be helpful for you if you solve the
problems put in these boxes immediately after you go through the sections of the units and then match
your answers with “ANSWERS TO CHECK YOUR PROGRESS” given at the end of each unit.
MASTER OF COMPUTER APPLICATIONS
Digital Logic
DETAILED SYLLABUS
Marks Page No.
1.2 INTRODUCTION
information composed of only zeros and ones. So, each decimal digits,
letters, symbols etc. written by the programmer (an user) are converted to
binary codes in the form of 0’s and 1’s within the computer. The number
system is divided into different categories according to the base (or radix)
of the system as binary, octal and hexadecimal. If a number system of base
r is a system, then the system have r distinct symbols for r digits. The
knowledge of the number system is essential to understand the operation
of a computer.
A Binary Number Only two digits 0 and 1 are used to represent the binary number
System uses only digit 0 system. So the base or radix is two (2). The digits 0 and 1 are called
and 1
bits (Binary Digits). In this number system the value of the digit will
be two times greater than its predecessor. Thus the value of the
places are :
32 16 8 4 2 1
The weight of each binary bit depends on its relative position
within the number. It is explained by the following example--
Example 1.2 :
The weight of bits of the binary number 10110 is :
= 1 × 24 + 0 × 23 + 1 × 22 + 1 × 21 + 0 × 20
= 16 + 0 + 4 + 2 + 0 = 22 (decimal number)
The weight of each bit of a binary no. depends on its relative
pointer within the no. and explained from right hand side as :
Weight of 1st bit = 1st bit X 20
Weight of 2nd bit = 2nd bit X 21
................................................
...............................................
and so on.
The weight of the nth bit of the number from right hand side
= nth bit × 2n-1
= nth bit × (Base)n-1
It is seen that this rule for a binary number is same as that for a
decimal number system. The above rule holds good for any other
8 Digital Logic
Number Systems Unit 1
A commonly used positional number system is the Octal Number Octal Number System
uses 8 digits from 0 to 7.
System. This system has eight (8) digit representation as
0,1,2,3,4,5,6 and 7. The base or radix of this system is 8. The
values increase from left to right as 1,8,64,512, 4096 etc. The decimal
Digital Logic 9
Unit 1 Number Systems
10 Digital Logic
Number Systems Unit 1
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Digital Logic 11
Unit 1 Number Systems
12 Digital Logic
Number Systems Unit 1
Digital Logic 13
Unit 1 Number Systems
8 × 0.123 = 0.984 0
8 × 0.984 = 7.872 7 read from LSB
8 × 0.872 = 6.976 6 to MSB
8 × 0.976 = 7.808 7
Read the integer to the left of the decimal point.
The calculation can be terminated after a few steps if the
fractional part does not become zero.
The octal equivalent of (0.123)10= (0.0767)8
NOTE : The octal to binary and binary to octal conversion is very
easy. Since, 8 is the third power of 2, we can convert each octal
digit into its three-bit binary form and vice versa.
Example 1.12 : Convert (567)8 to its binary form.
Solution : 5 6 7
Digital Logic 15
Unit 1 Number Systems
16 Digital Logic
Number Systems Unit 1
Digital Logic 17
Unit 1 Number Systems
18 Digital Logic
Number Systems Unit 1
Digital Logic 19
Unit 1 Number Systems
|0 .5147| |0 02|
Mantissa (fraction) Exponent
The floating point representation of 5147 X 10-2 is
Sign Sign
|0 5147| |0 02|
Mantissa (Integer) Exponent
Similarly for example a floating point binary number 1011.1010
can be represnted as : 1011.1010 = 0.10111010 × 24
20 Digital Logic
Number Systems Unit 1
|0 .10111010| |0 000100|
Mantissa (fraction) Exponent
The mantissa occupies 9 bits (1 bit for sign and 8 bits for value)
and the exponent 7 bits (1 bit for sign and 6 bits for value). The
binary point (.) is not physically indicated in the register, but it is only
assumed (position) to be there.
In general form, the floating point numbers is expressed as :
N = M X Re
Where, M – Mantissa
R – Radix (or base)
e – Exponent
The mantissa M and exponent e are physically present in register.
But the radix R and the point (decimal or binary point) are not
indicated in the register. There are only assumed for computation
and manipulation.
Normalized Floating point Number : Floating point numbers are
often represented in normalized forms. A floating point number where
mantissa does not contain zero as the most significant digit of the
number is considered to be in normaliged form. For example,
0.00038695 × 105 and 0.0589 × 10-4 are not normaliged numbers.
But 0.38695 × 102 and 0.589 × 10-5 are normaliged numbers.
Similarly, for binary number also, 0.0011001 × 28 and 0.0001011 ×
2-5 are not non-normaliged binary numbers. But 0.11001 × 26 and
0.1011 × 2-8 are normaliged binary numbers.
A zero cannot be normaliged as all the digits in the mantissa is
zero.
Arithmatic operations involved with floating point numbers are
more complex. It takes larger time for execution and requires
complex hardware. But floating point representaion is frequently used
in scientific calculations.
Digital Logic 21
Unit 1 Number Systems
22 Digital Logic
Number Systems Unit 1
1.7.1 Addition
Digital Logic 23
Unit 1 Number Systems
a) Signed magnitude
b) Signed 1’s complement
c) Signed 2’s complement
This will be more clear if we discuss through the following
example:
Example 1.17 : Add 25 and -30 in binary using 7 bit register in
signed magnitude representation
a) Signed 1’s complement representaion
b) Signed 2’s complement representaion
Solution : Here, 25 is + 25 = 0011001 in binary system
–30 = 1011110 in binary system
To do the arithmatic addition with one negative number we have
to check the magnitude of the numbers. The number having smaller
magnitude is there subtracted from the bigger number and the sign
of bigger number is selected. To implement such a scheme in digits,
hardware will require a long sequence of control decisions as well
as circuits that will add, compare and subtract numbers. The better
attentative of arithmatic with one negative number is signed 2’s
complement.
In signed 2’s complement representation :
We get that +30 is 0 011110
–30 is 1 011110
Now, 2’s complement of –30 (including sign bit) 1 100010
+25 is 0 011001
Addition
+25 0 011 001
–30 1 100 010
–05 1 111 011 (Just add the numbers)
The result for negative number will store n signed 2’s complement
form. So the above result in signed 2’s complement form. So the
above result in signed 2’s complemnt form including sign bit is
1 000 100 +1 = 1 000 101
Which is -05 in decimal system.
24 Digital Logic
Number Systems Unit 1
26 Digital Logic
Number Systems Unit 1
1.7.2 Subtraction
Digital Logic 27
Unit 1 Number Systems
If the carry out of the MSBs of number (or, carry into the sign bit)
is equal to the carry out of the sign bit then overflow must have
occured. For example
–65 1 0111111 –65 1 0111111
–15 1 1110001 –75 1 0110101
–80 11 0110000 –140 10 1110100
Carry =1 Carry = 10
Carry from MSB =1 Carry from MSB =0
Carry from sign bit = 1 Carry from sign bit = 1
Sign bit is =1 Sign bit is =0
No overflow Therefore, overflow
Thus, overflow has occured, i.e. the arithmatic results so
calculated have exceeded the capacity of the representation. This
overflow also implies that the calculated results might be erronous.
1.7.3 Multiplication
1.7.4 Division
Q.8. Add 35 and -40 in binary using 7 bit register in 2’s complement
representation.
............................................................................................
Q.9. Add binary no. 110011.010 and 1000.10
............................................................................................
Q.10. Subtract (1010101)2 -(1001001)2 by 2’s complement method.
............................................................................................
30 Digital Logic
Number Systems Unit 1
1.8.1 BCD
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Unlike binary encoded numbers, BCD encoded numbers can
easily be displayed by mapping each of the nibbles(4-bits) to a
different character. Conversion of decimal to BCD and BCD to
decimal are shown below:
Example 1.24 : Convert the decimal numbers 47 and 180 to BCD.
Solution : 4 = 0100 and 7 = 111
47 = 0100111
Similarly, 180=0001 1000 0000
Example 1.25 : Convert each of the BCD code 1000111 to decimal.
Solution : First we have to divide the whole BCD code by a set of 4-
bits from right to left. Then from left to right we can put the
corresponding decimal numbers.
0100 0111
4 7
Thus, 1000111(in BCD) = 47 (in Decimal)
BCD addition : BCD is a numeric code and can be used in arithmetic
operations. Addition is the most important operation because the
other three operations (subtraction, multiplication, and division) can
be accomplished by the use of addition. Here is how to add two
BCD numbers:
Step1 : Add the two BCD numbers, using the rules for binary
addition.
Step 2 : If a 4-bit sum is equal to or less than 9, it is a valid BCD
number.
Step 3 : If a 4-bit sum is greater than 9, or if a carry out of the 4-bit
group is generated, it is an invalid result. Add 6(0110) to
32 Digital Logic
Number Systems Unit 1
the 4-bit sum in order to skip the six invalid states and
return the code to 8421. If a carry results when 6 is added,
simply add the carry to the next 4-bit group.
Example 1.26 : Add the following BCD numbers :
a) 0001 + 0100
b) 10000111 + 01010011
Solution : The decimal number addition are shown for comparison.
(a) 0001 1
+0100 +4
0101 5
0001 + 0100 = 0101 Which is valid BCD no. (Value < 9)
(b) 1000 0111 87
+0101 0011 + 53
1101 1010 Both groups are invalid (>9) +140
+0110 +0110 Add 6 (i.e.,0110) to both groups
0001 0100 0000 Valid BCD number which is 140
in decimal.
1.8.2 ASCII
Digital Logic 33
Unit 1 Number Systems
1.8.3 EBCDIC
36 Digital Logic
Number Systems Unit 1
Digital Logic 37
Unit 1 Number Systems
38 Digital Logic
Number Systems Unit 1
Digital Logic 39
UNIT 2 : BOOLEAN ALGEBRA
UNIT STRUCTURE
2.2 INTRODUCTION
42 Digital Logic
Boolean Algebra Unit 2
listed in table 2.2. The postulates are basic axioms of the algebric structure
and need no proof, but the theorems must be proven with the help of the
postulates. Both the postulates and theorems are listed in pairs: one is the
dual of the other.
Table 2.2
Postulates and Theorems of Boolean Algebra
Postulate 2 (a) x + 0 = z (b) x.1 = x
Postulate 5 (a) x + x/ = 1 (b) x. x/ = 0
Theorem 1 (a) x + x = x (b) x. x = x
Theorem 2 (a) x + 1 = 1 (b) x. 0 = 0
Theorem 3, Involution (x/) / =x
Postulate 3, Commutative (a) x + y = y + x (b) xy = yx
Theorem 4, Associative (a) x + (y + z) = (x + y) + z
(b) x (yz) = (xy)z
Postulates 4, Distributive (a) x (y + z) = xy + xz
(b) x+yz = (x+y)(x+z)
Theorem 5, De Morgan (a) (x + y)/ = x/ y/ (b) (xy)/ = x/ + y/
Theorem 6, Absorption (a) x + xy = x (b) x(x + y) = x
Duality Principle : This is an important property of Boolean algebra.
It states that every algebric expression deducible from the postulates of
Boolean algebra remains valid if the operator and identity elements are
interchanged. In a two-valued Boolean algebra (which is defined on a set of
two elements, B = {0, 1}, with rules for the two binary operators + and), the
identity elements and the elements of the set B are same: 1 and 0. If we
need the dual of an algebric expression we simply interchange OR and
AND operators and replace 1’s by 0’s and 0’s by 1’s.
The proofs of the theorems with one variable are given below:
Theorem 1 (a) x + x = x
x + x = (x + x).1 by postulate : 2 (b)
= (x + x) (x + x/) : 5 (a)
= x + x x/ : 4 (b)
=x+0 : 2 (a)
=x
Digital Logic 43
Unit 2 Boolean Algebra
Theorem 1 (b) : x. x = x
x. x = x. x + 0 by postulate : 2 (a)
= xx + x x/ : 5 (b)
= x (x + x/) : 4 (a)
= x.1 : 5 (a)
=x : 2 (a)
If we observe carefully we see that theorem 1 (b) is the dual of
theorem 1 (a) and each step of the proof in part (b) is the dual of part (a).
Thus any dual theorem can be similarly derived from the proof of its
corresponding pair.
Theorem 2 (a): x + z = 1
x + 1 = 1. (x + 1) by postulate : 2 (b)
= (x + x/) (x +1) : 5 (a)
= x + x/.1 : 4 (b)
= x + x/ : 2 (b)
=1 : 5 (a)
Theorem 2 (b): x. 0 = 0 by duality.
Theorem 3: (x/)/ = x
We have x. x/ = 0 from postulate 5 (b), which defines complement of x.
The complement of x/ is x and is also (x/)/. Since the complement is
unique, therefore we have (x/)/ = x.
We can prove the theorems which involve two or three variables,
algebraically, from the postulates and theorems which have already been
proven. Let us consider the absorption theorem.
Theorem 6 (a) : x + xy = x
x + xy = x.1 + xy by postulate 2 (b)
= x (1 + y) by postulate 4 (a)
= x (y + 1) by postulate 3 (a)
= x.1 by theorem 2 (a)
=x by postulate 2 (b)
Theorem 6 (b): x (x + y) = x by duality.
The theorems of Boolean algebra can also be proved/verified easily
with the help of truth table. The following truth table verifies the theorem 6 (b).
44 Digital Logic
Boolean Algebra Unit 2
Table 2.3
1 2 3 4
x y x+y x (x + y)
0 0 0 0
0 1 1 0
1 0 1 1
1 1 1 1
Here we see that, column 4 and column 1 are same, i.e. x (x + y) =
x. Since the algebric proof of the De Morgan’s theorem and the associative
law are very long, we can show their validity with truth tables easily. Let us
consider the De Morgan’s theorem: (x + y)/ = x/ y/
Now, the truth table for this is shown below.
Table 2.4
1 2 3 4 5 6 7
x y x+y (x + y)/ x/ y/ x/ y/
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
Column 4 is equal to column 7, so, (x + y)/ = x/ y/
Complement of a Boolean Function : The complement of a
function F is F/. It can be obtained from an interchange of 0/s for 1/s and 1/
s for 0/s in the value of F. Algebraically, the complement of a function may
be derived through De Morgan’s theorem. The De Morgan’s theorem can
be extended to any number of variables.
The theorem can be generalized as :
(A + B + C + ..... + G) / = A/B/C/ ... G/
(ABC...G) / = A/ + B/ + C/ + ......... + G/
This generalized form of De Morgan Theorem states that the
complement of a function is obtained by interchanging AND and OR
operators and complementing each literal. (A literal is a primed or unprimed
variable). Let F1= A/BC + A/B/C/. Now F1/ i.e. complement of the function
can be obtained by applying the De Morgan’s theorem as follows:
Digital Logic 45
Unit 2 Boolean Algebra
46 Digital Logic
Boolean Algebra Unit 2
xy/ xy x/y
Minterms Maxterms
Digital Logic 47
Unit 2 Boolean Algebra
a b c function f1 function f2
0 0 0 1 0
0 0 1 0 0
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 1
1 1 0 1 0
1 1 1 0 1
From the table, we see that, function f 1 is 1 for four combinations of
a, b, c i.e. a/b/c/, a/b c, a b/ c and a b c/. Thus, for each one of these minterms
the function f1=1, and we can express the function f 1 as:
f1 = a / b / c / + a / b c + a b / c + a b c/
= mo + m3 + m5 + m6
= (0, 3, 5, 6)
(The symbol ‘’, is used to mean sum of minterms. Similarly, we
can easily verify that –
48 Digital Logic
Boolean Algebra Unit 2
f2 = a / b c / + a b / c/ + a b / c + a b c
= m2 + m4 + m5 + m7
= (2,4, 5, 7)
From here we observe an important property of Boolean algebra.
Any Boolean function can be expressed as a sum of minterms (sum means
Or ing to terms)
Now consider again the table 2.3 to read the complement of f 1. We
can obtain the complement of f1 by forming a minterm for each combination
of a, b, c, that produce a 0 in the function and then ORing to those terms.
Thus f1/ = a/ b/ c + a/ b c/ + a b/ c/ + a b c
Now taking the complement of f1/, we obtain the function f1:
(f1/) = f1 = (a/ b/ c + a/ b c/ + a b/ c/ + a b c) /
= (a + b + c/) (a + b/ + c) (a/ + b + c) (a/ + b/ + c/)
= M1 M2 M4 M7
= (1, 2, 4, 7) (/ is used to mean product of maxterms)
This demonstrates a second important property of Boolean algebra:
Any Boolean function can be expressed as product of maxterms (product
means ANDing of terms).
Now, we are in a position to define the canonical form of a Boolean
function. Boolean functions expressed as a sum of minters or product of
maxterns (i.e. each term of the function must have all the literals) are said
to be in canonical form.
Sum of Minterms : It is sometimes convenient to express the
Boolean function in its sum-of-minterms form. It can be done by first
expanding the expression into a sum of AND terms. Then each term is
inspected to see if it contains all the variables/literals. If one or more variable
is missing in a term, it is ANDed with an expression (a + a/), where a is one
of the missing variables. Let us take an example to clarify this procedure.
Note : a + a/ = 1
Example : Express the Boolean function xy + x z/ + y/ in a sum of
minterms. Here we see that the function has 3 variables and there are 3
AND terms. Two terms missing one variable and one term missing two
variables.
Digital Logic 49
Unit 2 Boolean Algebra
Combining all the terms and removing those that appear more than
once we finally obtain:
f = (x + y + z) (x + y + z/) (x + y/ + z) (x + y/ + z/) (x/ + y/ +z/)
= M0 M1 M2 M3 M7
= (o, 1, 2, 3, 7) (The symbol denotes the ANDing of maxterms)
Conversion between canonical forms : Boolean functions
represented in one canonical form can easily be convered to the other
canonical form. It will be clear from the following example.
Example : Convert the function F (x, y, z) = (2, 4, 5, 7) into product
of maxterm form.
Solution : We have F (x, y, z) = (2, 4, 5, 7) = m2+m4+m5+m7
Taking complement F/ (x, y, z) = (0, 1, 3, 6) = m0+m1+m3+m6
Now, if we take the complement of F/ by De Morgan’s theorem,
We obtain F = (m0+m1 + m3+m6)/
= m0/ m1/ m3/ m6/
= M0 M1 M3 M6
= (0, 1, 3, 6)
Note : From table 2.5, it is clear that relation mj/ = Mj is true i.e. a
maxterm is a complement of the corresponding minterm and vice versa.
The simplest way to convert from one canonical form to other is:
Interchange the symbols and and list those numbers missing from the
original form.
Standard form : In this form, the terms that form the Boolean function
may contain one, two or any number of literals. Two types of standard forms
are: the sum of product and product of sums.
The sums of products is a Boolean expression containing, AND
terms, called product terms, of one or more literals each.
eg: F1= a + b c/ + a b/ c
A product of sums is a Boolean expression containing OR terms,
called sum terms. Here also each term may have any number of literals.
eg: F2= y (x + y/) (x/ + z) (x + y/ + z/)
A Boolean function may also be expressed in a non standard form.
eg: F3 = (x/ y + x/ z) (x/ y + x/y/)
Digital Logic 51
Unit 2 Boolean Algebra
3) xy + x/ z + yz
= xy + x/ z + y z (x + x/)
= x y + x/ z + x y z + x / y z
= x y (1 + z) + x/ z (1 + y)
= x y + x/ z
In these examples, literals are minimized in 1 and 2, and in 3 a
term is minimized.
The algebric manipulation procedure of minimizing a Boolean
function is awkward because it lacks specific rules to predict each
succeeding step in the process.
Digital Logic 53
Unit 2 Boolean Algebra
a\b
0 1
0 a/ b/ a/ b mo m1
1 a b/ ab m2 m3
(a) Two variable K map
a\bc \B
00 01 11 10
0 a / b / c/ a / b / c a / b c a / b c/ mo m1 m3 m2
1 a b / c/ a b / c a b c a b c/ m4 m5 m7 m6
(b) Three variables K map
ab\cd
00 01 11 10
00 a/b/c/d/ a/b/c/d a/b/cd a/b/cd/ m0 m1 m3 m2
01 a/bc/d/ a/bc/d a/bcd a/bcd/ m4 m5 m7 m6
11 abc/d/ abc/d abcd abcd/ m11 m12 m14 m13
10 ab/c/d/ ab/c/d ab/cd ab/cd/ m7 m8 m10 m9
(c) Four variables K map
Fig. 2.2 : K-map
There are four minterms for two variables; hence the map
consists of four squares, one for each minterm. Similarly, for three
and four variables there are eight and sixteen minterms respectively
and hence the maps consist of eight and sixteen squares.
Representation of Truth Table on K-maps :
We have already known that truth table defines the relationship
between output and input. Truth table – involves two variables and
its K-map representation is shown in the figure.
Input Output x\y x\y
x y z 0 1 y/ y
0 0 1 0 1 0 OR x/ 1 0
0 1 0 1 1 0 x 1 0
1 0 1
1 1 0
Truth table K-map K-map
54 Digital Logic
Boolean Algebra Unit 2
Here, we see that we put 1’s in the squares whose minterms are
0 and 2. This is because, from the truth table we see that the output
in 1, only for the input combinations x=0, y=0 and x=1 and y=0. For
others the output in 0, and we put 0’s in the map accordingly. Similarly,
we can represent a truth table having n variables with a K-map of 2n
squares.
Plotting a Boolean expression on the Karnaugh Map : As we
already have seen that each square of the K map represents one
minterm, so the expression to be plotted must be in sum of product
form. The following example clarifies the point.
Example : Plot the Boolean function f=yz + xy/z/ + xyz/ on a K-map.
The term y z missing one variable, so
y z = y z (x + x/) = x y z + x/ y z
Now, F = x/ y z + x y z + x y/ z/ + x y z/
= m3 + m7 + m4 + m6
= m3 + m4 + m6 + m7
Since the expression has three variables, we need a K-map of
23 = 8 squares.
x\yz
00 01 11 10
0 0 0 1 0
1 1 0 1 1
Digital Logic 55
Unit 2 Boolean Algebra
a\bc a\bc
00 01 11 10 00 01 11 10
0 a/b/c/ a/b/c a/bc a/bc/ OR 0 m0 m1 m3 m2
1 ab/c/ ab/c abc abc/ 1 m4 m5 m7 m6
/ / / / /
In this map, m0 (a b c ) is adjacent to m1 (a b c) because only one
variable i.e. “c” appears in mo in its complement form and in m1,
appears in normal form, other variables are same. Similarly, mo is
adjacent with m4 and m2; m1 is adjacent with m3, m0 and m5; m4 is
adjacent with mo, m5, and m6; and so on. When we are going to
simplify a Boolean function using K-map, we will consider this
adjacency of squares and try to combine as much as possible
adjacent squares. We may combine the number of adjacent squares
as two, four, eight and sixteen in a four variables map.
By combining two adjacent squares of a four variable map we
get a term of three variables/literals.
– combining four adjacent squares we get a term of two literals.
– combining eight adjacent squares we get a term of one literal
and combining sixteen adjacent squares we get a 1 i.e. the
function in equal to 1. (i.e. the sum of all minterms is eual to 1).
Example : Simplify the Boolean function:
F = x/ y / z/ + x / y/ z + x y z / + x y z
x\yz
00 01 11 10
0 1 1
1 1 1
Fig. 2.3 : K-map for the function F = x/ y/ z + x/ y/ z + x y z/ + x y z
Note : Here, adjacent squares are marked with rectangles
After plotting the function, adjacent squares are combined with
each other.
Combining the two squares on top we get the term x/ y/ (i.e. here
variable z is changing, so omit it).
Similarly, combining the two squares on bottom, we get xy.
So, the given function is simplified to F = x/ y/ + xy.
56 Digital Logic
Boolean Algebra Unit 2
00 1 1 1
m4 m5 m7 m6
01 1
m12 m13 m15 m11
11
m8 m9 m11 m10
10 1 1 1
Digital Logic 57
Unit 2 Boolean Algebra
Combining mean terms i.e. squares in the four corners, i.e. mo,
m2, m8 and m10, we get B/ D/
Combining m0, m1, with m8, m9 we get B/ C/ Now, only one square,
m6 remains without combining. We can combine it with m2 ( they
are adjacent) and it gives the term A/ B C/. Note that if we do not
combine m6, we have to write the term as A/BCD/, i.e. with four
literals.
So, the simplified form of the function is F = B/ D/ + B/ C/ + A/ C D/
Product of Sum Simplification : In all the previous examples, the
minimized Boolean functions derived from the K-maps were
expressed in the sum of products (SOP) form. The product of Sums
(POS) form can be obtained with a minor modification.
The procedure for obtaining a minimized function in product of
sums follows from the basic properties of Boolean functions. The
minterms included in the function are represented by placing 1’s in
the corresponding squares on the map. The minterms not included
in the function denote the complement of the function. If we mark
these empty squares by 0’s and combine them into valid adjacent
squares, we obtain a simplified expression of the complement of
the function, i.e. of F/. If we take the complement of F, we get back
the function F. The function so obtained is automatically in the product
of sums form, because of the De Morgan’s theorem. The following
example clarifies the procedure.
Example : Simplify the Boolean function
F (A,B,C,D) = (1, 5, 8, 9, 10) in (a) sum of product and (b)
product of sums.
Solution : Sum of products simplification of left as an exercise, and
we will show only POS simplification.
58 Digital Logic
Boolean Algebra Unit 2
(b) AB\CD
00 01 11 10
00 0 1 0 0
01 0 1 0 0
11 0 0 0 0
10 1 1 0 1
Fig. 2.4 : Map for example
The squares marked with 0’s represents the minterms not
included in F i.e., they denote the complement of F. Combining the
0’s as shown in the map, we obtain the simplified complemented
function: F/= AB + CD + A/ D/
Applying De Morgan’s theorem, we obtain:
F/ = AB + CD + A/ D/
(F/)/ = F = (AB + CD + A/ D/)/
= (AB)/ (CD) / (A/ D/)/
= (A/ + B/) (C/ + D/) (A+D)
which is the simplified function in product of sums.
Answer of Example (a) F = A/ B/ C + A B/ C/ + A B/ D/
60 Digital Logic
Boolean Algebra Unit 2
F/ = D/ + AC/
(F/)/ = F = (D/ + AC/)/
= D (A/ + C) - (applying De Morgan’s theorem)
This is the simplified POS form of the function.
Digital Logic 61
Unit 2 Boolean Algebra
The three basic logic functions and operations are AND (logical
multiplication), OR (logical addition), and the NOT (logical
complementation) operation.
Boolean addition is same as logical OR and Boolean multiplication
is same as logical AND operation.
The logical NOT operation changes logical 1 to 0 and vice versa.
To get dual of any Boolean expression, you have to replace every 0
with 1 and every 1 with 0, and replacing every operator (+) with (.)
and every (.) with (+).
Any Boolean expression obtained by interchanging 0s and 1s and
the operator (of an expression) is called the dual expression. This is
the duality principle of Boolean algebra.
De Morgan’s theorem can be extended to any number of variables.
It is useful in obtaining the complement of a Boolean function.
We can simplify a Boolean function using algebric manipulation
method and map method. There is no straight forward procedure in
the algebric manipulation method.
The K-map method is simple systematic and straight forward.
Any Boolean function can be expressed as a sum of minterms (SOP)
and as a product of maxterms (POS). Minterms are AND terms and
maxterms are OR terms.
The variables in a product term (minterm) and in a sum term
(maxterm) may appear either in a complemented form or a normal
form.
A function is said to be completely specified, when for every possible
combination of input variables the output is defined, otherwise the
function is incompletely specified.
In an incompletely specified function those combination of input
variables for which output values are not known i.e. which minterms
or maxterms are not used as parts of the output function are called
Don’t care terms.
62 Digital Logic
Boolean Algebra Unit 2
Digital Logic 63
Unit 2 Boolean Algebra
= =
Ans. to Q. No. 5 : A minterm is an AND term also called product term
Minterms are obtained by combining the variables,
which may appear in their normal form or complement
form, with an AND operation. For example, for the two
variables “a” and “b”, we have four minterms, viz, a/b/
(mo), a/ b (m1), a b/ (m2) and a b (m3).
Ans. to Q. No. 6 : A maxterm, on the other hand an OR term, also called
sum term. Maxterms are obtained by combining the
variables with an OR operation. As for example, for
two variables “a” and “b”, we have four maxterms and
they are: a+b (M0), a+b/ (M1), a/+b (M2), and a/+b/ (M3).
64 Digital Logic
Boolean Algebra Unit 2
Digital Logic 65
Unit 2 Boolean Algebra
Long-Answer Questions :
Q.1. Problem: Simplify the following Boolean functions in SOP form.
a) F (a, b, c) = (2, 3, 6, 7)
b) F (w, x, y, z) = (7, 13, 14, 15)
c) F (a, b, c, d) = (2, 3, 12, 13, 14, 15)
d) x y z/ + x y z + x/ z/
e) a b/ c + a b c/ + a/ b c + a b c
Q.2. Problems: Consider the following truth table.
a b c F1
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
66 Digital Logic
Boolean Algebra Unit 2
Digital Logic 67
UNIT 3 : LOGIC GATES
UNIT STRUCTURE
68 Digital Logic
Logic Gates Unit 3
3.2 INTRODUCTION
3.3.1 OR Gate
A
A B
A Y = A+B Y = A+B+C Y = A+B+C+D
B
B C
C D
(a) (b) (c)
Fig. 3.1 : Graphic symbols for (a) two inputs, (b) 3 inputs and
(c) 4 inputs or gate
The algebric function for OR gate (2 inputs) is : F = xy, and the
truth table is :
Table 3.1 Truth table of OR gate (2inputs)
x y f
0 0 0
1 0 1
1 1 1
C Y=A+B +C
70 Digital Logic
Logic Gates Unit 3
Inputs Outputs
A B C Y=A+B +C
0 0 0 0
0 0 1 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
An AND gate also may have two or more inputs and a single
output. In order to have a HIGH (1) output, all the inputs of the AND
gate must be HIGH (1), otherwise the output is LOW. Fig. 3.3 shows
graphic symbols used for an AND gate.
A
A
A B
Y = A.B Y = A.B.C Y = A.B.C.D
B
B
C
C
D
Fig. 3.3 : Graphic symbol for (a) two inputs (b) three inputs and
(c) four inputs AND gate
X Y F = X.Y
NOT gate circuit has a single input and single output. The NOT
gate circuit in also called a complementary circuit or an inverter as it
complements its input i.e. it accomplishes a logic negation. Figure
3.5 shows the different graphic symbols used for the NOT gate.
x x/ x x/
(a) (c)
x x/ x x/
(b) (d)
Fig. 3.5 : Graphic symbols for NOT gate
72 Digital Logic
Logic Gates Unit 3
The algebric function for a NOT gate is : F = x/. Table 3.4 is the
truth table for a NOT gate.
Table 3.4 : Truth table of NOT gate
X F
0 1
1 0
The NOT gate is understood by the short circuit switch A is closed,
(ON) the bulb is bypassed and it does not glow, but when the switch
is opened (OFF), the current will flow through the bulb and it would
glow. i.e., when A is ON the bulb will be OFF and when A is OFF the
lamp will be ON.
R
–
Y=A
V A
Table 3.5
x y F
0 0 1
0 1 1
1 0 1
1 1 0
Digital Logic 73
Unit 3 Logic Gates
x
y
– x
F = (xy)/ ~ F = (xy)/
y
x x
F = (x+y)/ ~
– F = (x+y)/
y y
x y F
0 0 1
0 1 0
1 0 0
1 1 0
x
x F = (x y) F = x/y+xy/
~
–
y
Fig. 3.9 : (a) Graphic symbol fo XOR gate (b) XOR gate using basic gates
Digital Logic 75
Unit 3 Logic Gates
x F = (x y)/ F = (x y)/
x
y ~
– y
76 Digital Logic
Logic Gates Unit 3
Basic idea of truth table is already given in UNIT –2. Here, we will
see the process of deriving an expression from a truth table.
The general procedure for obtaining the expression from a truth
table in sum of products (SOP) can be summarized as follows:
1 Write an AND term (minterm) for each combination of input
variables in the table for which output is 1.
2 Each AND term contains each input variable either in normal
form or in comple mented form. If the corresponding variable is
0 then it is complemented in the AND term.
3 All the AND terms are then ORed together to produce the final
output expression.
Digital Logic 77
Unit 3 Logic Gates
y
F
Note : Since the function has 2 AND terms, we need 2 AND gates
and 1 OR gate to implement it.
78 Digital Logic
Logic Gates Unit 3
section, we will discuss how the digital circuits can be implemented with
NAND or NOR gates.
NAND and NOR gates are easier to fabricate with electronic
components and are the basic gates used in all IC digital logic families. So,
digital circuits are more frequently constructed with NAND or NOR gates
than with AND and OR gates. Because of the prominence of NAND and
NOR gates in the design of digital circuits, rules and procedures have been
developed for the conversion from boolean functions given in terms of AND,
OR and NOT into equivalent NAND or NOR logic diagram. Here, we will
consider only the procedure for two level implementation.
First, we will define two other graphic symbols for NAND and NOR
gates, which will make the conversion procedure easily understandable.
Two equivalent symbols for the NAND gate are shown in Fig. 3.12 (a).
The AND invert symbol has been defined previously. It is possible to
represent a NAND gate by an OR graphic symbol preceded by small circles
in all the inputs. This symbol i.e. invert - OR symbol for the NAND gate
follows from the De Morgan’s theorem. and from the convention that small
circle denote complementation.
F = (x/+y/+z/)
x x
F = (xyz) / = (xyz)/
y y
z
z
x F = x/y/z/
F = (x+y+z)/ x
= (x+y+z)/
y y
z
z
x x/ x x/ x x/
Digital Logic 79
Unit 3 Logic Gates
D D Y
Y E
E
F F
(a) (b)
1st level
A
B 2nd level
C
D Y
E
In fig.3.13 (c),the output NAND gate i.e. the second level NAND
gate is replaced with the conventional symbol. The one input NAND gate
complements variable F. The diagram in (c) is equivalent to the one in (b),
which is turn is equivalent to the diagram in (a). Thus, we implement the
circuit, with NAND gates in fig. 3.13 (b) or 3.13 (c), which is first implemented
with AND and OR gates in fig 3.13 (a).
The NAND implementation can also be verified algebrically as:
Y = [(ABC)/ . (DE)/ . F/]/
= [(A/ + B/ + C/) (D/ + E/) . F/]/
= ABC + DE + F
From, the transformation shown in Fig. 3.13 we see that a boolean
function can be implemented with two levels of NAND gates. The rule for
obtaining the NAND logic diagram from a boolean function is as follows:
1. Simplify the function in sum of products (SOP).
2. For each product term of the function that has atleast two literals,
draw a NAND gate.
3. Draw a single NAND gate (using the AND invert or INVERT -OR
graphic symbol) in the second level, with inputs coming from
outputs of first -level gates.
4. A term with a single variable requires our inverter in the first
level or may be complemented and applied as an input to the
second-level NAND gate.
There is a second way to implement a boolean function with NAND
gates. We have already shown in Unit -2 that combining the 0’s in a map
we obtain the simplified expression of the complement of the function in
sum of products. The complement of the function so obtained can then be
implemented with two levels of NAND gates using the above stated rules.
To obtain the normal output of the circuit, it is required to insert a one input
NAND or inverter gate to generate the true value of the output variable.
When the designer wants to generate the complement of the function, the
second method in preferred.
Digital Logic 81
Unit 3 Logic Gates
x/
y
z/
F
x
y/
x/
z/ y/ F
x F/
The two level NAND implementation is shown in Fig. 3.14 (a) Now,
we try to simplify the complement of the function in SOP. This is done by
combining to o’s in the map: Thus
The two-level NAND gate for generating F is shown in Fig 3.14 (c).
If output F is required, we have to add a one input NAND gate to invert the
function. (We assume that the input variables are available in both the normal
and complement forms).
NOR Implementation : The NOR function is the dual of the NAND
function. So, all procedures and rules for NOR logic are the dual of the
corresponding procedures and rules developed for NAND logic.
The implementation of a boolean function with NOR gates requires
that the function be simplified in product of sums (POS) form. A product of
82 Digital Logic
Logic Gates Unit 3
sums expression specifies a group of OR gates for the sum terms, followed
by an AND gate to produce the product. The transformation from the OR-
AND to the NOR-NOR diagram is shown in Fig. 3.15, which is similar to the
NAND transformation discussed already, except that here we use the product
of sums expression :
F = A (B + C) (D +E)
A A/
B B
C F C F
D D
E E
(a) (b)
B F
C
D
E
(c)
The produre for obtaining the NOR logic diagram from a boolean
function can be derived from this transformatin. It is similar to the three step
NAND rule, except that the simplified expression must be in the product of
sums and the terms for the first level NOR gates are the sum terms. A term
with a single variable requires a one input NOR or inverter gate or may be
complemented and directly applied to the second-level NOR gate.
Another way to implement a function with NOR gate is to use the
expression for the complement of the function in product of sums. It gives a
two level implementation for F and a three level implementation gives the
normal output F.
Simplified product of sums can be obtained from a table by combining
the O’s and then complementing the function. To obtain the simplified product
of sums expression for the complement of the function, we have to combine
the 1’s in the map and then complement the function. The NOR gate
implementation procedure is demonstrated in the following example.
Digital Logic 83
Unit 3 Logic Gates
x
y
x/
y/ F
z/
A
B
A
B F=AB C
C
C F=AB C
84 Digital Logic
Logic Gates Unit 3
Digital Logic 85
Unit 3 Logic Gates
86 Digital Logic
Logic Gates Unit 3
Q.17. Draw the logic diagram of NOT gate using NOR / NAND gate
Q.18. What is an XOR gate ? Write its truth table for 2 variables.
Q.19. Show the logic diagram of an XOR gate using basic gates.
Q.20. Draw the logic diagram of an XOR gate using NAND gates.
Q.21. What is an XNOR gate ? Write its truth table.
Q.22. Draw the logic diagram of an XNOR gate using basic gates.
Q.23. Draw the symbol of an XNOR gate and its Boolean expression.
Digital Logic 87
UNIT 4 : COMBINATIONAL CIRCUIT
UNIT STRUCTURE
88 Digital Logic
Combinational Circuit Unit 4
4.2 INTRODUCTION
Digital Logic 89
Unit 4 Combinational Circuit
Adder circuits are used to add binary bits. If we require to find sum
of two 1-bit we use a circuit called half-adder. Some times it becomes
necessary to add three 1-bit binary numbers. The circuit for this is called
full-adder.
4.3.1 Half-Adder
In the following table the sum(S) and carry(C) bits are shown
as result which are obtained when two 1-bit number X and Y are
added. The table contains all the possible combination of values of
these two numbers. From the table two individual circuits can be
constructed to obtain sum and carry in response to every
combination of the two input numbers. Combining both a single
circuit is constructed to treat it as a single combinational circuit to
give us two outputs viz sum and carry. The circuit is generally termed
as half-adder.
Hence we can say that a half-adder is a circuit that can add two
binary bits. Its outputs are SUM and CARRY.
X Y CARRY (C) SUM (S)
0 0 0 0
–
0 1 0 1 (XY)
–
1 0 0 1 (XY )
0 1 1 ( XY) 0
Truth Table for a Half-Adder
90 Digital Logic
Combinational Circuit Unit 4
The minterms for Sum and CARRY are shown in the bracket.
The Sum-Of-Product equation for SUM is :
– –
S = XY + XY ……………… (1)
Similarly the SOP equation for the CARRY is :
C = XY ……………… (2)
Combining the logic circuits for equation ( 1 ) & ( 2 ) we get the
circuit for Half-Adder as :
4.3.2 Full-Adder
To add two 2-bit binary numbers, we first add the two least
significant bits of each number and take the carry ( if any ) that
generate into the addition of the two most significant bits. Hence
the second addition involves addition of three single bits. That
necessitates another type of addition circuit which we will discuss
here. This new type of adder circuit is known as full-adder.
Full-Adder is a logic circuit to add three binary bits. Its outputs
are SUM and CARRY. In the following truth table X, Y, Z are inputs
/ /
and C and S are CARRY & SUM.
/ /
X Y Z CARRY (C ) SUM (S )
0 0 0 0 0
––
0 0 1 0 1 (XYZ)
– –
0 1 0 0 1 (XY Z)
–
0 1 1 1 ((XY Z 0
––
1 0 0 0 1 (XYZ)
–
1 0 1 1 (XYZ) 0
–
1 1 0 1 (XYZ) 0
1 1 1 1 (XYZ) 1 (XYZ)
Truth Table for Full-Adder
Digital Logic 91
Unit 4 Combinational Circuit
92 Digital Logic
Combinational Circuit Unit 4
sum bits are S3S2S1S0 . To build the parallel adder, one full-adder
is required for each pair of corresponding bits in the numbers to
be added, except for the pair of least significant bits, for which a
half-adder is sufficient. But to facilitate cascading the pair of
least significant bits is also added by a full-adder. The carry out
from each stage is taken as the carry into the next more
significant stage. In figure 5.3 we use four full-adder to construct
the 4-bit binary parallel adder where the carry in to the full-adder
for the least significant bits is made logical 0.
4.4.1 Half-Subtractor
94 Digital Logic
Combinational Circuit Unit 4
4.4.2 Full-Subtractor
Digital Logic 95
Unit 4 Combinational Circuit
– – – ––
= (XY + XY) Z + (XY + XY) Z
–
= DZ + DZ .................... (7)
And SOP equation for BORROW is :
–– – – –
B/ = XYZ + XYZ + XYZ + XYZ
–– – – –
= XYZ + XYZ + XYZ + XYZ
–– – –
= (XY + XY) Z + XY (Z + Z)
– –
= DZ + XY .................... (8)
In equation (7) and (8), D stands for DIFFERENCE of half-
subtractor. Now from the equations (7) and (8) we can construct a
full-subtractor using two half-subtractor and an OR gate.
4.5 MULTIPLEXER
Digital Logic 97
Unit 4 Combinational Circuit
Digital Logic 99
Unit 4 Combinational Circuit
FUNCTION GENERATOR
A multiplexer can perform any logic function which otherwise
needs logic gates to implement. It can be connected in a manner
so it duplicates the logic of any truth table. In such application,
the multiplexer is viewed as a function generator. One advantage
of this use of a multiplexer is that a single IC can perform a
function that might need many ICs. Other advantage is that the
implemented function can be easily changed if required due to
changing necessity.
In the design of a function generator using a multiplexer first
the truth table is to construct that is corresponding to the logic
expression to be implemented. The next step is to connect logic
1 to each input of the multiplexer corresponding to each
combination of input variables for which there is 1 in the output
of the truth table. Then to connect logic 0 to all remaining inputs
of the multiplexer. The variables of the truth table are used as
control signals. The application can be best understood by one
example. Here we implement the logic function
f AB ABC BC
4.6 DE-MULTIPLEXER
4.7 ENCODER
In the figure we can see that there are 2n input lines and n –
numbers of output lines. Out of inputs, only one input line is active at a
time. Encoder generates a coded output which is unique for each of the
active input.
4.8 DECODER
Inputs Outputs
A B C Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
A 3 B3 X X X X X X H L L
A 3 B3 X X X X X X L H L
A 3 = B3 A 2 B2 X X X X X H L L
A 3 = B3 A 2 B2 X X X X X L H L
A 3 = B3 A 2 = B2 A1 B1 X X X X H L L
A 3 = B3 A 2 = B2 A1 B1 X X X X L H L
A 3 = B3 A 2 = B2 A 1 = B1 A 0 B0 X X X H L L
A 3 = B3 A 2 = B2 A 1 = B1 A0 B0 X X X L H L
A 3 = B3 A 2 = B2 A 1 = B1 A0 = B0 H L L H L L
A 3 = B3 A 2 = B2 A 1 = B1 A0 = B0 L H L L H L
A 3 = B3 A 2 = B2 A 1 = B1 A0 = B0 L L H L L H
Q.11. An encoder :
(a) converts a digital input to another form of digital output.
(b) converts analog input to digital output
(c) selects one out of many inputs (d) none of these.
Q.12. Decoder has n inputs line and
(a) n output lines (b) 2n output lines.
(c) n 2 output lines (d) no output lines.
Q.13. Magnitude comparator
(a) compares two multi bit binary number
(b) magnify any digital signal
(c) compress binary numbers.
(d) check error in a binary number.
Digital Logic 109
Unit 4 Combinational Circuit
UNIT STRUCTURE
5.2 INTRODUCTION
If the output of a circuit depends on its present inputs and immediate
past output, then the circuit is called sequential circuit. To build a sequential
circuit, we need memory circuits along with some other logic gates. Flip-
Flop is used as memory circuit the application of which we would see in
counter, register etc.
From the previous unit it became evident that a combinational circuit
has no memory element. A combinational circuit has some basic differences
with a sequential circuit. These differences are listed below:
5.3 FLIP-FLOPS
A digital circuit that can produce two states of output, either high or
low is called a multi-vibrator. Multivibrators are further divided into three
types, viz. monostable, bi-stable and astable.
A Flip-Flop is a bi-stable multivibrator and therefore it has two stable
states of output-either high or low. It is a device that can be triggered to
high state or triggered to low state. Depending on its inputs and previous
output, its new output is either high (or 1) or low (or 0). The applied inputs
must be kept in the input terminals of the flip-flop so that the inputs can
affect the output. Once the output is fixed, the inputs can be removed and
then also the already fixed output will be retained by the flip/flop. Hence a
Digital Logic 113
Unit 5 Sequential Circuit
flip-flop can be used as a basic circuit of memory for storing one bit of data.
To store multiple bits we can use multiple flip-flops. Such a set of flip-flops
is called register.
Flip-flop also serves as a fundamental component of another
important digital circuit called counter. This device can keep track of events
that occur in a digital circuit such as the number of pulses that a circuit can
generate in a given time period. It can also divide frequency of a clock
pulse which can lead to a digital clock circuit.
Flip-flops are constructed in a number of way, each type having
specific characteristics necessary for a particular application. Here we
discuss the following types of flip-flops :
RS Flip-flop
D Flip-Flop
JK Flip-Flop
MS Flip-Flop
5.3.1 RS Flip-Flop
Fig. 5.1 : Basic circuit of RS Flip-Flop using NOR and NAND gate
5.3.2 D FLIP-FLOP
5.3.3 JK FLIP-FLOP
(a) (b)
Fig. 5.5 : (a) JK Flip-Flop, (b) Symbol of JK Flip-Flop
CLK J K Q
X 0 0 Last state
0 1 0
1 0 1
1 1 Toggle
5.3.4 MS Flip-Flop
(a) (b)
Fig. 5.8 (a) Edge triggered JK MS Flip-Flop,
(b) Symbol of JK MS Flip-Flop
5.4 COUNTER
When the output of a flip-flop is used as the clock input for the
next flip-flop it is called asynchronous counter.
Asynchronous counters are also called ripple counter because
flip-flop transitions ripple through from one flip-flop to the next in
sequence until all flip-flop reach a new state.
A binary ripple counter can be constructed by using clocked JK
flip-flop. Fig 5.9(a) shows three MS JK flip-flops connected in series.
The clock drives flip-flop A. The output of A drives B and the output
of B drives C. J and K inputs of all the flip-flops are connected to
positive to make them equal to 1. Under this condition each flip-flop
will change state (toggle) with a negative transition at its clock point.
In the counter shown in Fig 5.9 (a), the flip-flop A changes its
state at the negative edges of the clock pulses. Its output is applied
to the B flip-flop as its clock input.
time line, B goes high, at point ‘d’ it goes low, and toggles back high
again at point ‘f’ and so on.
Since B acts as the clock input for C, each time the output of B
goes low, the C flip-flop toggles. Thus C goes high at point ‘d’ on
the time line, it goes back to low again at point ‘h’.
We can see that the output wave form of A has half the frequency
then the clock input wave. B has half the frequency than that of A
and C has half the frequency than that of B.
We can further see that since the counter has 3 flip-flops
cascaded together , it progresses through 000—— 001——010—
011—100—101—110—111 as its CBA output. After CBA= 111,it
starts the cycle again from CBA=000. One cycle from 000—111
takes 8 clock pulses, as it is evident from the wave form as well as
from the truth table.
The AND gate Y is enabled only when both A and B are high
and it transmits the clock pulses to the clock input of the 3rd flip-flop.
The 3 rd flip-flop toggles state with every fourth negative clock
transition at d and h on the time line.
The wave form and the truth table shows that the synchronous
counter progresses upward in a natural binary sequence from 000
to 111. The total count from 000 to 111 is 8 and hence this counter
can also be called MOD-8 counter, in count up mode.
5.5 REGISTER
In this type of shifts register, data entered serially into the register
and once data entry is completed it can be taken out parallely. To
take the data parallely, it is simply required to have the output of
each flip-flop to an output pin. All other constructional features are
same as Serial In—Serial Out (SISO) register.
line is high, the upper AND gate is enabled and the lower AND gate
is disabled. Thus the data will enter at the upper leg of the NOR
gate and at the same time the lower leg of the NOR gate is kept at
ground. Opposite to this, if the control is low, the upper AND gate is
disabled and the lower AND gate is enabled. So will appear at the
lower leg of the NOR gate and during this time the upper leg of the
NOR leg gate is kept at ground level.
If we study the Fig 5.14 of PISO we see that circuit of Fig 5.13
( c ) is repeated 8 times to form the 54/74166 shift register. These
8 circuits are connected in such a style that it allows two operations:
(1) The parallel data entry and (2) shifting of data serially through
the flip-flop from QA toward QB
If Fig 5.14 the X 2 input of Fig 5.13( c ) is taken out from each
flip-flop to form 8 inputs named as ABCDEFGH to enter 8 bit data
parallely to the register. The control is named here as SHIFT/LOAD
which is kept low to load 8 bit data into the flip-flops with a single
clock pulse parallely. If the SHIFT/LOAD is kept high it will enable
the upper AND gate for each flip-flop. If any input is given to this
upper AND gate then a clock pulse will shift a data bit from one flip-
flop to the next flip-flop. That means data will be shifted serially.
Q.7. In SIPO
(a) data enters parallely and leaves serially
(b) data enters serially and leaves serially
(c) data enters serially and leaves parallely
(d) data enters parallely and leaves parallely
UNIT STRUCTURE
6.2 INTRODUCTION
In all the other units of this block we discussed various circuits and
different types of logic gates. In this unit, we are going to discuss the internal
organization of storage device of computer system where these circuits
are associated to transfer data and information time to time. This is the
memory unit, which is a collection of storage cells and circuits. A computer
system uses varieties of storage devices for its different operations and
accordingly the main memory is divided into two main categories: primary
and secondary memory. Here we will discuss mainly about the primary
memory which is accessed directly by the processor. It is mainly based on
integrated circuits.
We will also discuss various types of primary memory, their
classification and use with their organizational structures.
0
1 data out
Row (m x n)
Row decoder Memory
Address
data in matrix
inputs
R/W
(m-1) CS
Column
Column
decoder
decoder
0 1 (n–1)
Column address inputs
X0
X1
m row
address X
2
lines
X3
X4
Y0 Y1 Y2 Y3 Y4
n column address lines
Fig. 6.2 : RAM memory matrix representation
The address and data stored in a specific location of RAM are binary
in form. Data are typically organized into words and each word has n bits.
For k bit address there will be 2k memory locations.
k-bit address 2k memory locations
The simplified RAM chip is represented as:
A0
address
input
Y1
A7 Y2
256 x 4
Static RAM Y3
Data D1 Y4
input D
2
D3
D4
R/W
EN
11-to-
2048
Row 2048X2048 array
Decoder
A10–A0
Column Latches
MUX
D0
Word line
Pass transistor
Capacitor
Bit line
Fig. 6.8: (a) Static RAM cell and (b) dynamic RAM cell
6.5.1 2D Organization
6.5.2 3D Organization
R R
(R/W) (R/W)
T3
T4
T1 T2
‘0’ ‘1’
Y-drive line
T5
X-drive line
Fig. 6.12 : 3 terminal semiconductor memory cell
6.6 ROM
ROM: A semiconductor
Read-only memory (ROM) is a class of storage device used in
memory where can store
computer as well as in other electronic devices. Data stored in ROM cannot information permanently.
Read
Tristate logic
M output lines
ROM
3 input A
lines 8 words x 5 bits
B
F0 F1 F2 F3 F4
Fig. 6.14 : 8 words X 5 bit ROM cell
Since, here there are 3 input lines, the words will form by this ROM
are 23 = 8 words.
ROM access time : Rom access time is the time from the application
of a valid address code on the address inputs until the appearance of valid
output data. It can also be measured from the activation of chip select to
the occurrence of valid output data when a valid address is already on the
inputs. Following figure shows the ROM access time.
Address transition
ta
Data Valid data
outputs on outputs
CS
Chip Select
In the above ROM chip, the fixed “AND” array is a “decoder” with 3-
inputs and 8-outputs that implementing minterms. The programmable “OR”
array uses a single line to represent all inputs to an OR gate. An “X” in the
array corresponds to attaching the minterm to the OR. In read mode for
input (A2,A1,A0) = 011, the output is (F3,F2,F1,F0 ) = 0011.
ROM
Bipolar MOS
is done by manufacturer during the last fabrication process of the unit; the
second type is programmable read only memory (PROM).
Mask ROM : It is programmed at the time of manufacturing
according to customer’s requirements. Once the memory is programmed,
it cannot be changed. Most IC ROMs utilize the presence or absence of a
transistor connection at ROW or COLUMN junction to represent 1 or 0.
The 1s and 0s are obtained by providing a mask in the last fabrication step.
A photographic negative called a mask is used to control the electrical
interconnections on the chip.
Column Column
Row Row
+Vcc +Vcc
Storing 1 Storing 0
Fig. 6.18 : Bipolar ROM cell
In bipolar ROM cell, when Row line is taken high, all transistors
with base connection to the Row line turn ON and connect the HIGH to the
associated column lines. So, the presence of a connection from a Row line
to the base of a transistor represents a ‘1’ at that location. When there are
no base connections at row or column junctions, the column lines remain
LOW and represents as ‘0’.
In MOS ROM cell the presence or absence of a gate of MOSFET
connection at junction stores 1 or 0 permanently. Manufacturer makes the
corresponding musk for the path of bipolar or for MOS ROM cell to produce
the 1s or 0s according to specified customer’s truth table. This process is
called custom or mask programming. Mask programmed ROM are
economical only if large quantities of the same ROM configuration are to
be manufactured.
The following figure illustrates the function of MOS ROM cell.
Column Column
Storing 1 Storing 0
Fig. 6.19 : MOS ROM cell
In MOS ROM cell the presence or absence of a gate of MOSFET
connection at junction stores 1 or 0 permanently. Manufacturer makes the
corresponding musk for the path of bipolar or for MOS ROM cell to produce
the 1s or 0s according to specified customer’s truth table. This process is
called custom or mask programming. Mask programmed ROM are
economical only if large quantities of the same ROM configuration are to
be manufactured.
A major disadvantage of this type is the fact that it cannot be
reprogrammed in the event of the design change or cannot do any
modification of the stored program. Vendors are trying to overcome this
problem by developing several program on this connection.
Programmable Read-only Memory (PROM) : In order to provide
flexibility in some ROM applications, programmable ROM has been
introduced. Blank PROM chips can be bought inexpensively and coded by
anyone with a special tool called a programmer. But it cannot be
reprogrammed. It is manufactured as a generalized integrated circuit with
all matrix intersections and every intersection has a fuse connecting them.
The higher voltage breaks the connection between the column and row by
burning out the fuse and can thereby program the PROM according to the
required truth table. This process is known as burning the PROM. Once a
PROM is programmed, it cannot be changed and therefore it has to be
done carefully and correctly in the first time itself. Hence, the fusing process
is irreversible. PROMs are widely used in the control of electrical equipment
such as washing machines and electric oven.
SiO2 SiO2
n+ n+ Gate
Source Drain
p-substrate
Floating gate Source
(a) Structure (b) Symbol
Fig. 6.20 : EPROM cell
Here an additional floating gate is formed within the silicon dioxide (SiO2)
layer. The floating gate is left encountered while the normal control gate is
connected to the row decoder output of EPROM. The data bits are
represented by the presence or absence of a stored charge. The initial
values of un-programmed EPROM cells may be all 0s or all 1s.
Disadvantages :
Row 1
1
0
1 2 Row 2
2 .
3 .
4 bit .
addr .
14
Row 14
Row 15
15
0 1 2 . . . . . .6 7
Data output
Fig. 6.21 : A 16 x 8-bit ROM array
Here ROM is organized into 16 addresses, each of which stores 8
data bits. The total capacity of this ROM is 128 bits. The dark squares
represents that ROM stored 1s by base connected transistor or gate-
connected MOSFET and light squares represent 0s. When a 4 bit binary
address is applied to the address inputs, the corresponding row line
becomes HIGH. This HIGH is connected to the column line through
transistors at each junction where 1 is stored. The column line stays LOW
at each cell where 0 is stored because of the terminating resistor. The
column lines form the data output. Thus, the eight data bits stored in the
selected ROW appear on the output lines.
Ans. to Q. No. 1 : a
Ans. to Q. No. 2 : a
Ans. to Q. No. 3 : a) Volatile, b) DRAM, c) charged, d) MOSFET,
e) 6 (six), f) SRAM, g) 2n, h) MOSFET , i) SRAM,
j) 1973
Ans. to Q. No. 4 : a) T, b) F, c) T, d) F, e) T
Ans. to Q. No. 5 : a) Boot, b) distributed system, c) SRAM, d) Decoders,
e) mask programming, f) electrical interconnections,
g) 0 (zero), h)PROMs, i) two, j) UV light.
Ans. to Q. No. 6 : a) T, b) F, c) T, d) F, e) T