DLD exit
DLD exit
FACULTY OF TECHNOLOGY
Department of Electrical and Computer
Engineering
Digital Logic Design Module for 5th year ECE students
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
CHAPTER ONE
NUMBER SYSTEM
Number systems are the technique to represent numbers in the computer system architecture, every
value that you are saving or getting into/from computer memory has a defined number system.
NUMBER SYSTEM
A Binary number system has only two digits that are 0 and 1. Every number (value) represents with
0 and 1 in this number system. The base of binary number system is 2, because it has only two digits.
Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with
0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has only
8 digits.
PREPARED BY AMLAKIE A. 2
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents with
0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10, because it
has only 10 digits.
PREPARED BY AMLAKIE A. 3
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
CONVERSIONS
DECIMAL TO OTHER
DECIMAL TO BINARY
Decimal Number System to Other Base
To convert Number system from Decimal Number System to Any Other Base is quite easy; you have to
follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which you want to convert the
number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a Most Significant Bit
(MSB).
Binary Number is
(11000000111001)2
PREPARED BY AMLAKIE A. 4
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example 2
Decimal Number is : Hexadecimal Number is
(725)10 (2D5)16
Convert
10, 11, 12, 13, 14, 15
to its equivalent... A, B, C,
D, E, F
PREPARED BY AMLAKIE A. 5
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
BINARY TO OTHER
BINARY TO DECIMAL
Multiply the digit with 2(with place value exponent). Eventually add all the multiplication becomes the
Decimal number.
PREPARED BY AMLAKIE A. 6
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
1. BINARY TO OCTAL
An easy way to convert from binary to octal is to group binary digits into sets of three,
starting with the least significant (rightmost) digits.
PREPARED BY AMLAKIE A. 7
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
BINARY TO HEXADECIMAL
An equally easy way to convert from binary to hexadecimal is to group binary digits into sets
of four, starting with the least significant (rightmost) digits.
PREPARED BY AMLAKIE A. 8
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
OCTAL TO OTHER
OCTAL TO BINARY
Converting from octal to binary is as easy as converting from binary to octal. Simply look
up each octal digit to obtain the equivalent group of three binary digits.
Octal: 0 1 2 3 4 5 6 7
Binary: 000 001 010 011 100 101 110 111
Octal = 3 4 5
Binary = 011 100 101 = 011100101 binary
OCTAL TO HEXADECIMAL
When converting from octal to hexadecimal, it is often easier to first convert the octal
number into binary and then from binary into hexadecimal. For example, to convert 345 octal
into hex:
Octal = 3 4 5
PREPARED BY AMLAKIE A. 9
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Drop any leading zeros or pad with leading zeros to get groups of four binary digits
(bits): Binary 011100101 = 1110 0101
Hexadecimal: 0 1 2 3 4 5 6 7
Hexadecimal: 8 9 A B C D E F
Hexadecimal = E 5 = E5 hex
Therefore, through a two-step conversion process, octal 345 equals binary 011100101
equals hexadecimal E5.
PREPARED BY AMLAKIE A. 10
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
OCTAL TO DECIMAL
The conversion can also be performed in the conventional mathematical way, by showing
each digit place as an increasing power of 8.
decimal OR
PREPARED BY AMLAKIE A. 11
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
HEXADECIMAL TO OTHER
1. HEXADECIMAL TO BINARY
Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal: 8 9 A B C D E F
Binary: 1000 1001 1010 1011 1100 1101 1110 1111
Hexadecimal = A 2 D E
Binary = 1010 0010 1101 1110 = 1010001011011110 binary
PREPARED BY AMLAKIE A. 12
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Binary Addition
It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.
In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the
given column and a carry of 1 over to the next column.
Example − Addition
PREPARED BY AMLAKIE A. 13
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
2's complement
The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit
(LSB) of 1's complement of the number.
PREPARED BY AMLAKIE A. 14
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
For example,
PREPARED BY AMLAKIE A. 15
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
For example,
0 0 1 1 1 1 0 1 1 0 = 246(base 10)
1. AND 5. NAND
2. OR 6. XOR
3. NOT 7. XNOR
4. NOR
PREPARED BY AMLAKIE A. 16
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
0 1 0
Symbol of AND gate 1 0 0
1 1 1
Therefore, in And gate, the output is high when all the inputs are high.
PREPARED BY AMLAKIE A. 17
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
OR Gate
Two or more inputs and one output can be used in an OR gate.
1. The logic of this gate is that if at least one of the inputs is 1, the output will be 1.
2. The OR gate’s output will be given by the following mathematical procedure if there are two inputs A
and B: Y=A+B Truth Table
Input Output
A B A OR B
Symbol of OR gate 0 0 0
0 1 1
1 0 1
Therefore, in the OR gate, the output is high when any of the inputs is high.
1 1 1
PREPARED BY AMLAKIE A. 18
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
NOT Gate
The NOT gate is a basic one-input, one-output gate.
1. When the input is 1, the output is 0, and vice versa. A NOT gate is sometimes called an inverter because
of its feature.
2. If there is only one input A, the output may be calculated using the Boolean equation Y=A’.
Input Output
Symbol of NOT gate A Not A
0 1
A NOT gate, as its truth table shows, reverses the input signal. 1 0
PREPARED BY AMLAKIE A. 19
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
1. This gate’s output is 1 only when all of its inputs are 0. Alternatively, when all of the inputs are low, the
output is high.
2. The Boolean statement for the NOR gate is Y=(A+B)’ if there are two inputs A and B.
Input Output
A B A NOR B
0 0 1
1 0 0
By comparing the truth tables, we can observe that the outputs of the NOR gate are the
1 1 0
polar opposite of those of an OR gate. The NOR gate is sometimes known as a universal
gate since it may be used to implement the OR, AND, and NOT gates.
PREPARED BY AMLAKIE A. 20
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
NAND Gate
A NAND gate, sometimes known as a ‘NOT-AND’ gate, is essentially a Not gate followed by an AND gate.
1. This gate’s output is 1 only if none of the inputs is 1. Alternatively, when all of the inputs are not high
and at least one is low, the output is high.
2. If there are two inputs A and B, the Boolean expression for the NAND gate is Y=(A.B)’
Input Output
A B A NAND B
0 1 1
1 0 1
1 1 0
By comparing their truth tables, we can observe that their outputs are the polar opposite of an AND gate. The
NAND gate is known as a universal gate because it may be used to implement the AND, OR, and NOT gates.
PREPARED BY AMLAKIE A. 21
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
1. If any of the inputs is ‘High,’ the output of the XOR Gate is ‘High.’ If both inputs are ‘High,’ the output
is ‘Low.’ If both inputs are ‘Low,’ the output is ‘Low.’
2. The Boolean equation for the XOR gate is Y=A’.B+A.B’ if there are two inputs A and B.
Input Output
A B A XOR B
0 0 0
0 1 1
Symbol of XOR gate
1 0 1
1 1 0
Its outputs are based on OR gate logic, as we can see from the truth table.
PREPARED BY AMLAKIE A. 22
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
XNOR Gate
The Exclusive-NOR or ‘EX-NOR’ gate is a digital logic gate that accepts more than two inputs but only outputs
one.
1. If both inputs are ‘High,’ the output of the XNOR Gate is ‘High.’ If both inputs are ‘Low,’ the output is
‘High.’ If one of the inputs is ‘Low,’ the output is ‘Low.’
2. If there are two inputs A and B, then the XNOR gate’s Boolean equation is: Y=A.B+A’B’.
Input Output
A B A XNOR B
0 0 1
0 1 0
Symbol of XNOR gate
1 0 0
The truth table shows that its outputs are based on NOR gate logic.
1 1 1
PREPARED BY AMLAKIE A. 23
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 24
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Chapter Exercise
1. Convert the binary number 1001.0010 to decimal.
2. Explain in detail: a. The difference between 1’s and 2’s complement. b. The advantage of 2’s
complement over 1’s complement.
3. What is the procedure for converting a decimal number to 2's complement representation?
4. Represent ±165 decimal number using sing-magnitude and 2’s techniques with an appropriate bit size.
5. Convert the given Octal 7652 to an equivalent hexadecimal
6. Convert 8B3F to binary.
7. Which one is the proper odd parity bit to the code 111001: A. 1111011 B. 0111111 C. 1111001 D.
0011111 E. None
8. Convert the following binary number to octal: 010111100
9. Convert the given binary, 1100101000110101 to hexadecimal.
10. Generate a truth table and Boolean expression for a three-input AND and OR gate.
11. Implement the AND, OR,NOT , NOR, XOR and XNOR gates using the universal NANAD gate.
PREPARED BY AMLAKIE A. 25
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
CHAPTER TWO
BOOLEAN ALGEBRA
BOOLEAN OPERATIONS AND EXPRESSIONS
Variable, complement, and literal are terms used in Boolean algebra. A variable is a symbol used to
represent a logical quantity. Any single variable can have a 1 or a 0 value. The complement is the
inverse of a variable and is indicated by a bar over variable (overbar). For example, the complement
of the variable A is A. If A = 1, then A = 0. If A = 0, then A = 1. The complement of the variable A
is read as "not A" or "A bar." Sometimes a prime symbol rather than an overbar is used to denote the
complement of a variable; for example, B' indicates the complement of B. A literal is avariable or
the complement of a variable.
Boolean Addition
Recall from part 3 that Boolean addition is equivalent to the ORoperation. In Boolean algebra, a sum
term is a sum of literals. In logic circuits, a sum term is produced by an OR operation with no AND
operations involved. Some examples of sum terms are A + B, A + B, A + B + C, and A + B + C
+ D.
A sum term is equal to 1 when one or more of the literals in the term are 1. A sum term is equal to 0
only if each of the literals is 0.
PREPARED BY AMLAKIE A. 26
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Boolean Multiplication
Also recall from part 3 that Boolean multiplication is equivalent to the AND operation. In Boolean
algebra, a product term is the product of literals. In logic circuits, a product term is produced by an
AND operation with no OR operations involved. Some examples of product terms are AB, AB,
ABC, and ABCD.
A product term is equal to 1 only if each of the literals in the term is 1. Aproduct term is equal
to 0 when one or more of the literals are 0.
Example
Determine the values of A, B, C, and D that make the product term ABCDequal to 1.
PREPARED BY AMLAKIE A. 27
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 28
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Associative Laws :
► The associative law of addition is written as follows for three variables: A + (B + C) = (A + B)
+C
This law states that when ORing more than two variables, the result is the same regardless of the
grouping of the variables. Fig.(4-3), illustrates thislaw as applied to 2-input OR gates.
PREPARED BY AMLAKIE A. 29
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
This law states that it makes no difference in what order the variables are grouped when ANDing
more than two variables. Fig. below illustrates this law as applied to 2-input AND gates.
PREPARED BY AMLAKIE A. 30
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Distributive Law:
► The distributive law is written for three variables as follows:A(B + C) = AB + AC
This law states that ORing two or more variables and then ANDing the result with a single variable
is equivalent to ANDing the single variable with each of the two or more variables and then ORing
the products. The distributive law also expresses the process of factoring in which the common
variable A is factored out of the product terms, for example,
AB + AC = A(B + C).
Fig. below illustrates the distributive law in terms of gateimplementation.
Rules 1 through 9 will be viewed in terms of their application to logic gates. Rules 10 through 12
will be derived in terms ofthe simpler rules and the laws previously discussed.
PREPARED BY AMLAKIE A. 32
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Rule 1. A+0=A
A variable ORed with 0 is always equal to the variable. If the input variable A is 1, the output variable
X is 1, which is equal to A. If A is 0, the output is 0, which is also equal to A. This rule is illustrated
in Fig.(4-6), where the lower input is fixed at 0.
Fig.(4-6)
Rule 2. A+1=1
A variable ORed with 1 is always equal to 1. A 1 on an input to an OR gate produces a 1 on the
output, regardless of the value of the variable on the other input. This rule is illustrated in Fig.(4-7),
where the lower input is fixedat 1.
PREPARED BY AMLAKIE A. 33
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Fig.(4-7)
Rule 3. A.0=0
A variable ANDed with 0 is always equal to 0. Any time one input to an AND gate is 0, the output
is 0, regardless of the value of the variable on the other input. This rule is illustrated in Fig.(4-8),
where the lower input is fixedat 0.
Fig.(4-8)
Rule 4. A.1=A
A variable ANDed with 1 is always equal to the variable. If A is 0 the outputof the AND gate is 0. If
PREPARED BY AMLAKIE A. 34
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
A is 1, the output of the AND gate is 1 because both inputs are now 1s. This rule is shown in Fig.(4-
9), where the lower input is fixed at 1.
Rule 5. A+A=A
A variable ORed with itself is always equal to the variable. If A is 0, then 0
+ 0 = 0; and if A is 1, then 1 + 1 = 1. This is shown in Fig.(4-10), where bothinputs are the same
variable.
Rule 6. A+A=1
A variable ORed with its complement is always equal to 1. If A is 0, then 0 +0 = 0 + 1 = 1. If A is
l, then 1 + 1 = 1+ 0 = 1. See Fig.(4-11), where oneinput is the complement of the other.
PREPARED BY AMLAKIE A. 35
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Rule 7. A.A=A
A variable ANDed with itself is always equal to the variable. If A = 0, then 0.0 = 0; and if A =
1. then 1.1 = 1. Fig.(4-12) illustrates this rule.
Rule 8. A.A=0
A variable ANDed with its complement is always equal to 0. Either A or Awill always be 0: and
when a 0 is applied to the input of an AND gate. the output will be 0 also. Fig.(4-13) illustrates this
rule.
Rule 9 A=A
The double complement of a variable is always equal to the variable. If you start with the variable A
and complement (invert) it once, you get A. If you then take A and complement (invert) it, you get
A, which is the original variable. This rule is shown in Fig.(4-14) using inverters.
PREPARED BY AMLAKIE A. 36
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Rule 10. A + AB = A
This rule can be proved by applying the distributive law, rule 2, and rule 4 asfollows:
A + AB = A( 1 + B) Factoring (distributive law)
=A.l Rule 2: (1 + B) = 1
=A Rule 4: A . 1 = A
The proof is shown in Table 4-2, which shows the truth table and theresulting logic circuit
simplification.
PREPARED BY AMLAKIE A. 37
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Rule 11. A + AB = A + B
This rule can be proved as follows:
A + AB = (A + AB) + AB Rule 10: A = A + AB
= (AA + AB) + AB Rule 7: A = AA
=AA +AB +AA +AB Rule 8: adding AA = 0
= (A + A)(A + B) Factoring
= 1. (A + B) Rule 6: A + A = 1
=A + B Rule 4: drop the 1
The proof is shown in Table 4-3, which shows the truth table and theresulting logic circuit
simplification.
PREPARED BY AMLAKIE A. 38
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Table 4-3
PREPARED BY AMLAKIE A. 39
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
The proof is shown in Table 4-4, which shows the truth table and theresulting logic circuit
simplification.
PREPARED BY AMLAKIE A. 40
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
DEMORGAN'S THEOREMS
DeMorgan, a mathematician who knew Boole, proposed two theorems that are an important part of
Boolean algebra. In practical terms. DeMorgan's theorems provide mathematical verification of the
equivalency of the NANDand negative-OR gates and the equivalency of the NOR and negative-AND
gates, which were discussed in part 3.
One of DeMorgan's theorems is stated as follows:
The complement of a product of variables is equal to the sum of thecomplements of the
variables,
Stated another way,
The complement of two or more ANDed variables is equivalent to the OR of the complements of
the individual variables.
The formula for expressing this theorem for two variables isXY = X + Y
DeMorgan's second theorem is stated as follows:
The complement of a sum of variables is equal to the product of thecomplements of the variables.
Stated another way,
PREPARED BY AMLAKIE A. 41
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
The complement of two or more ORed variables is equivalent to the ANDof the complements of
the individual variables,
The formula for expressing this theorem for two variables is X + Y = X Y
Fig. shows the gate equivalencies and truth tables for the twoequations above.
Fig.(4-15) Gate equivalencies and the corresponding truth tables that illustrate DeMorgan's theorems.
PREPARED BY AMLAKIE A. 42
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
As stated, DeMorgan's theorems also apply to expressions in which there are more than two variables.
The following examples illustrate the application of DeMorgan's theorems to 3-variable and 4-
variable expressions.
Applying DeMorgan's Theorems
The following procedure illustrates the application of DeMorgan's theoremsand Boolean algebra
to the specific expression
Example
The Boolean expression for an exclusive-OR gate is AB + AB. With this as a starting point, use
DeMorgan's theorems and any other rules or laws that are applicable to develop an expression for the
exclusive-NOR gate.
BOOLEAN ANALYSIS OF LOGIC CIRCUITS
Boolean algebra provides a concise way to express the operation of a logic circuit formed by a
combination of logic gates so that the output can be determined for various combinations of input
values.
PREPARED BY AMLAKIE A. 43
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 44
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Fig. A logic circuit showing the development of the Booleanexpression for the output.
Constructing a Truth Table for a Logic Circuit
Once the Boolean expression for a given logic circuit has been determined, a truth table that shows
the output for all possible values of the input variables can be developed. The procedure requires that
you evaluate the Boolean expression for all possible combinations of values for the input variables.
In the case of the circuit in Fig.(4-16), there are four input variables (A, B, C, and D) and therefore
sixteen (24 = 16) combinations of values are possible.
Putting the Results in Truth Table format
The first step is to list the sixteen input variable combinations of 1sand 0s in a binary sequence as
shown in Table 4-5. Next, place a 1 in the output column for each combination of input variables
that was determined in the evaluation. Finally, place a 0 in the output column for all other
combinations of input variables. These results are shown in the truth table below
PREPARED BY AMLAKIE A. 45
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 46
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Solution
Step 1: Apply the distributive law to the second and third terms in theexpression, as follows:
AB + AB + AC + BB + BC
Step 2: Apply rule 7 (BB = B) to the fourth term.
AB + AB + AC + B + BC
Step 3: Apply rule 5 (AB + AB = AB) to the first two terms.
AB + AC + B + BC
Step 4: Apply rule 10 (B + BC = B) to the last two terms.
AB + AC + B
Step 5: Apply rule 10 (AB + B = B) to the first and third terms.
B+AC
PREPARED BY AMLAKIE A. 47
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 48
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 49
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
(b) (A + B)(B + C + D)
(c) (A + B) + C
PREPARED BY AMLAKIE A. 50
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 51
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 52
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
is a standard POS expression. Any nonstandard POS expression (referred to simply as POS) can be
converted to the standard form using Boolean algebra.
Converting a Sum Term to Standard POS
Each sum term in a POS expression that does not contain all the variables in the domain can be
expanded to standard form to include all variables in the domain and their complements. As stated
in the following steps, a
PREPARED BY AMLAKIE A. 53
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
GG nonstandard POS expression is converted into standard form using Boolean algebra rule 8 (A A
= 0) from Table 4-1:
Step 1. Add to each nonstandard product term a term made up of the product of the missing variable
and its complement. This results in two sum terms. As you know, you can add 0 to anything without
changing its value.
Step 2. Apply rule 12 from Table 4-1: A + BC = (A + B)(A + C)
Step 3. Repeat Step 1 until all resulting sum terms contain all variables in the domain in either
complemented or noncomplemented form.
B + C + D = B + C + D + AA = (A + B + C + D)(A + B + C + D)
The third term, A + B + C + D, is already in standard form. The standard POS form of the original
expression is as follows:
PREPARED BY AMLAKIE A. 54
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Exercise
PREPARED BY AMLAKIE A. 55
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 56
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
F = m1 + m4 + m7
PREPARED BY AMLAKIE A. 57
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example
Express the Boolean function F = A + BC’ in a sum of minterms (SOP).
Solution
The term A is missing two variables because the domain of F is
PREPARED BY AMLAKIE A. 58
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
BC missing A, so
BC(A + A) = ABC + ABCAB(C + C) = ABC +
ABCAB(C + C) = ABC + ABC
F = ABC + ABC + ABC + ABC + ABC + ABC
Because A + A = A
F = ABC + ABC + ABC + ABC + ABC
F = m7 + m6 + m5 + m4 + m1
In short notation
F(A, B, C) = ∑(1, 4, 5, 6, 7)
F(A, B, C) = ∑(0, 2, 3)
The complement of a function expressed as the sum of minterms equalto the sum of
minterms missing from the original function.
PREPARED BY AMLAKIE A. 59
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
A B C B BC F
0 0 0 0 1 0 0
1 0 0 1 1 1 1
2 0 1 0 0 0 0
3 0 1 1 0 0 0
4 1 0 0 1 0 1
5 1 0 1 1 1 1
6 1 1 0 0 0 1
7 1 1 1 0 0 1
PREPARED BY AMLAKIE A. 60
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example
Express F = xy + xz in a product of maxterms form.Solution
F = xy + xz = (xy + x)(xy + z) = (x + x)(y + x)(x + z)(y + z)remember x + x = 1
F = (y + x)(x + z)(y + z)
F = (x + y + zz)(x + yy + z )(xx + y + z)
F = (x + y + z)(x + y + z)(x + y + z)(x + y + z)(x + y +z)(x + y + z)
========== ------------------ ---------------- ==========
PREPARED BY AMLAKIE A. 61
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example
Develop a truth table for the standard SOP expression ABC + ABC + ABC.
PREPARED BY AMLAKIE A. 62
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 63
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 64
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 65
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
(a) (b)
Fig. A 4-variable Karnaugh map.
PREPARED BY AMLAKIE A. 66
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Cell Adjacency
The cells in a Karnaugh map are arranged so that there is only a single- variable change between
adjacent cells. Adjacency is defined by a single- variable change. In the 3-variable map the 010 cell
is adjacent to the 000 cell, the 011 cell, and the 110 cell. The 010 cell is not adjacent to the 001 cell,
the 111 cell, the 100 cell, or the 101 cell.
Fig. Adjacent cells on a Karnaugh map are those that differ by only one variable. Arrows point between adjacent cells.
PREPARED BY AMLAKIE A. 67
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
(B)
(A)
PREPARED BY AMLAKIE A. 68
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example
Solution
The SOP expression is obviously not in standard form because each productterm does not have three
variables. The first term is missing two variables, the second term is missing one variable, and the
third term is standard. Firstexpand the terms numerically as follows:
PREPARED BY AMLAKIE A. 69
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example
Map the following SOP expression on a Karnaugh map:
Solution
The SOP expression is obviously not in standard form because each productterm does not have four
variables.
Map each of the resulting binary values by placing a 1 in the appropriate cellof the 4- variable
Karnaugh map.
PREPARED BY AMLAKIE A. 70
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 71
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example:
Group the 1s in each of the Karnaugh maps in Fig below.
Fig.
Solution:
The groupings are shown in Fig.(5-7). In some cases, there may be morethan one way to group the
1s to form maximum groupings.
PREPARED BY AMLAKIE A. 72
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 73
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Fig.(5-8)
PREPARED BY AMLAKIE A. 74
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
The truth table in Fig.(5-9)(a) describes a logic function that has a 1 output only when the BCD code for
7,8, or 9 is present on the inputs. If the "don't cares" are used as 1s, the resulting expression for the
PREPARED BY AMLAKIE A. 75
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
function is A + BCD, as indicated in part (b). If the "don't cares" are not used as 1s, the resulting
expression is ABC + ABCD: so you can see the advantage of using "don'tcare" terms to get the simplest
expression.
PREPARED BY AMLAKIE A. 76
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
In this section, we will focus on POS expressions. The approaches are much the same except that with
POS expressions, 0s representing the standard sum terms are placed on the Karnaugh map instead of
1s.
For a POS expression in standard form, a 0 is placed on the Karnaugh map for each sum term in the
expression. Each 0 is placed in a cell corresponding to the value of a sum term. For example, for the
sum term A + B + C, a 0goes in the 0 1 0 cell on a 3-variable map.
When a POS expression is completely mapped, there will be a number of 0s on the Karnaugh map
equal to the number of sum terms in the standard POS expression. The cells that do not have a 0 are
the cells for which the expression is 1. Usually, when working with POS expressions, the 1s are left
off. The following steps and the illustration in Fig.(5-10) show the mapping process.
Step 1. Determine the binary value of each sum term in the standard POS expression. This is the binary
value that makes the term equal to 0.
Step 2. As each sum term is evaluated, place a 0 on the Karnaugh map in the corresponding cell.
PREPARED BY AMLAKIE A. 77
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example:
Map the following standard POS expression on a Karnaugh map:
Solution:
PREPARED BY AMLAKIE A. 78
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 79
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
The process for minimizing a POS expression is basically the same as for an SOP expression except
that you group 0s to produce minimum sum terms instead of grouping 1s to produce minimum product
terms. The rules for grouping the 0s are the same as those for grouping the 1s that you learned before.
Example:
Use a Karnaugh map to minimize the following standard POS expression:Also, derive the
equivalent SOP expression.
Solution:
Example: Using a Karnaugh map, convert the following standard POS expression into a minimum POS expression, a
standard SOP expression, and a minimum SOP expression.
PREPARED BY AMLAKIE A. 80
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 81
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 82
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Boolean functions with five variables can be simplified using a 32-cell Karnaugh map. Actually, two 4-
variable maps (16 cells each) are used to construct a 5-variable map. You already know the cell adjacencies
within each of the 4- variable maps and how to form groups of cells containing 1s to simplify an SOP
expression. All you need to learn for five variables is the cell adjacencies between the two 4-variable maps
and how to group those adjacent 1s.
A Karnaugh map for five variables (ABCDE) can be constructed using two 4-variable maps with which
you are already familiar. Each map contains 16 cells with all combinations of variables B, C, D, and E. One
map is for A = 0 and the other is for A = 1, as shown in Fig.(5-11).
Cell Adjacencies
You already know how to determine adjacent cells within the 4-variablemap. The best way to visualize
cell adjacencies between the two 16-cel1 maps is to imagine that the A = 0 map is placed on top of the A
= 1 map. Each cell in the A = 0 map is adjacent to the cell directly below it in the A =1 map, see Fig.(5-
12).
PREPARED BY AMLAKIE A. 83
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 84
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Example:
Use a Karnaugh map to minimize the following standard SOP 5-variableexpression:
PREPARED BY AMLAKIE A. 85
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Chapter Exercise
1. Generate a truth table for the following min and max terms of the Boolean functions.
4. Minimize the function in SOP & POS forms using K-map and plot the logic diagram for both the given Boolean function and the
simplified expressions
PREPARED BY AMLAKIE A. 86
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
CHAPTER THREE
Combinational Logic Circuits
INTRODUCTION
In digital circuit theory, sequential logic is a typeof logic circuit whose output depends not only on the present
value of its input signals but on the sequence of past inputs, the input history as well. This is in contrast to
combinational.
A combinational logic circuit performs an operation assigned logically by a Boolean expression or truth table.
Examples of common combinational logic circuits include: half adders, full adders, multiplexers,
demultiplexers, encoders and decoders
Half adder
An adder is a digital circuit that performs addition of numbers. Half adder has only two
inputs and two outputs. The half adder adds two binary digits called as augend and addend and
produces two outputs as sum and carry; XOR is applied to both inputs to produce sum and AND
gateis applied to both inputs to produce carry.
PREPARED BY AMLAKIE A. 87
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
• By using half adder, you can design simple addition with the help of logic gates.
Truth Table
PREPARED BY AMLAKIE A. 88
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Half adder is a simple combinational circuit used to add two single bits. It accepts two inputs and
produce two outputs that is a sum output and a carry output. A half adder consists of two logic
gates 1) XOR and 2) AND gate. And the carry operation performed by AND gate thus carry out
put will be A+B.
PREPARED BY AMLAKIE A. 89
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
FULL ADDER
The full adder adds 3 one bit numbers, where two can be referred to as operands and one
can be referred to as bit carried in. Itproduces 2-bit output and these can be referred to as
output carry and sum.
The full-adder has three inputs and two outputs. The first two inputs are A and B and the
third input is an input carry as C-IN. When a full-adder logic is designed, you string eight of
them together to create a byte-wide adder and cascade the carry bit from one adder to the
next.
Truth Table
Block Diagram
PREPARED BY AMLAKIE A. 90
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Logic diagram
PREPARED BY AMLAKIE A. 91
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
With the truth-table, the full adder logic can be implemented. You can see that the output S is
an XOR between the input A and the half-adder, SUM output with B and C-IN inputs. We take
C-OUT will only be true if any of the two inputs out of the three are HIGH.
So, we can implement a full adder circuit with the help of two half addercircuits. At first, half
adder will be used to add A and B to produce a partial Sum and a second half adder logic can
be used to add C-IN to the Sum produced by the first half adder to get the final S output. If any
of the half adder logic produces a carry, there will be an output carry. So, C-OUT will be
an OR function of the half-adder Carry outputs.
The implementation of larger logic diagrams is possible with the above full adder logic a
simpler symbol is mostly used to represent the operation.Given below is a simpler schematic
representation of a full adder.
PREPARED BY AMLAKIE A. 92
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 93
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
PREPARED BY AMLAKIE A. 94
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
• FOUR-BIT BINARY PARALLEL ADDER is a circuit in whichtwo binary numbers each of n bits
can be added by means of a full adder circuit. Consider the example that two 4-bit
binary numbers B 4B 3B 2B 1 and A 4A 3A 2A 1 are to be added with a carry input C1.
• A group of four bits is called a nibble. A basic 4-bit parallel adder is implemented with four full-adder
stages as shown in Figure.
PREPARED BY AMLAKIE A. 95
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Again, the LSBs (A1 and B1) in each number being added go into the right- most full-adder: the higher-order
bits are applied as shown to the successively higher-order adders, with the MSBs (A4 and B4) in each number
being applied to the left-most full-adder. The carry output of each adder is connected to the carry input of the
next higher-order adder as indicated. These are called internal carries. In keeping with most manufacturers' data
sheets, the input labeled C, is the input carry to the least significant bit adder; C4 in the case of four bits, is the
output carry of the most significant bit adder; and ∑1 (LSB) through ∑4 (MSB) are the sum outputs. The logic
symbol for 4-bit parallel adder is shown in Figure.
Two binary numbers each of n bits can be added by means of a full adder circuit. Consider the example that
two 4-bit binary numbers B 4B 3B 2B 1 and A4 A 3A 2A 1 are to be added with a carry input C 1. This can
be done by cascading four full adder circuits as shown in figure. The least significant bitsA 1, B 1, and C 1
are added to the produce sum output S 1 and carry output C 2. Carry output C 2 is then added to the next
significant bits A 2 and B 2 producing sum output S 2 and carry output C 3. C 3 is then added to A 3 and B 3 and
so on. Thus finally producing the four-bit sum output S 4S 3S 2S 1 and final carry output Cout. Such type of
PREPARED BY AMLAKIE A. 96
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Half Subtractor:
A half subtractor is an arithmetic circuit that subtracts two bits and produces their difference. The
circuit has two inputs minuend (X) and subtrahend (Y) and two output bits, one is the difference
bit (D) and the other is the borrow bit (B).
As like addition operation of 2 binary digits, which produces SUM and CARRY, the subtraction
of 2 binary digits also produces two outputs which are termed as difference and borrow. The
simplest possible subtraction of 2-bit binary digits consists of four possible operations, they are
0-0, 0-1, 1-0 and 1-1. The operations 0-0, 1-0 and 1-1 produces a subtraction of 1-bit output
whereas, the remaining operation 0-1 produces a 2-bit output. They are referred as
difference and borrow bit respectively. This borrow bit is used for subtraction of the next higher
pair bit. So, we can define half subtractor as a combinational circuit which is capable of performing
subtraction of 2-bit binary digits is known as a half subtractor. Here, the binary digit from which
the other digit is subtracted is called minuend and the binary digit which is to be subtracted is
PREPARED BY AMLAKIE A. 97
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
D = (X’Y + XY’) = X ⊕ Y
B = X’Y
PREPARED BY AMLAKIE A. 98
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
Full Substractor
A full subtractor is a combinational circuit that performs a subtraction between two bits, taking
into account that a 1 may have been borrowedby a lower significant bit. The circuit has three inputs
and two outputs.
Input variables are minuend (X), subtrahend (Y), and previous borrow (Z); output variables are
difference (D) and output borrow (B).
PREPARED BY AMLAKIE A. 99
DIGITAL LOGIC DESIGN MODULE FOR 5TH YEAR ECE STUDENTS
It performs the operation X – Y – Z. It should be noted that the weight of the output borrow bit is
-2, while the weight of the output differencebit is +1. The truth table of the full subtractor is shown.
When there is a situation where the minuend and subtrahend number contains more significant bit, then the
borrow bit which is obtained from the subtraction of 2-bit binary digits is subtracted from the next higher order
pair of bits. In such situation, the subtraction involves the operation of 3 bits. Such situation of subtraction can’t
handle by asimple half subtractor. So, combining two half subtractor we can form another combinational circuit
which can perform this type of operation. This circuit is known as the full subtractor.
So we can define full subtractor as a combinational circuit which takes three inputs and produces two outputs
difference and borrow. Aboveis the truth table of the full subtractor, we have used three input variables X, Y
and Z which refers to the term minuend, subtrahend and borrow bit respectively. The two
outputs difference and borrow are named as D and B respectively.
The construction of full subtractor circuit diagram involves two half subtractor joined by an OR gate as shown
in the above circuit diagram of the full subtractor. The two borrow bits generated by two separate half
subtractor are fed to the OR gate which produces the final borrow bit. The final difference bit is the combination
of the difference output of the first half adder and the next higher order pair of bits.
In this module you will learn about the basic architecture of multiplexer and demultiplexers along with real
life applications.
Multiplexer
Multiplexer means many to one. A multiplexer (MUX) is a combinational circuit which is often used when the
information from many sources must be transmitted over long distances and it is less expensive to multiplex
data onto a single wire for transmission. Multiplexer can be considered as multi-position or rotary switch as
shown in fig. 2. There are n – inputs and one output. The switch position is controlled by the selector lines. The
select inputs decide which input is connected to the output.
Multiplexer are also called as DATA Selector or router because it accepts several data inputs and allows only one
of them to get through to the output at a time. The basic multiplexer has n input lines and single output line. It also
has m – select or control lines. The relation between number of select lines and number of data inputs are
2m = n. As multiplexer selects one out of many, it is often called as 2m to 1 line converter.
Applications of multiplexers
Multiplexer or data selectors are combinational circuits which transfer data from many sources to output under the
control of data select lines. Multiplexer has many applications right from data routing, time division multiplexing,
function generator to parallel to serial converter etc. A single multiplexer can replace several logic gates ICs,
saving PCB area, interconnections, design efforts and cost. A list of popular applications is given below.
1. Data routing 5. Parallel to serial converter
2. Data bussing 6. Cable TV signal distribution
3. Switch setting comparator 7. Telephone network
4. Multiplexer as a function generator 8. Sharing printer /resources
Demultiplexer
Demultiplexer has a single input and n output lines. Demultiplexer can be visualized as reverse multi-position
switch. The select lines permit input data from single line to be switched to any one of the many output lines as
shown in fig. below.
Applications of Demultiplexers
Digital demultiplexers are combinational devices controlled by a selector address that routes input data to one of
many outputs of the demultiplexers. These can be used in following applications.
Decoder
A decoder is a combinational circuit that converts binary information from n input lines to a maximum of 2n unique
output lines.
CHAPTER FOUR
Sequential Logic Circuits
Digital electronics is classified into combinational logic and sequential logic.
Combinational logic output depends on the present inputs’ levels, whereas sequential logic output not only
depends on the input levels, but also stored levels (previous output history).
A sequential circuit consists of a combinational circuit and feedback through the storage elements
in the circuit.
state.
S=1, R=1 Q & Q’= Remember If both the values of S and R are switched to 1 it is an invalid state because the
values of both Q and Q’ are 1. They are supposed to be compliments of each other. Normally, this state must
be avoided. Another reason why we do not want both inputs to be asserted i.e. R=S=1 is that when they are
both asserted, Q is equal to Q', but we usually want Q to be the inverse of Q'. the following are NOR and
NAND gate latch
Here, Q(t) & Q(t+1) are present state & next state respectively. So, SR flip-flop can be used for one of these
three functions such as Hold, Reset & Set based on the input conditions, when positive transition of clock
signal is applied. The following table shows the characteristic table of SR flip-flop.
J-K FLIP-FLOP
A J-K flip flop can also be defined asa modification of the S-R flip flop. The only difference is that the
intermediate state is more refined and precise than that of a S-R flip flop. The behavior of inputs J and K is
same as the S and R inputs of the S-Rflip flop. The letter J stands for SET and the letter K stands for
CLEAR.
JK flip-flops are very similar to SR flip-flops. The J input is just like the S input in that when asserted, it sets
the flip-flop. Similarly, the K input is like the R input where it clears the flip-flop when asserted. The only
difference is when both inputs are asserted. For the SR flip-flop, the next state is undefined, whereas, for the
JK flip-flop, the next state is the inverse of the current state. In other words, the JK flip- flop toggles its state
when both inputs are asserted. The circuit, truth table and the logic symbol for the JK flip-flop is shown in
Figure. When both the inputs J and K have a HIGH state, the flip-flop switch to the complement state. So, for
a value of Q = 1, it switches to Q=0 and fora value of Q = 0, it switches to Q=1.
The output may be repeated in transitions once they have been complimented for J=K=1 because of
the feedback connection in the JK flip-flop.
D TYPE FLIP-FLOP:
Latches are often called level-sensitive because their output follows their inputs as long as they
are enabled. They are transparent during this entire time when the enable signal is asserted.
There are situationswhen it is more useful to have the output change only at the rising or
falling edge of the enable signal. This enable signal is usually the controlling clock signal.
Thus, we can have all changes synchronized to the rising or falling edge of the clock. An edge-
triggered flip-flop achieves this by combining in series a pair of latches.
Figure shows a positive edge-triggered D flip-flop where two D latches are connected in series and a
clock signal Clk is connected to the E input of the latches, one directly, and one through an inverter.
The first latch is called the master latch. The master latch is enabled when Clk = 0 and follows the
primary input D. When Clk is a 1, the master latch is disabled but the second latch, called the slave
latch, is enabled so that the output from the master latch is transferred to the slave latch. The slave
latch is enabled all the while that Clk = 1, but its content changes only at the beginning of the cycle,
that is, only at the rising edge of the signal because once Clk is 1, the master latch is disabled and so
the input to the slave latch will not change. If the slave latchis enabled when the clock is low, then it
is referred to as a negative edge-triggered flip-flop. The circuit of Figure 10(a) is also referred to asa
master-slave D flip-flop because of the two latches used in the circuit. Figure 10(b) and (c) show the
truth table and the logic symbol respectively. Figure 10(d) shows the timing diagram for the D flip-
flop. The circuit diagram and truthtable is given in figure D flip flop is actually a slight modification
of the above explained clocked SR flip-flop. From the figure you can see that the D input is
connected to the S input and the complement of the D input is connected to the R input. The D input
is passed on tothe flip flop when the value of CPis ‘1’. When CP is HIGH, the flip flop moves to the
SET state. If it is ‘0’,the flip flop switches to the CLEAR state.
D Q(t + 1)
0 0
1 1
T type Flip-Flop:
The T flip-flop has one input in addition to the clock. T stands for toggle for the obvious reason. When
T is asserted (T = 1), the flip-flop state toggles back and forth, and when T is de-asserted, the flip-flop
keeps its current state. The T flip-flop can be constructed using a D flip-flop with the two outputs Q and
Q' feedback to the D input through a multiplexer that is controlled by the T input as shown in Figure
below. This is a much simpler version of the J-K flip flop. Both the J and K inputs are connected together
and thus are also called a single input J- K flip flop. When clock pulse is given to the flip flop, the output
begins to toggle. Here also the restriction on the pulse width can be eliminated with a master-slave or
edge-triggered construction. Take a look at the circuit and truth table is shown in figure. The flip-flops
can be described fully and uniquely by its logic symbol, characteristic table, characteristic equation, state
diagram, or excitation table, and are summarized in Figure below.
State Diagram
In addition to graphical symbols, tables or equations, flip-flops can also be represented graphically
by a state diagram. In this diagram, a state is represented by a circle, and the transition between states
is indicated by directed lines (or arcs) connecting the circles. The binary number inside each circle
identifies the state the circle represents. The directed lines are labelled with two binary numbers
separated by a slash (/). The input value that causes the state transition is labelled first. The number
after the slash symbol / gives the value of the output. For example, the directed line from state 00 to
01 is labelled 1/0, meaning that, if the sequential circuit is in a present state and the input is 1, then
the next state is 01 and the output is 0. If it is in a present state 00 and the input is 0, it will remain in
that state. A directed line connecting a circle with itself indicates that no change of state occurs. The
state diagram provides exactly the same information as the state table and is obtained directly from
the state table.
State Equations
The behavior of a clocked sequential circuit can be described algebraically by means of state
equations. A state equation specifies the next state as a function of the present state and inputs.
Consider the sequential circuit shown in Fig. below. It consists of two D flip-flops A and B, an input
x and an output y.
These equations can be used to form the state table. Suppose the present state (i.e.Q1Q2) = 00 and
input x = 0. Under these conditions, we get Z = 0, D1 = 1, and D2 = 1. Thus the next state of the
circuit D1D2 = 11, and this will be the present state after the clock pulse has been applied. The output
of the circuit corresponding to the present state Q1Q2 = 00 and x = 1 is Z = 0. This data is entered
into the state table as shown in Table.
A clocked sequential circuit consists of a group of flip‐flops and combinational gates. The
flip‐flops are essential because, in their absence, the circuit reduces to a purely combinational
circuit (provided that there is no feedback among the gates). A circuit with flip‐flops is
considered a sequential circuit even in the absence of combinational gates. Circuits that
include flip‐flops are usually classified by the function they perform rather than by the name
of the sequential circuit. Two such circuits are registers and counters.
Chapter Exercise
Do analysis for the following sequential Circuits.
A
J Q Ax T Q y
x R Q
K Q
J Q B T Q
B
R Q
K Q
(A) (B)
CHAPTER FIVE
REGISTERS AND COUNTERS
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.
Shift registers are a type of sequential logic circuit, mainly for storage of digital data. They are a
group of flip-flops connected in a chain so that the output from one flip-flop becomes the
input of the next flip-flop. Most of the registers possess no characteristic internal sequence of
states. All the flip-flops are driven by a common clock, and all are set or reset simultaneously.
Shift registers are divided into two types.
significant bit of the data has to be shifted through the register from FF0 to FF3.
Serial in – parallel out shift register
The difference is the way in which the data bits are taken out of the register. Once the data are stored,
each bit appears on its respective output line, and all bits are available simultaneously.
Parallel in – serial out shift register
A four-bit parallel in - serial out shift register is shown below. The circuit uses D flip-flops and
NAND gates for entering data (i.e writing) to the register.)
Parallel in –parallel out shift register
For parallel in - parallel out shift registers, all data bits appear on the parallel outputs immediately
following the simultaneous entry of the data bits. The following circuit is a four-bit parallel in -
parallel out shift register constructed by D flip-flops.
Bidirectional Shift Registers
The registers discussed so far involved only right shift operations. Each right shift operation has the
effect of successively dividing the binary number by two. If the operation is reversed (left shift), this
has the effect of multiplying the number by two. With suitable gating arrangement a serial shift
register can perform both operations. A bidirectional, or reversible, shift register is one in which the
data can be shift either left or right.
COUNTERS
A counter is essentially a register that goes through a predetermined sequence of
binary states. The gates in the counter are connected in such a way as to produce the
prescribed sequence of states. Although counters are a special type of register, it is common to
differentiate them by giving them a different name.
Two of the most common types of shift register counters are introduced here: the Ring counter and
the Johnson counter. They are basically shift registers with the serial outputs connected back to the
serial inputs in order to produce particular sequences. These registers are classified as counters
because they exhibit a specified sequence of states.
Ring Counters
A ring counter is basically a circulating shift register in which the output of the most significant stage
is fed back to the input of the least significant stage. The following is a 4-bit ring counter constructed
from D flip-flops. The output of each stage is shifted into the next stage on the positive edge of a
clock pulse. If the CLEAR signal is high, all the flip-flops except the first one FF0 are reset to 0. FF0
is preset to 1 instead.
Since the count sequence has 4 distinct states, the counter can be considered as a mod-4 counter.
Only 4 of the maximum 16 states are used, making ring counters very inefficient in terms of state
usage. But the major advantage of a ring counter over a binary counter is that it is self-decoding. No
extra decoding circuit is needed to determine what state the counter is in.
Johnson Counters
Johnson counters are a variation of standard ring counters, with the inverted output of the last stage
fed back to the input of the first stage. They are also known as twisted ring counters. An n stage
Johnson counter yields a count sequence of length 2n, so it may be considered to be a mod-2n counter.
The circuit above shows a 4-bit Johnson counter. The state sequence for the counter is given in the
table as well as the animation on the left.
Chapter Exercise
1. Design a sequential circuit with two D flip-flops and one input X with the conditions when:
i. X=0, the state of the circuit remains the same
ii. X=1, the circuit goes through state transitions from
00 01 11 10 back to 00 and repeats.
2. Design a counter with the irregular binary count sequence shown in the state diagram using JK
flip flop.
3. Design the circuit represented by the diagram below. Treat unused states as don’t cares (use JK
flip-flops)