DLD Notes
DLD Notes
One characteristic of digital systems is their ability to represent and manipulate discrete
elements of information. Any set that is restricted to a finite number of elements contains
discrete information. Examples of discrete sets are the 10 decimal digits, the 26 letters of the
alphabet, the 52 playing cards, and the 64 squares of a chessboard. Early digital computers were
used for numeric computations.
ub
Discrete elements of information are represented in a digital system by physical
quantities called signals. Electrical signals such as voltages and currents are the most common.
Electronic devices called transistors predominate in the circuitry that implements these signals.
The signals in most present‐day electronic digital systems use just two discrete values and are
therefore said to be binary. A binary digit, called a bit, has two values: 0 and 1. Discrete
uh
elements of information are represented with groups of bits called binary codes. For example, the
decimal digits 0 through 9 are represented in a digital system with a code of four bits (e.g., the
number 7 is represented by 0111).
ed
A digital system can understand positional number system only where there are only a few
symbols called digits and these symbols represent different values depending on the position
they occupy in the number.
The number system that we use in our day-to-day life is the decimal number system. Decimal
number system has base 10 as it uses 10 digits from 0 to 9. In decimal number system, the
successive positions to the left of the decimal point represent units, tens, hundreds, thousands
and so on.
= 1000 + 200 + 30 + 1
= 1234
ub
Octal Number System
2
Base 8. Digits used: 0 to 7
Hexa Decimal Number System
3
Base 16. Digits used: 0 to 9, Letters used: A- F
uh
Binary Number System
Characteristics
ed
Example
Example
ub
Calculating Decimal Equivalent:
Example
ub
Decimal to Other Base System
Other Base System to Decimal
Other Base System to Non-Decimal
Shortcut method - Binary to Octal
Shortcut method - Octal to Binary
uh
Shortcut method - Binary to Hexadecimal
Shortcut method - Hexadecimal to Binary
Step 1 - Divide the decimal number to be converted by the value of the new base.
Step 2 - Get the remainder from Step 1 as the rightmost digit (least significant digit) of new
base number.
Step 3 - Divide the quotient of the previous divide by the new base.
ts
Step 4 - Record the remainder from Step 3 as the next digit (to the left) of the new base
number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in
Step 3.
The last remainder thus obtained will be the most significant digit (MSD) of the new base
number.
Example
As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that
the first remainder becomes the least significant digit (LSD) and the last remainder becomes the
most significant digit (MSD).
ub
Step 1 - Determine the column (positional) value of each digit (this depends on the position
of the digit and the base of the number system).
Step 2 - Multiply the obtained column values (in Step 1) by the digits in the corresponding
columns.
Step 3 - Sum the products calculated in Step 2. The total is the equivalent value in decimal.
uh
Example
ub
Step 3 5/2 2 1
Step 4 2/2 1 0
Step 5 1/2 0 1
Step 1 - Divide the binary digits into groups of three (starting from the right).
Step 2 - Convert each group of three binary digits to one octal digit.
Example
ts
Step 1 - Convert each octal digit to a 3 digit binary number (the octal digits may be treated as
decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 3 digits each) into a single binary
number.
Example
ub
Step 1 258 210 510
Step 2 258 0102 1012
Step 3 258 0101012
uh
Octal Number: 258 = Binary Number: 101012
Step 1 - Divide the binary digits into groups of four (starting from the right).
Step 2 - Convert each group of four binary digits to one hexadecimal symbol.
Example
ts
Step 1 - Convert each hexadecimal digit to a 4 digit binary number (the hexadecimal
digits may be treated as decimal for this conversion).
Step 2 - Combine all the resulting binary groups (of 4 digits each) into a single binary
number.
Example
ub
Step 2 1516 00012 01012
Step 3 1516 000101012
In fourth case, a binary addition is creating a sum of (1+1=10) i.e. 0 is write in the given column
and a carry of 1 over to the next column.
Example - Addition
Subtraction and Borrow, these two words will be used very frequently for the binary
subtraction. There four rules of the binary substation.
Example - Subtraction
ub
uh
ed
Binary Multiplication
Binary multiplication is similar to decimal multiplication. It is simpler than decimal
multiplication because only 0s and 1s are involved. There four rules of the binary multiplication.
ts
Binary Division
Binary division is similar to decimal division. It is called as the long division procedure.
ub
Example - Division
uh
ed
ts
1.5 COMPLEMENTS
Complements are used in the digital computers in order to simplify the subtraction operation and
for the logical manipulations. For each radix-r system (radix r represent base of number system)
there are two types of complements
Example2:
ub
uh
ed
Example3:
ts
ub
uh
1.6 SIGNED BINARY NUMBERS
Positive integers (including zero) can be represented as unsigned numbers. However, to represent
negative integers, we need a notation for negative values. In ordinary arithmetic, a negative
ed
number is indicated by a minus sign and a positive number by a plus sign. Because of hardware
limitations, computers must represent everything with binary digits. It is customary to represent
the sign with a bit placed in the leftmost position of the number. The convention is to make the
sign bit 0 for positive and 1 for negative.
ts
As an example, consider the number 9, represented in binary with eight bits. +9 is represented
with a sign bit of 0 in the leftmost position, followed by the binary equivalent of 9, which gives
00001001. Note that all eight bits must have a value; therefore, 0’s are inserted following the
sign bit up to the first 1. Although there is only one way to represent +9, there are three different
ways to represent -9 with eight bits:
In signed‐magnitude, -9 is obtained from +9 by changing only the sign bit in the leftmost
position from 0 to 1. In signed‐1’s-complement, -9 is obtained by complementing all the bits of
+9, including the sign bit. The signed‐2’s‐complement representation of -9 is obtained by taking
the 2’s complement of the positive number, including the sign bit.
The addition of two numbers in the signed‐magnitude system follows the rules of ordinary
ed
arithmetic. If the signs are the same, we add the two magnitudes and give the sum the common
sign. If the signs are different, we subtract the smaller magnitude from the larger and give the
difference the sign of the larger magnitude. For example, (+25) + (-37) = -(37 - 25) = -12 is done
by subtracting the smaller magnitude, 25, from the larger magnitude, 37, and appending the sign
of 37 to the result. This is a process that requires a comparison of the signs and magnitudes and
ts
then performing either addition or subtraction. The same procedure applies to binary numbers in
signed‐magnitude representation. In contrast, the rule for adding numbers in the
signed‐complement system does not require a comparison or subtraction, but only addition. The
procedure is very simple and can be stated as follows for binary numbers:
The addition of two signed binary numbers with negative numbers represented in signed-
2’s-complement form is obtained from the addition of the two numbers, including their
sign bits. A carry out of the sign-bit position is discarded.
In each of the four cases, the operation performed is addition with the sign bit included. Any
carry out of the sign‐bit position is discarded, and negative results are automatically in
2’s‐complement form.
ub
To determine the value of a negative number in signed‐2’s complement, it is necessary to convert
the number to a positive number to place it in a more familiar form. For example, the signed
binary number 11111001 is negative because the leftmost bit is 1. Its 2’s complement is
uh
00000111, which is the binary equivalent of +7. We therefore recognize the original negative
number to be equal to -7.
Arithmetic Subtraction
ed
Subtraction of two signed binary numbers when negative numbers are in 2’s‐complement form is
simple and can be stated as follows:
Take the 2’s complement of the subtrahend (including the sign bit) and add it to the
minuend (including the sign bit). A carry out of the sign‐bit position is discarded.
ts
But changing a positive number to a negative number is easily done by taking the 2’s
complement of the positive number. The reverse is also true, because the complement of a
negative number in complement form produces the equivalent positive number. To see this,
consider the subtraction (-6) - (-13) = +7. In binary with eight bits, this operation is written as
(11111010 - 11110011). The subtraction is changed to addition by taking the 2’s complement of
the subtrahend (-13), giving (+13). In binary, this is 11111010 + 00001101 = 100000111.
Removing the end carry, we obtain the correct answer: 00000111 (+7).
Example:
A decimal +12.34 in a typical floating-point notation is 12.34=0.1234 * 102
ub
uh
This number in any of the above form (if represented in BCD) requires 17 bits for mantissa (1 for
sign and 4 each decimal digit as BCD) and 9 bits for exponent (1 for sign and 4 for each decimal
digit as BCD). Exponent indicates the correct decimal location. In the first case where exponent
is +2, indicates that actual position of the decimal point is 2 places to the right of the assumed
ed
position, while exponent –2 indicates that the assumed position of the point is 2 places towards
the left of assumed position. The assumption of the position of the point is normally the same in
a computer resulting in a consistent computational environment.
Floating-point numbers are often represented in normalized form. A floating-point number
whose mantissa does not contain zero as the most significant digit of the number is considered to
ts
be in a normalized form. For example, a BCD mantissa +370 which is 0 0011 0111 000 is in
normalized form because these leading zero’s are nor part of a 0 digit. On the other hand a binary
number 0 01100 is not in a normalized form. The normalized form of this number will be
0 1100
Arithmetic operations involved with floating point numbers are more complex in nature, takes
longer time for execution and require complex hardware. Yet the floating point representation is
a must as it is useful in scientific calculations. Real numbers are normally represented as floating
point numbers.
ub
Weighted Codes
Non-Weighted Codes
Binary Coded Decimal Code
Alphanumeric Codes
uh
Error Detecting Codes
Error Correcting Codes
Weighted Codes
ed
Weighted binary codes are those binary codes which obey the positional weight principle. Each
position of the number represents a specific weight. Several systems of the codes are used to
express the decimal digits 0 through 9. In these codes each decimal digit is represented by a
group of four bits.
ts
Non-Weighted Codes
In this type of binary codes, the positional weights are not assigned. The examples of non-
weighted codes are Excess-3 code and Gray code.
The Excess-3 code is also called as XS-3 code. It is non-weighted code used to express decimal
numbers. The Excess-3 code words are derived from the 8421 BCD code words adding (0011)2
or (3)10 to each code word in 8421. The excess-3 codes are obtained as follows
Example
ub
uh
ed
Gray Code
ts
It is the non-weighted code and it is not arithmetic codes. That means there are no specific
weights assigned to the bit position. It has a very special feature that has only one bit will
change, each time the decimal number is incremented as shown in fig. As only one bit changes at
a time, the gray code is called as a unit distance code. The gray code is a cyclic code. Gray code
cannot be used for arithmetic operation.
In this code each decimal digit is represented by a 4-bit binary number. BCD is a way to express
each of the decimal digits with a binary code. In the BCD, with four bits we can represent sixteen
ed
numbers (0000 to 1111). But in BCD code only first ten of these are used (0000 to 1001). The
remaining six code combinations i.e. 1010 to 1111 are invalid in BCD.
ts
Alphanumeric codes
A binary digit or bit can represent only two symbols as it has only two states '0' or '1'. But this is
not enough for communication between two computers because there we need many more
symbols for communication. These symbols are required to represent 26 alphabets with capital
and small letters, numbers from 0 to 9, punctuation marks and other symbols.
The alphanumeric codes are the codes that represent numbers and alphabetic characters. Mostly
such codes also represent other characters such as symbol and various instructions necessary for
conveying information. An alphanumeric code should at least represent 10 digits and 26 letters
of alphabet i.e. total 36 items. The following three alphanumeric codes are very commonly used
for the data representation.
ub
American Standard Code for Information Interchange (ASCII).
Extended Binary Coded Decimal Interchange Code (EBCDIC).
Five bit Baudot Code.
uh
ASCII code is a 7-bit code whereas EBCDIC is an 8-bit code. ASCII code is more commonly
used worldwide while EBCDIC is used primarily in large IBM computers.
There are many methods or techniques which can be used to convert code from one format to
another. We'll demonstrate here the following
Calculating BCD Equivalent. Convert each digit into groups of four binary digits equivalent.
ub
Step Decimal Number Conversion
Step 1 2910 00102 10012
Step 2 2910 00101001BCD
uh
Result
(11101)2 = (00101001)BCD
Calculating Decimal Equivalent. Convert each four digit into a group and get decimal equivalent
or each group.
ub
Step 5 1/2 0 1
As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that
the first remainder becomes the least significant digit (LSD) and the last remainder becomes the
most significant digit (MSD).
uh
Decimal Number: 2910 = Binary Number: 111012
Result
ed
(00101001)BCD = (11101)2
BCD to Excess-3
ts
(1001)BCD = 910
(12)10 = (1100)2
Result
(1001)BCD = (1100)XS-3
Steps
Step 1 -- Subtract (0011)2 from each 4 bit of excess-3 digit to obtain the corresponding
BCD code.
ub
Given XS-3 number = 1001 1010
BCD = 0 1 1 0 0 1 1 1
Result
ed
(10011010)XS-3 = (01100111)BCD
BOOLE is one of the persons in a long historical chain who were concerned with formalizing
and mechanizing the process of logical thinking.
BOOLEAN ALGEBRA is a generalization of set algebra and the algebra of propositions.
Boolean algebra is a tool for studying and applying logic.
. We learn how Boolean algebra is used to construct and simplify electric circuits. Switching
circuits, which are used in the design of computer chips, are introduced with a discussion of the
techniques needed to simplify their design.
. We also show how a purely algebraic approach to some parts of logic is possible by using
BOOLEAN Algebras and how this technique can also be used to study set theory.
Boolean algebra is an algebraic structure defined on a set of elements is together with two binary
operations, the product (or meet) and the sum (or join) provided the following
Huntington postulates are satisfied:
ub
b. Commutative with respect to .
x. y = y. x
4. a. . is distributive over +
x.(y + z) = x.y + x.z
uh
b. + is distributive over .
x + (y.z) = (x + y).(x + z)
5. For every element x B, there exists an element x' B (complement of x) such that:
a. x + x' = 1
ed
b. x . x' = 0
A two valued Boolean algebra is defined on a set of two elements, B = {0, 1}, with rules for the
two binary operators + and .
x y xy
0 0 0
0 1 0
1 0 0
1 1 1
x y x+y
0 0 0
0 1 1
1 0 1
TSEDUHUB EXCLUSIVE Page 28
1 1 1
x x'
0 1
1 0
These rules are exactly the same as the AND, OR, & NOT operations, respectively.
Now show that the Huntington postulates are valid for the set B = {0, 1} and the two binary
operators defined above.
1. Closure
The result of each operation is 1 or 0 and 1, 0 B.
ub
An identity element with respect to . is 1,
since 1.1 = 1
1.0 = 0.1 = 0
3. Commutative law
uh
0 + 1 = 1 + 0 = 1 ( for + )
0 . 1 = 1 . 0 = 0 ( for . )
4. Distributive law
a. . is distributive over + : x. ( y + z ) = x.y + x.z
ed
b. + is distributive over . : x + ( y. z) = (x + y) . (x + z)
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
a. x + x = x
proof:
ub
x+x = (x+x).1 by postulate (2b)
= ( x + x ) (x + x')
= (x + xx')
= x+0
= x
uh
b. x . x = x
proof:
ed
x.x = x. x + 0
= x . x + x . x'
= x (x + x')
= x.1
ts
= x
Theorem 2:
a. x + 1 = 1
proof:
x+1 = 1 . ( x + 1)
= ( x + x' )( x + 1)
= x + x' . 1
= x + x'
= 1
b. x.0 = 0 by duality
(x')' = x
Theorem 4:
a. x + ( y + z ) = (x+y)+z associative
b. x ( yz ) = ( xy ) z associative
Theorem 5: ( De Morgan )
proof:
ub
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
uh
1 1 1 0 0 0 0
Theorem 6: (Absorption)
a. x + xy = x
ed
proof:
= 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)
b. x ( x + y ) = x
proof:
x y xy x+xy
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
Example:
ub
F1 = xyz'
F1 = 1 if x = 1 and y = 1 and z' = 1;
Otherwise F1 = 0
F2 = x + y'z
ed
F2 = 1 if x = 1 or if y = 0, while z = 1
F4 = xy' + x'z
x y z F1 F2 F3 F4
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 1 1 1
1 0 1 0 1 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 0
Example:
Simplify the boolean functions to a minimum number of literals.
2. x ( x' + y ) = xx' + xy = 0 + xy = xy
ub
5. ( x + y ) ( x'z ) ( y + z ) = ( x + y ) ( x' + z )
Complement of a Function:
uh
( A + B + C )' = ( A + X )' let B + C = X
= A' X ' De Morgan thm 5a
= A' (B + C)'
= A’. (B’ C’) De Morgan thm. 5a
= A ' B ' C’
ed
Example:
Example:
Find the complement of the functions F1 and F2 by taking their duals and complementing each
literal.
F2 = x ( y' z' + yz )
A binary variable may appear in its normal form(x) or in its complement form ( x' )
Two binary variables x and y combined with an AND operation.
ub
x'y
xy'
xy
Each of these terms are called MINTERM (Standard Product)
uh
n variables can be combined to form 2n minterms.
Each minterm is obtained from an AND term of the n variables, with each variable being
primed if the corresponding bit of the binary number is a 0 and unprimed if a 1.
ed
n variables forming an OR term, with each variable being primed or unprimed, provide
2n possible combinations, called MAXTERMS ( or Standard sums )
Each MAXTERM is obtained from an OR term of the n variables, with each variable
ts
MINTERMS MAXTERMS
x y z Term Designation Term Designation
0 0 0 x' y' z' m0 x+y+z M0
0 0 1 x' y' z m1 x + y + z' M1
0 1 0 x' y z' m2 x + y' + z M2
0 1 1 x' y z m3 x + y' + z' M3
1 0 0 x y' z' m4 x' + y + z M4
1 0 1 x y' z m5 x' + y + z' M5
1 1 0 x y z' m6 x' + y' + z M6
1 1 1 xyz m7 x' + y' + z' M7
EXAMPLE:
x y z function f1 function f2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
ub
1 1 1 1 1
The function f1 is determined by expressing the combinations 001, 100, 111, as x'y'z, xy'z, xy'z',
xyz.
Since each one of these minterms results in f1 = 1.
uh
f1 = x'y'z + xy'z' + xyz = m1 + m4 + m7
f2 = x'yz + xy'z + xyz' + xyz = m3 + m5 + m6 +m7
NOTE 1: Any boolean function can be expressed as a sum of minterms. (SUM - ORing of
terms)
ed
Complement:
Read from the truth table by forming a MINTERM for each combination that produces a 0 in the
ts
Procedure for obtaining the product of MAXTERMs from the truth table is:
* Form a maxterm for each combination of the variables which produces a 0 in the function.
TSEDUHUB EXCLUSIVE Page 35
* Form the AND of all those maxterms.
SUM OF MINTERMS
Example:
Express F = A + B'C as a sum of minterms.
F = A + B'C
ub
= A ( B + B' ) + ( A + A' )B'C
= AB + AB' + AB'C + A'B'C
Note the terms AB and AB' are still lack the variable C, we will expand them by ( C + C ')
= AB ( C + C' ) + AB' ( C + C ' ) + AB'C + A'B'C
= ABC + ABC' + AB'C + AB'C ' + AB'C + A'B'C
uh
= ABC + ABC' + AB'C + AB'C ' + A'B'C
= m7 + m6 + m5 + m4 +m1
= ∑ ( 1, 4, 5, 6, 7 )
PRODUCT OF MAXTERMS
ed
To express the boolean function as a product of MAXTERMs it must first, be brought into a
form of OR terms. This may be done by using the distributive law:
x + yz = ( x + y ) ( x + z )
ts
EXAMPLE:
F = ( xy + x'z )
= ( x' + xy ) ( z + xy )
= ( x' + x ) ( x' + y ) ( z + x ) ( z + y )
= ( 1 ) ( x' + y ) ( x + z ) ( y + z )
= ( x' + y + zz' ) ( x + z + yy' ) ( y + z + xx' )
= (x'+y+z) (x'+y+z') (x+z+y) (x+z+y') (y+z+x) (y+z+x')
= Reduce the terms which appear twice
= (x' + y + z) (x' + y + z') (x + z + y') (x + z + y')
F = π ( 0, 2, 4, 5 )
If we take the complement of F ' by the De Morgan's theorem, we obtain F in a different form:
m'j = Mj
ub
. interchange the symbols and
. list those numbers missing from the original form.
EXAMPLE:
uh
F ( x, y, z ) = π( 0, 2, 4, 5 ) is expressed in the product of MAXTERM form.
It's conversion to sum of MINTERMS is:
F ( x, y, z ) = ∑( 1, 3, 6, 7 )
ed
STANDARD FORMS
Another way to express Boolean function is in standard forms. There are two types of standard
forms:
ts
The SUM of PRODUCTs is a boolean expression containing AND terms, called PRODUCT
terms, of one or more literals each.
The SUM denotes the OR ing of these terms.
Example:
F1 = y' + xy + x'yz'
ub
1.14 LOGIC GATES
Logic gates are the basic building blocks of any digital system. It is an electronic circuit having
one or more than one input and only one output. The relationship between the input and the
uh
output is based on certain logic. Based on this logic gates are named as AND gate, OR gate,
NOT gate etc.
The graphic symbols and truth tables of the eight gates are shown in Fig. 2.5. Each gate
has one or two binary input variables, designated by x and y, and one binary output variable,
ed
designated by F. The AND, OR, and inverter circuits were defined in Fig. 1.6. The inverter
circuit inverts the logic sense of a binary variable, producing the NOT, or complement, function.
The small circle in the output of the graphic symbol of an inverter (referred to as a bubble)
designates the logic complement. The triangle symbol by itself designates a buffer circuit. A
ts
buffer produces the transfer function, but does not produce a logic operation, since the binary
value of the output is equal to the binary value of the input. This circuit is used for power
amplification of the signal and is equivalent to two inverters connected in cascade.
An error‐correcting code generates multiple parity check bits that are stored with the data
word in memory. Each check bit is a parity over a group of bits in the data word. When the word
is read back from memory, the associated parity bits are also read from memory and compared
with a new set of check bits generated from the data that have been read. If the check bits are
correct, no error has occurred. If the check bits do not match the stored parity, they generate a
unique pattern, called a syndrome, that can be used to identify the bit that is in error. A single
ub
error occurs when a bit changes in value from 1 to 0 or from 0 to 1 during the write or read
operation. If the specific bit in error is identified, then the error can be corrected by
complementing the erroneous bit.
uh
ed
ts
The map method provides a simple, straightforward procedure for minimizing Boolean
functions. This method may be regarded as a pictorial form of a truth table. The map method is
also known as the Karnaugh map or K-map.
A K-map is a diagram made up of squares, with each square representing one minterm of
the function that is to be minimized. Since any Boolean function can be expressed as a sum of
minterms, it follows that a Boolean function is recognized graphically in the map from the area
enclosed by those squares whose minterms are included in the function. In fact, the map presents
a visual diagram of all possible ways a function may be expressed in standard form. By
recognizing various patterns, the user can derive alternative algebraic expressions for the same
function, from which the simplest can be selected.
ub
The simplified expressions produced by the map are always in one of the two standard
forms: sum of products or product of sums. It will be assumed that the simplest algebraic
expression is an algebraic expression with a minimum number of terms and with the smallest
possible number of literals in each term. This expression produces a circuit diagram with a
minimum number of gates and the minimum number of inputs to each gate.
uh
Rules of Simplifying Karnaugh Map
The expression for output Y can be simplified by properly combining those squares in the K-
Map which contain 1s. The process of combining those 1s is called looping.
Any adjacent pair of cells marked by a 1 in a K-Map can be combined into one term and one
variable is eliminated which is changing i.e. from A to A’ or B’ to B etc.
Any single logical 1 on the map represents AND function. The total expression corresponding to
the logical 1s of a map are the OR function (sum) of the various variable terms, which covers all
the logical 1 in the map.
ub
Octet – Lopping groups of Eight 1s
A group of eight 1s that are adjacent to each other is called an octet. When an octet is looped in a
four variable map, 3 of 4 variables are eliminated because only one variable remains unchanged.
uh
There are few tips to remember while simplifying K-Map:
Biggest decimal number in the given function decides which K-Map is to be used. For
instance, a single variable can define only two decimal values 0 and 1, with maximum
ed
value as 1. Two variables can define 22 =4 values, 0, 1, 2 and 3, with maximum value as 3.
So if a given function has 4 as the biggest decimal number, it can not be defined by two
variables. We need to use 3 variables because by using 3 variables, we can have 23 = 8
decimal values with 7 as the maximum value.
ts
We should try to cover all 1′s even if they become part of more than 1 loop.
We look for the biggest loop at first. So if a K-Map has an Octet, it should be circled first,
followed by quads if any, followed by pairs if any.
Pair eliminates 1 variable, Quad eliminates 2 variables and an Octet eliminates
3 variables.
While looping, we can visualize folding the K-Map like a paper and can loop 1′s present
in left most and right most columns of the same row.
We can also visualize overlapping K-Map in case of 5 and 6 variable K-Maps.
We can fold and overlap the K-Map only in horizontal and vertical direction but not in
diagonal.
A 3-variable K-Map will have 23 = 8 cells. As told in last post, number of variables are decided
by the biggest decimal number in a given function. A function F which has maximum decimal
value of 7 can be defined and simplified by a 3-variable Karnaugh Map.
3-Variable K-Map
ub
uh
ed
Carefully note how cells are numbered in above diagram. A first cell is denoted by 0, second by
ts
1 and then third by 3 and not by 2. This is because, A’BC (ANDing of first row A’ and third
column BC) corresponds to decimal number 3 in the boolean table. Similarly, second row, third
column ABC is denoted by 7 and not by 6.
Now, let’s understand how to simplify 3-variables K-Map by taking couple of examples.
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells. You don’t necessarily need to write 0s but it is okay to have them.
ub
(4, 5) – AB’ (Since C is the changing variable, it is eliminated)
A 4-variable K-Map will have 24 = 16 cells. A function F which has maximum decimal value of
15 can be defined and simplified by a 4-variable Karnaugh Map.
ed
4-variable K-Map
ts
Applying rules of simplifying K-Map, there are no Octets and Quads. There are 3 pairs, circled
ub
in red.
(0, 4) – A’C'D’ (Since B is the changing variable between these two cells, it is eliminated)
There is 1 in cell 15, which can not be looped with any adjacent cell, hence it can not be
ed
15 = ABCD
ts
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells.
ub
(9, 11, 13, 15) – AD (Since B and C are changing variables, they are eliminated)
There is 1 in cell 6, which can not be looped with any adjacent cell, hence it can not be
simplified further and left as it is.
6 = A’BCD’
ts
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells.
ub
(2, 3) – A’B'C (Since D is the changing variable, it is eliminated)
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
ts
of the cells.
(6, 7, 14, 15) – BC (Since A and D are changing variables, they are eliminated)
There is 1 in cell 9, which can not be looped with any adjacent cell, hence it can not be
simplified further and left as it is.
9 – AB’C'D
5-Variable K-Map
ub
uh
A 5-variable K-Map will have 25 = 32 cells. A function F which has maximum decimal value of
31, can be defined and simplified by a 5-variable Karnaugh Map.
ed
5-Variable K-Map
In above boolean table, from 0 to 15, A is 0 and from 16 to 31, A is 1. A 5-variable K-Map is
drawn as below.
ts
Now, we have two squares and we can loop octets, quads and pairs between these two squares.
What we need to do is to visualize second square on first square and figure out adjacent cells.
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells.
ub
Applying rules of simplifying K-Map, there is no octet. There is one quad that is obtained by
uh
visualizing second square on first, there are 4 adjacent cells – 4,5,20 and 21. The octet is
highlighted by a blue connecting line. There are 5 pairs. Similar to quad, there is one pair
between two squares which is highlighted by the blue connecting line.
ed
(4, 5, 20, 21) – B’CD’ (Since A & E are the changing variables, it is eliminated)
Given function, F = Σ (0, 2, 3, 5, 7, 8, 11, 13, 17, 19, 23, 24, 29, 30)
Since, the biggest number is 30, we need to have 5 variables to define this function.
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells.
ub
uh
Applying rules of simplifying K-Map, there is no octet. First we need to look for quads within
each of the squares. There are none but there is a quad between two squares that is obtained by
visualizing second square on first, there are 4 adjacent cells – 3, 7, 19 and 23. This quad is
ed
highlighted by blue connecting line. There are 6 pairs, out of which two are between two
squares, highlighted by blue connecting line.
(3, 7, 19, 23) - B’DE (Since A & C are the changing variables, they are eliminated)
ts
30 – ABCDE’
Let’s draw K-Map for this function by writing 1 in cells that are present in function and 0 in rest
of the cells.
ub
uh
ed
Applying rules of simplifying K-Map, there are 2 octets. First one is in square 2 circled in red.
Another octet is between 2 squares highlighted by blue connecting lines. There are 2 quads
ts
(0, 1, 8, 9, 16, 17, 24, 25) – C’D’ (Since A, B and E are changing variables, they are eliminated)
(0, 1, 2, 3) – A’B'C’ (Since D and E are changing variables, they are eliminated)
(28, 29, 30, 31) – ABC (Since D and E are changing variables, they are eliminated)
ub
uh
ed
ts
ub
DON'T-CARE CONDITIONS
In some applications the function is not specified for certain combinations of the variables. As an
example, the four-bit binary code for the decimal digits has six combinations that are not used
uh
and consequently are considered to be unspecified. Functions that have unspecified outputs for
some input combinations are called incompletely specified functions. In most applications, we
simply don’t care what value is assumed by the function for the unspecified minterms. For this
reason, it is customary to call the unspecified minterms of a function don’t-care conditions.
These don’t-care conditions can be used on a map to provide further simplification of the
ed
Boolean expression.
A don’t-care minterm is a combination of variables whose logical value is not specified.
Such a minterm cannot be marked with a 1 in the map, because it would require that the function
always be a 1 for such a combination. Likewise, putting a 0 on the square requires the function to
ts
be 0. To distinguish the don’t-care condition from 1’s and 0’s, an X is used. Thus, an X inside a
square in the map indicates that we don’t care whether the value of 0 or 1 is assigned to F for the
particular minterm.
In choosing adjacent squares to simplify the function in a map, the don’t-care minterms
may be assumed to be either 0 or 1. When simplifying the function, we can choose to include
each don’t-care minterm with either the 1’s or the 0’s, depending on which combination gives
the simplest expression.
NAND Circuits
The NAND gate is said to be a universal gate because any logic circuit can be implemented with
it. To show that any Boolean function can be implemented with NAND gates, we need only
show that the logical operations of AND, OR, and complement can be obtained with NAND
gates alone. The complement operation is obtained from a one-input NAND gate that behaves
exactly like an inverter. The AND operation requires two NAND gates. The first produces the
ub
NAND operation and the second inverts the logical sense of the signal. The OR operation is
achieved through a NAND gate with additional inverters in each input.
uh
ed
A convenient way to implement a Boolean function with NAND gates is to obtain the
simplified Boolean function in terms of Boolean operators and then convert the function to
NAND logic. The conversion of an algebraic expression from AND, OR, and complement to
ts
NAND can be done by simple circuit manipulation techniques that change AND–OR diagrams
to NAND diagrams.
To facilitate the conversion to NAND logic, it is convenient to define an alternative
graphic symbol for the gate. Two equivalent graphic symbols for the NAND gate are shown
below.
The implementation of Boolean functions with NAND gates requires that the functions be
in sum-of-products form. To see the relationship between a sum-of-products expression and its
equivalent NAND implementation, consider the logic diagrams drawn in the below figure. All
three diagrams are equivalent and implement the function
F = AB + CD
The function is implemented in Fig (a) with AND and OR gates. In Fig (b), the AND
gates are replaced by NAND gates and the OR gate is replaced by a NAND gate with an OR-
invert graphic symbol. Remember that a bubble denotes complementation and two bubbles along
the same line represent double complementation, so both can be removed. Removing the bubbles
on the gates of (b) produces the circuit of (a). Therefore, the two diagrams implement the same
function and are equivalent.
In Fig(c), the output NAND gate is redrawn with the AND-invert graphic symbol. In
drawing NAND logic diagrams, the circuit shown in either Fig (b) or (c) is acceptable. The one
in Fig (b) is in mixed notation and represents a more direct relationship to the Boolean
ub
expression it implements. The NAND implementation in Fig(c) can be verified algebraically.
The function it implements can easily be converted to sum- of-products form by DeMorgan’s
theorem:
uh
ed
ts
AM
ub
uh
ed
ts
3.
Multilevel NAND Circuits
The standard form of expressing Boolean functions results in a two-level implementation. There
are occasions, however, when the design of digital systems results in gating structures with three
or more levels. The most common procedure in the design of multilevel circuits is to express the
Boolean function in terms of AND, OR, and complement operations. The function can then be
implemented with AND and OR gates. After that, if necessary, it can be converted into an all-
NAND circuit. Consider, for example, the Boolean function
F = A (CD + B) + BC ‘
ub
uh
ed
ts
NOR Implementation
The NOR operation is the dual of the NAND operation. Therefore, all procedures and rules for
NOR logic are the duals of the corresponding procedures and rules developed for NAND logic.
The NOR gate is another universal gate that can be used to implement any Boolean function. The
implementation of the complement, OR, and AND operations with NOR gates is shown in Fig.
3.22. The complement operation is obtained from a one input NOR gate that behaves exactly like
an inverter. The OR operation requires two NOR gates, and the AND operation is obtained with
a NOR gate that has inverters in each input.
ub
uh
ed
ts
ub
uh
ed
ts
The output of combinational circuit at any instant of time depends only on the levels
present at input terminals.
The combinational circuit does 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 a n number of inputs and m number of outputs.
Block diagram
ub
uh
ed
DESIGN PROCEDURE
ts
The design of combinational circuits starts from the specification of the design objective and
culminates in a logic circuit diagram or a set of Boolean functions from which the logic diagram
can be obtained. The procedure involves the following steps:
1. From the specifications of the circuit, determine the required number of inputs and outputs and
assign a symbol to each.
2. Derive the truth table that defines the required relationship between inputs and outputs.
3. Obtain the simplified Boolean functions for each output as a function of the input variables.
4. Draw the logic diagram and verify the correctness of the design (manually or by simulation).
A truth table for a combinational circuit consists of input columns and output columns. The input
columns are obtained from the 2n binary numbers for the n input variables. The binary values for
the outputs are determined from the stated specifications. The output functions specified in the
truth table give the exact definition of the combinational circuit. It is important that the verbal
TSEDUHUB EXCLUSIVE Page 70
specifications be interpreted correctly in the truth table, as they are often incomplete, and any
wrong interpretation may result in an incorrect truth table.
The output binary functions listed in the truth table are simplified by any available method, such
as algebraic manipulation, the map method, or a computer-based simplification program.
Half Adder
A combinational circuit that performs the addition of two bits is called a half adder. We find that
this circuit needs two binary inputs and two binary outputs. The input variables designate the
augend and addend bits; the output variables produce the sum and carry. We assign symbols x
and y to the two inputs and S (for sum) and C (for carry) to the outputs.
The simplified Boolean functions for the two outputs can be obtained directly from the truth
ub
table. The simplified sum-of-products expressions are
The logic diagram of the half adder implemented in sum of products is shown in Fig. (a) . It can
be also implemented with an exclusive-OR and an AND gate as shown in Fig. (b). This form is
uh
used to show that two half adders can be used to construct a full adder.
ed
ts
A full adder is a combinational circuit that forms the arithmetic sum of three bits. It consists of
three inputs and two outputs. Two of the input variables, denoted by x and y, represent the two
significant bits to be added. The third input, z, represents the carry from the previous lower
significant position. The two outputs are designated by the symbols S for sum and C for carry.
The binary variable S gives the value of the least significant bit of the sum. The binary variable C
gives the output carry formed by adding the input carry and the bits of the words.
ub
uh
The simplified expressions are
ed
ts
The logic diagram for the full adder implemented in sum-of-products form is shown in the below Fig.
ub
The S output from the second half adder is the exclusive-OR of z and the output of the first half
adder, giving uh
The carry output is
ed
ts
ub
uh
ed
ts
ub
uh
ed
ts
Binary Subtractor
ub
uh
ed
ts
The multiplicand is multiplied by each bit of the multiplier, starting from the least significant bit.
Each such multiplication forms a partial product. Successive partial products are shifted one
position to the left. The final product is obtained from the sum of the partial products.
To see how a binary multiplier can be implemented with a combinational circuit, consider
the multiplication of two 2-bit numbers as shown in Fig. 4.15. The multiplicand bits are B1 and
B0, the multiplier bits are A1 and A0, and the product is C3C2C1C0. The first partial product is
formed by multiplying B1B0 by A0. The multiplication of two bits such as A0 and B0 produces a
1 if both bits are 1; otherwise, it produces a 0. This is identical to an AND operation. Therefore,
the partial product can be implemented with AND gates as shown in the diagram. The second
partial product is formed by multiplying B1B0 by A1 and shifting one position to the left. The
two partial products are added with two half-adder (HA) circuits. Usually, there are more bits in
the partial products and it is necessary to use full adders to produce the sum of the partial
products. Note that the least significant bit of the product does not have to go through an adder,
ub
since it is formed by the output of the first AND gate.
uh
ed
ts
E.g. 2x4 line Decoder (it is also called two four line decoder)
Active high output type of decoders are constructed with AND gates and active low output type
of decoders are constructed with NAND gates.
ub
Truth table of active high output type of decoder is given below:
uh
ed
ts
Applications of decoders
ub
1. Decoders are used in counter systems
2. They are used in analog-to-digital converters.
3. Decoder outputs can be used to drive a display system.
Encoder
uh
ed
ts
According to Table 4.8, the higher the subscript number, the higher the priority of the
input. Input D3 has the highest priority, so, regardless of the values of the other inputs, when this
ub
input is 1, the output for xy is 11 (binary 3). D2 has the next priority level. The output is 10 if D2
= 1, provided that D3 = 0, regardless of the values of the other two lower priority inputs. The
output for D1 is generated only if higher priority inputs are 0, and so on down the priority levels.
uh
ed
ts
The maps for simplifying outputs x and y are shown in Fig. 4.22. The minterms for the
two functions are derived from Table 4.8. Although the table has only five rows, when each X in
a row is replaced first by 0 and then by 1, we obtain all 16 possible input combinations. For
example, the fourth row in the table, with inputs XX10, represents the four minterms 0010, 0110,
ub
uh
MULTIPLEXERS
ed
A multiplexer is a combinational circuit that selects binary information from one of many
input lines and directs it to a single output line. The selection of a particular input line is
controlled by a set of selection lines. Normally, there are 2n input lines and n selection lines
whose bit combinations determine which input is selected.
ts
ub
particular AND gate. The outputs of the AND gates are applied to a single OR gate that provides
the one-line output. The function table lists the input that is passed to the output for each
combination of the binary selection values. To demonstrate the operation of the circuit, consider
the case when S1S0 = 10. The AND gate associated with input I2 has two of its inputs equal to 1
and the third input connected to I2. The other three AND gates have at least one input equal to 0,
uh
which makes their outputs equal to 0. The output of the OR gate is now equal to the value of I2,
providing a path from the selected input to the output. A multiplexer is also called a data
selector, since it selects one of many inputs and steers the binary information to the output line.
ed
ts
ub
uh
ed
ts
ub
uh
ed
(OR)
ts
Multiplexer are used in various fields where multiple data need to be transmitted using a single
line. Following are some of the applications of multiplexers -
ed
multiplexer. Multiplexer allow the process of transmitting different type of data such as
audio, video at the same time using a single transmission line.
2. Telephone network – In telephone network, multiple audio signals are integrated on a
single line for transmission with the help of multiplexers. In this way, multiple audio
signals can be isolated and eventually, the desire audio signals reach the intended
recipients.
3. Computer memory - Multiplexers are used to implement huge amount of memory into
the computer, at the same time reduces the number of copper lines required to connect the
memory to other parts of the computer circuit.
4. Transmission from the computer system of a satellite – Multiplexer can be used for
the transmission of data signals from the computer system of a satellite or spacecraft to the
ground system using the GPS (Global Positioning System) satellites.
TSEDUHUB EXCLUSIVE Page 89
Demultiplexer
Demultiplexer means one to many. A demultiplexer is a circuit with one input and many outputs.
By applying control signal, we can steer any input to the output. Few types of demultiplexer are
1-to 2, 1-to-4, 1-to-8 and 1-to-16 demultiplexer.
Following figure illustrate the general idea of a demultiplexer with 1 input signal, m control
signals, and n output signals.
ub
uh
Demultiplexer Pin Diagram
The 1-to-4 demultiplexer has 1 input bit, 2 control bit, and 4 output bits. The 1-to-4
demultiplexer is shown in figure below-
ts
When AB = 01, the upper second AND gate is enabled while other AND gates are disabled.
Therefore, only data bit D is transmitted to the output, giving Y1 = Data.
If D is low, Y1 is low. IF D is high, Y1 is high. The value of Y1 depends upon the value of D.
All other outputs are in low state.
If the control input is changed to AB = 10, all the gates are disabled except the third AND gate
from the top. Then, D is transmitted only to the Y2 output, and Y2 = Data.
Example of 1-to-16 demultiplexer has 1 input bit, 4 control bits and 16 output bit.
ub
Applications of Demultiplexer:
The multiplexer and demultiplexer work together to carry out the process of transmission
and reception of data in communication system.
3. ALU (Arithmetic Logic Unit) – In an ALU circuit, the output of ALU can be stored in
multiple registers or storage units with the help of demultiplexer. The output of ALU is fed
as the data input to the demultiplexer. Each output of demultiplexer is connected to
multiple register which can be stored in the registers.
4. Serial to parallel converter - A serial to parallel converter is used for reconstructing
parallel data from incoming serial data stream. In this technique, serial data from the
incoming serial data stream is given as data input to the demultiplexer at the regular
intervals. A counter is attach to the control input of the demultiplexer. This counter directs
the data signal to the output of the demultiplexer where these data signals are stored. When
MAGNITUDE COMPARATOR
The comparison of two numbers is an operation that determines whether one number is greater
than, less than, or equal to the other number. A magnitude comparator is a combinational circuit
that compares two numbers A and B and determines their relative magnitudes. The outcome of
the comparison is specified by three binary variables that indicate whether A<B, A = B, or A>B.
Similarly we can have 2 bit comparator and the table to list all the combinations at input and
their corresponding outputs is as:
ub
A B
00 00 0 1 0
uh
01 00 1 0 0
10 00 1 0 0
ed
11 00 1 0 0
00 01 0 0 1
ts
01 01 0 1 0
10 01 1 0 0
11 01 1 0 0
00 10 0 0 1
01 10 0 0 1
10 10 0 1 0
11 10 1 0 0
01 11 0 0 1
10 11 0 0 1
11 11 0 1 0
And we get the equations for all three outputs from the K-maps as
ub
We can also obtain these equations orally as for A1A0 to be greater than B1B0 either A1 is greater
uh
than B1 (i.e. A1=1 & B1=0) or A1 is equal to B1 (or A1is not less than B1 i.e. (f(A1<B1))’ =
(A1’B1)’= (A1 + B1‘) & A0 is greater than B0 (i.e. A0=1 & B0=0).
Hence the equation we get is f (A>B) = A1B1‘+ (A1 + B1’) A0B0’ = A1B1‘+ A0 B1’B0’+ A1A0B0’
ed
ts
ub
uh
ed
ts
1 Block diagram:
Inputs Outputs
Inputs Outputs
Combin
Combination ational
al circuit circuit
Memor
y
element
ub
uh
2 It consists of input signal, gates and It consists of a combinational circuit to
output signals which memory elements are connected
to form a feedback path.
ed
3 The outputs at any instant of time are The outputs dependent not only on the
entirely dependent upon the inputs present present input variable but they also
at that time. depend upon the past value of the input
variable.
ts
4 Combinational circuits are faster in speed Sequential circuits are slower than the
combinational circuits.
6 Example: Parallel adder, Code converter, Example: Serial Adder, Counter, shift
Decoder register
ub
(inputs, current state) ⇒ (outputs, next state)
uh
ed
ub
uh
ed
ts
ub
uh
ed
What is Latch?
ts
A storage element in a digital circuit can maintain a binary state indefinitely (as long as power is
delivered to the circuit), until directed by an input signal to switch states. The major differences
among various types of storage elements are in the number of inputs they possess and in the
manner in which the inputs affect the binary state. Storage elements that operate with signal
levels (rather than signal transitions) are referred to as latches; those controlled by a clock
transition are flip-flops. Latches are said to be level sensitive devices; flip-flops are edge-
sensitive devices. The two types of storage elements are related because latches are the basic
circuits from which all flip-flops are constructed. Although latches are useful for storing binary
information and for the design of asynchronous sequential circuits, they are not practical for use
as storage elements in synchronous sequential circuits.
Flip flops are actually an application of logic gates. With the help of Boolean logic you can
uh
create memory with them. Flip flops can also be considered as the most basic idea of a Random
Access Memory [RAM]. When a certain input value is given to them, they will be remembered
and executed, if the logic gates are designed correctly. A higher application of flip flops is
helpful in designing better electronic circuits.
ed
The most commonly used application of flip flops is in the implementation of a feedback circuit.
As a memory relies on the feedback concept, flip flops can be used to design it.
There are mainly four types of flip flops that are used in electronic circuits. They are
ts
ub
uh
ed
From the diagram it is evident that the flip flop has mainly four states. They are
In both the states you can see that the outputs are just compliments of each other and that the
value of Q follows the value of S.
If both the values of S and R are switched to 0, then the circuit remembers the value of S and R
in their previous state.
ub
uh
ed
Like the NOR Gate S-R flip flop, this one also has four states. They are
ts
In both the states you can see that the outputs are just compliments of each other and that the
value of Q follows the compliment value of S.
If both the values of S and R are switched to 1, then the circuit remembers the value of S and R
in their previous state.
ub
uh
ed
ts
ub
State Equations
The behavior of a clocked sequential circuit can be described algebraically by means of state
equations. A state equation (also called a transition equation) specifies the next state as a
function of the present state and inputs. Consider the sequential circuit shown in Fig. 5.15. We
will later show that it acts as a 0-detector by asserting its output when a 0 is detected in a stream
uh
of 1s. It consists of two D flip-flops A and B, an input x and an output y . Since the D input of a
flip-flop determines the value of the next state (i.e., the state reached after the clock transition), it
is possible to write a set of state equations for the circuit:
ed
state equation is an algebraic expression that specifies the condition for a flip-flop state
transition. The left side of the equation, with (t + 1), denotes the next state of the flip-flop one
clock edge later. The right side of the equation is a Boolean expression that specifies the present
ts
state and input conditions that make the next state equal to 1. Since all the variables in the
Boolean expressions are a function of the present state, we can omit the designation ( t ) after
each variable for convenience and can express the state equations in the more compact form
The Boolean expressions for the state equations can be derived directly from the gates that form
the combinational circuit part of the sequential circuit, since the D values of the combinational
circuit determine the next state. Similarly, the present-state value of the output can be expressed
algebraically as
By removing the symbol (t) for the present state, we obtain the output Boolean equation:
State Table
The time sequence of inputs, outputs, and flip-flop states can be enumerated in a state table
(sometimes called a transition table). The state table for the circuit of Fig. 5.15 is shown in Table
5.2. The table consists of four sections labeled present state, input, next state, and output. The
present-state section shows the states of flip-flops A and B at any given time t. The input section
gives a value of x for each possible present state. The next-state section shows the states of the
flip-flops one clock cycle later, at time t + 1. The output section gives the value of y at time t for
each present state and input condition.
The derivation of a state table requires listing all possible binary combinations of present states
and inputs. In this case, we have eight binary combinations from 000 to 111. The next-state
values are then determined from the logic diagram or from the state equations. The next state of
flip-flop A must satisfy the state equation
State Diagram
The information available in a state table can be represented graphically in the form of a state
diagram. In this type of diagram, a state is represented by a circle, and the (clock-triggered)
transitions between states are indicated by directed lines connecting the circles. The state
diagram of the sequential circuit of Fig. 5.15 is shown in Fig. 5.16 . The state diagram provides
TSEDUHUB EXCLUSIVE Page 114
the same information as the state table and is obtained directly from Table 5.2 or Table 5.3. The
binary number inside each circle identifies the state of the flip-flops. The directed lines are
labeled with two binary numbers separated by a slash. The input value during the present state is
labeled first, and the number after the slash gives the output during the present state with the
given input. (It is important to remember that the bit value listed for the output along the directed
line occurs during the present state and with the indicated input, and has nothing to do with the
transition to the next state.) For example, the directed line from state 00 to 01 is labeled 1/0,
meaning that when the sequential circuit is in the present state 00 and the input is 1, the output is
0. After the next clock cycle, the circuit goes to the next state, 01. If the input changes to 0, then
the output becomes 1, but if the input remains at 1, the output stays at 0. This information is
obtained from the state diagram along the two directed lines emanating from the circle with state
01. A directed line connecting a circle with itself indicates that no change of state occurs.
ub
uh
ed
ts
A register that goes through a prescribed sequence of states upon the application of input pulses
is called a counter. The input pulses may be clock pulses, or they may originate from some
external source and may occur at a fixed interval of time or at random. The sequence of states
may follow the binary number sequence or any other sequence of states. A counter that follows
the binary number sequence is called a binary counter. An n ‐bit binary counter consists of n
flip‐flops and can count in binary from 0 through 2n - 1.
Counters are available in two categories: ripple counters and synchronous counters.
RIPPLE COUNTERS
In a ripple counter, a flip‐flop output transition serves as a source for triggering other flip‐flops.
In other words, the C input of some or all flip‐flops are triggered, not by the common clock
pulses, but rather by the transition that occurs in other flip‐flop outputs.
ub
uh
A binary ripple counter consists of a series connection of complementing flip‐flops, with the
output of each flip‐flop connected to the C input of the next higher order flip‐flop. The flip‐flop
holding the least significant bit receives the incoming count pulses. A complementing flip‐flop
can be obtained from a JK flip‐flop with the J and K inputs tied together or from a T flip‐flop. A
third possibility is to use a D flip‐flop with the complement output connected to the D input. In
ed
this way, the D input is always the complement of the present state, and the next clock pulse will
cause the flip‐flop to complement.
The logic diagram of two 4‐bit binary ripple counters is shown in Fig. 6.8. The counter is
ts
constructed with complementing flip‐flops of the T type in part (a) and D type in part (b). The
output of each flip‐flop is connected to the C input of the next flip‐flop in sequence. The flip‐flop
holding the least significant bit receives the incoming count pulses. The T inputs of all the
flip‐flops in (a) are connected to a permanent logic 1, making each flip-flop complement if the
signal in its C input goes through a negative transition. The bubble in front of the dynamic
indicator symbol next to C indicates that the flip‐flops respond to the negative‐edge transition of
the input. The negative transition occurs when the output of the previous flip‐flop to which C is
connected goes from 1 to 0.
To understand the operation of the four‐bit binary ripple counter, refer to the first nine
binary numbers listed in Table 6.4. The count starts with binary 0 and increments by 1 with each
count pulse input. After the count of 15, the counter goes back to 0 to repeat the count. The least
significant bit, A0, is complemented with each count pulse input. Every time that A0 goes from 1
to 0, it complements A1. Every time that A1 goes from 1 to 0, it complements A2. Every time
that A2 goes from 1 to 0, it complements A3, and so on for any other higher order bits of a ripple
TSEDUHUB EXCLUSIVE Page 121
counter. For example, consider the transition from count 0011 to 0100. A0 is complemented with
the count pulse. Since A0 goes from 1 to 0, it triggers A1 and complements it. As a result, A1
goes from 1 to 0, which in turn complements A2, changing it from 0 to 1. A2 does not trigger A3,
because A2 produces a positive transition and the flip‐flop responds only to negative transitions.
Thus, the count from 0011 to 0100 is achieved by changing the bits one at a time, so the count
goes from 0011 to 0010, then to 0000, and finally to 0100. The flip‐flops change one at a time in
succession, and the signal propagates through the counter in a ripple fashion from one stage to
the next.
ub
uh
ed
ts
A decimal counter is similar to a binary counter, except that the state after 1001 (the code
for decimal digit 9) is 0000 (the code for decimal digit 0). The logic diagram of a BCD ripple
counter using JK flip‐flops is shown in Fig. 6.10. The four outputs are designated by the letter
symbol Q, with a numeric subscript equal to the binary weight of the corresponding bit in the
BCD code. Note that the output of Q1 is applied to the C inputs of both Q2 and Q8 and the
output of Q2 is applied to the C input of Q4. The J and K inputs are connected either to a
permanent 1 signal or to outputs of other flip‐flops.
ub
A ripple counter is an asynchronous sequential circuit. Signals that affect the flip‐flop
transition depend on the way they change from 1 to 0. The operation of the counter can be
explained by a list of conditions for flip‐flop transitions. These conditions are derived from the
logic diagram and from knowledge of how a JK flip‐flop operates. Remember that when the C
input goes from 1 to 0, the flip‐flop is set if J = 1, is cleared if K = 1, is complemented if J = K =
uh
1, and is left unchanged if J = K = 0.
ed
ts
To verify that these conditions result in the sequence required by a BCD ripple counter, it is
necessary to verify that the flip‐flop transitions indeed follow a sequence of states as specified by
the state diagram of Fig. 6.9. Q1 changes state after each clock pulse. Q2 complements every
time Q1 goes from 1 to 0, as long as Q8 = 0. When Q8 becomes 1, Q2 remains at 0. Q4
complements every time Q2 goes from 1 to 0. Q8 remains at 0 as long as Q2 or Q4 is 0. When
TSEDUHUB EXCLUSIVE Page 125
both Q2 and Q4 become 1, Q8 complements when Q1 goes from 1 to 0. Q8 is cleared on the next
transition of Q1.
The BCD counter of Fig. 6.10 is a decade counter, since it counts from 0 to 9. To count in
decimal from 0 to 99, we need a two‐decade counter. To count from 0 to 999, we need a
three‐decade counter. Multiple decade counters can be constructed by connecting BCD counters
in cascade, one for each decade. A three‐decade counter is shown in Fig. 6.11. The inputs to the
second and third decades come from Q8 of the previous decade. When Q8 in one decade goes
from 1 to 0, it triggers the count for the next higher order decade while its own decade goes from
9 to 0.
ub
uh
ed
SYNCHRONOUS COUNTERS
In a synchronous counter, the C inputs of all flip‐flops receive the common clock. Synchronous
counters are presented in the next two sections. Here, we present the binary and BCD ripple
counters and explain their operation.
ts
Synchronous counters are different from ripple counters in that clock pulses are applied to the
inputs of all flip‐flops. A common clock triggers all flip‐flops simultaneously, rather than one at
a time in succession as in a ripple counter. The decision whether a flip‐flop is to be
complemented is determined from the values of the data inputs, such as T or J and K at the time
of the clock edge. If T = 0 or J = K = 0, the flip‐flop does not change state. If T = 1 or J = K = 1,
the flip‐flop complements.
Binary Counter
The design of a synchronous binary counter is so simple that there is no need to go through a
sequential logic design process. In a synchronous binary counter, the flip‐flop in the least
significant position is complemented with every pulse. A flip-flop in any other position is
complemented when all the bits in the lower significant positions are equal to 1. For example, if
TSEDUHUB EXCLUSIVE Page 126
the present state of a four‐bit counter is A3A2A1A0 = 0011, the next count is 0100. A0 is always
complemented. A1 is complemented because the present state of A0 = 1. A2 is complemented
because the present state of A1A0 = 11. However, A3 is not complemented, because the present
state of A2A1A0 = 011, which does not give an all‐1’s condition.
Synchronous binary counters have a regular pattern and can be constructed with
complementing flip‐flops and gates. The regular pattern can be seen from the four‐bit counter
depicted in Fig. 6.12. The C inputs of all flip‐flops are connected to a common clock. The
counter is enabled by Count_enable. If the enable input is 0, all J and K inputs are equal to 0 and
the clock does not change the state of the counter. The first stage, A0, has its J and K equal to 1 if
the counter is enabled. The other J and K inputs are equal to 1 if all previous least significant
stages are equal to 1 and the count is enabled. The chain of AND gates generates the required
logic for the J and K inputs in each stage. The counter can be extended to any number of stages,
with each stage having an additional flip‐flop and an AND gate that gives an output of 1 if all
previous flip‐flop outputs are 1.
ub
Note that the flip‐flops trigger on the positive edge of the clock. The polarity of the clock
is not essential here, but it is with the ripple counter. The synchronous counter can be triggered
with either the positive or the negative clock edge. The complementing flip‐flops in a binary
counter can be of either the JK type, the T type, or the D type with XOR gates.
uh
ed
ts
A countdown binary counter can be constructed as shown in Fig. 6.12, except that the inputs to
the AND gates must come from the complemented outputs, instead of the normal outputs, of the
previous flip‐flops. The two operations can be combined in one circuit to form a counter capable
of counting either up or down. The circuit of an up–down binary counter using T flip‐flops is
shown in Fig. 6.13. It has an up control input and a down control input. When the up input is 1,
ub
the circuit counts up, since the T inputs receive their signals from the values of the previous
normal outputs of the flip‐flops. When the down input is 1 and the up input is 0, the circuit
counts down, since the complemented outputs of the previous flip‐flops are applied to the T
inputs. When the up and down inputs are both 0, the circuit does not change state and remains in
the same count. When the up and down inputs are both 1, the circuit counts up. This set of
uh
conditions ensures that only one operation is performed at any given time. Note that the up input
has priority over the down input.
ed
ts
A register is a group of flip‐flops, each one of which shares a common clock and is
capable of storing one bit of information. An n ‐bit register consists of a group of n flip‐flops
capable of storing n bits of binary information. In addition to the flip‐flops, a register may have
combinational gates that perform certain data‐processing tasks. In its broadest definition, a
register consists of a group of flip‐flops together with gates that affect their operation. The
flip‐flops hold the binary information, and the gates determine how the information is transferred
into the register.
ub
sequence of states. Although counters are a special type of register, it is common to differentiate
them by giving them a different name.
Various types of registers are available commercially. The simplest register is one that
consists of only flip‐flops, without any gates. Figure 6.1 shows such a register constructed with
uh
four D ‐type flip‐flops to form a four‐bit data storage register. The common clock input triggers
all flip‐flops on the positive edge of each pulse, and the binary data available at the four inputs
are transferred into the register. The value of ( I 3 , I 2 , I 1 , I 0 ) immediately before the clock
edge determines the value of ( A 3 , A 2 , A 1 , A 0 ) after the clock edge. The four outputs can be
ed
sampled at any time to obtain the binary information stored in the register. The input Clear_b
goes to the active‐low R (reset) input of all four flip‐flops. When this input goes to 0, all
flip‐flops are reset asynchronously. The Clear_b input is useful for clearing the register to all 0’s
prior to its clocked operation. The R inputs must be maintained at logic 1 (i.e., de-asserted)
during normal clocked operation. Note that, depending on the flip‐flop, either Clear, Clear_b,
ts
reset, or reset_b can be used to indicate the transfer of the register to an all 0’s state.
The simplest possible shift register is one that uses only flip‐flops, as shown in Fig. 6.3
.The output of a given flip‐flop is connected to the D input of the flip‐flop at its right. This shift
register is unidirectional (left‐to‐right). Each clock pulse shifts the contents of the register one bit
position to the right. The configuration does not support a left shift. The serial input determines
what goes into the leftmost flip‐flop during the shift. The serial output is taken from the output
of the rightmost flip‐flop. Sometimes it is necessary to control the shift so that it occurs only with
certain pulses, but not with others. As with the data register discussed in the previous section, the
clock’s signal can be suppressed by gating the clock signal to prevent the register from shifting.
ub
A preferred alternative in high speed circuits is to suppress the clock action, rather than gate the
clock signal, by leaving the clock path unchanged, but recirculating the output of each register
cell back through a two‐channel mux whose output is connected to the input of the cell. When
the clock action is not suppressed, the other channel of the mux provides a data path to the cell.
uh
ed
ts
The binary data in a register can be moved within the register from one flip-flop to another. The
registers that allow such data transfers are called as shift registers. There are four mode of
operation of a shift register.
Block Diagram
Operation
ub
uh
Before application of clock signal let Q3 Q2 Q1 Q0 = 0000 and apply LSB bit of the number to be
entered to Din. So Din=D3=1. Apply the clock. On the first falling edge of clock, the FF-3 is set,
and stored word in the register is Q3 Q2 Q1 Q0 = 1000.
ed
ts
Apply the next bit to Din. So Din=1. As soon as the next negative edge of the clock hits, FF-2 will
set and the stored word change to Q3 Q2 Q1 Q0 = 1100.
ub
uh
Similarly with Din=1 and with the fourth negative clock edge arriving, the stored word in the
register is Q3 Q2 Q1 Q0 = 1111.
ed
ts
Truth Table
Block Diagram
ub
uh
Parallel Input Serial Output (PISO)
ed
circuit.
The binary input word B0,B1,B2,B3 is applied though the same combinational circuit.
There are two modes in which this circuit can work namely shift mode or load mode.
Load mode
When the shift/load bar line is low (0), the AND gate 2,4 and 6 become active. They will pass
B1,B2,B3 bits to the corresponding flip-flops. On the low going edge of clock, the binary input
B0,B1,B2,B3 will get loaded into the corresponding flip-flops. Thus parallel loading takes place.
Shift mode
When the shift/load bar line is low (1), the AND gate 2,4 and 6 become inactive. Hence the
parallel loading of the data becomes impossible. But the AND gate 1,3 and 5 become active.
Block Diagram
ub
uh
Parallel Input Parallel Output (PIPO)
In this mode, the 4 bit binary input B0,B1,B2,B3 is applied to the data inputs D0,D1,D2,D3
ed
respectively of the four flip-flops. As soon as a negative clock edge is applied, the input binary
bits will be loaded into the flip-flops simultaneously. The loaded bits will appear simultaneously
to the output side. Only clock pulse is essential to load all the bits.
ts
Block Diagram
Memory Devices
A memory is just like a human brain. It is used to store data and instruction. Computer memory
is the storage space in computer where data is to be processed and instructions required for
processing are stored.
The memory is divided into large number of small parts. Each part is called cell. Each location or
cell has a unique address which varies from zero to memory size minus one.
For example if computer has 64k words, then this memory unit has 64 * 1024=65536 memory
location. The address of these locations varies from 0 to 65535.
ub
Internal Memory - cache memory and primary/main memory
External Memory - magnetic disk / optical disk etc.
uh
ed
ts
Comparison chart
RAM ROM
Random Access Memory or RAM is Read-only memory or ROM is also a form of
a form of data storage that can be data storage that can not be easily altered or
accessed randomly at any time, in any reprogrammed. Stores instructions that are not
Definition
order and from any physical location, necessary for re-booting up to make the
allowing quick access and computer operate when it is switched off.
ub
manipulation. They are hardwired.
Stands for Random Access Memory Read-only memory
RAM allows the computer to read
ROM stores the program required to initially
Use data quickly to run applications. It
boot the computer. It only allows reading.
uh
allows reading and writing.
RAM is volatile i.e. its contents are It is non-volatile i.e. its contents are retained
Volatility
lost when the device is powered off. even when the device is powered off.
The two main types of RAM are static The types of ROM include PROM, EPROM
Types
ed
RANDOM-ACCESS MEMORY
ts
A memory unit is a collection of storage cells, together with associated circuits needed to transfer
information into and out of a device. The architecture of memory is such that information can be
selectively retrieved from any of its internal locations. The time it takes to transfer information to
or from any desired random location is always the same—hence the name random-access
memory, abbreviated RAM. In contrast, the time required to retrieve information that is stored on
magnetic tape depends on the location of the data.
A memory unit stores binary information in groups of bits called words. A word in
memory is an entity of bits that move in and out of storage as a unit. A memory word is a group
of 1’s and 0’s and may represent a number, an instruction, one or more alphanumeric characters,
or any other binary‐coded information. A group of 8 bits is called a byte. Most computer
memories use words that are multiples of 8 bits in length. Thus, a 16‐bit word contains two
bytes, and a 32‐bit word is made up of four bytes. The capacity of a memory unit is usually
stated as the total number of bytes that the unit can store.
The word static indicates that the memory retains its contents as long as power remains applied.
However, data is lost when the power gets down due to volatile nature. SRAM chips use a matrix
of 6-transistors and no capacitors. Transistors do not require power to prevent leakage, so SRAM
need not have to be refreshed on a regular basis.
Because of the extra space in the matrix, SRAM uses more chips than DRAM for the same
amount of storage space, thus making the manufacturing costs higher.
Static RAM is used as cache memory needs to be very fast and small.
DRAM, unlike SRAM, must be continually refreshed in order for it to maintain the data. This is
done by placing the memory on a refresh circuit that rewrites the data several hundred times per
second. DRAM is used for most system memory because it is cheap and small. All DRAMs are
made up of memory cells. These cells are composed of one capacitor and one transistor.
ub
uh
ed
ts
The very first ROMs were hard-wired devices that contained a pre-programmed set of data or
instructions. These kinds of ROMs are known as masked ROMs. It is inexpensive ROM.
ub
PROM (Programmable Read only Memory)
PROM is read-only memory that can be modified only once by a user. The user buys a blank
PROM and enters the desired contents using a PROM programmer. Inside the PROM chip there
uh
are small fuses which are burnt open during programming. It can be programmed only once and
is not erasable.
The EPROM can be erased by exposing it to ultra-violet light for duration of upto 40 minutes.
Usually, a EPROM eraser achieves this function. During programming an electrical charge is
trapped in an insulated gate region. The charge is retained for more than ten years because the
charge has no leakage path. For erasing this charge, ultra-violet light is passed through a quartz
crystal window (lid). This exposure to ultra-violet light dissipates the charge. During normal use
ts
The EEPROM is programmed and erased electrically. It can be erased and reprogrammed about
ten thousand times. Both erasing and programming take about 4 to 10 ms (milli second). In
EEPROM, any location can be selectively erased and programmed. EEPROMs can be erased one
byte at a time, rather than erasing the entire chip. Hence, the process of re-programming is
flexible but slow.
Flash memory devices are similar to EEPROMs, but have additional built‐in circuitry to
selectively program and erase the device in‐circuit, without the need for a special programmer.
They have widespread application in modern technology in cell phones, digital cameras, set‐top
boxes, digital TV, telecommunications, nonvolatile data storage, and microcontrollers. Their low
TSEDUHUB EXCLUSIVE Page 157
consumption of power makes them an attractive storage medium for laptop and notebook
computers.
ub
uh
ed
ts
Sequential access means the system must search the storage device from the beginning of the
memory address until it finds the required piece of data. Memory device which supports such
access is called a Sequential Access Memory or Serial Access Memory. Magnetic tape is an
example of serial access memory.
ts
Cache Memory
Cache memory is a very high speed semiconductor memory which can speed up CPU. It acts as a
buffer between the CPU and main memory. It is used to hold those parts of data and program
Advantages
Disadvantages
Virtual memory
ub
Virtual memory is a technique that allows the execution of processes which are not completely
available in memory. The main visible advantage of this scheme is that programs can be larger
than physical memory. Virtual memory is the separation of user logical memory from physical
uh
memory.
This separation allows an extremely large virtual memory to be provided for programmers when
only a smaller physical memory is available. Following are the situations, when entire program is
not required to be loaded fully in main memory.
ed
User written error handling routines are used only when an error occurred in the data or
computation.
Certain options and features of a program may be used rarely.
Many tables are assigned a fixed amount of address space even though only a small
ts
Auxiliary Memory
Auxiliary memory is much larger in size than main memory but is slower. It normally stores
system programs, instruction and data files. It is also known as secondary memory. It can also be
used as an overflow/virtual memory in case the main memory capacity has been exceeded.
TSEDUHUB EXCLUSIVE Page 162
Secondary memories can not be accessed directly by a processor. First the data / information of
auxiliary memory is transferred to the main memory and then that information can be accessed
by the CPU. Characteristics of Auxiliary Memory are following
ub
uh
ed
ts