Академический Документы
Профессиональный Документы
Культура Документы
1
Dr. Ihab Talkhan
Cairo University
Faculty of Engineering
Computer Engineering Department
Instructor(s):
3
Dr. Ihab Talkhan
Course contents:
#
Title
Basic Gates
Boolean Algebra
Arithmetic circuits
10
11
12
13
Semiconductor memories
14
15
Assignments
#1
#2
#3
#4
Grading:
Testing dates:
Final test date:
Assistant:
Office hours:
italkhan@cu.edu.eg
italkhan@aucegypt.edu
italkhan@mcit.gov.eg
italkhan@mohp.gov.eg
5
Dr. Ihab Talkhan
Design Cycle
6
Dr. Ihab Talkhan
7
Dr. Ihab Talkhan
8
Dr. Ihab Talkhan
9
Dr. Ihab Talkhan
Course Ouline
Course Outline
Digital Circuits
Digital Design
Hardware Components
Gates
Flip-Flops
Various components of a
Unit)
Combinational
computer Hardware
I/O
Sequential
Control Logic
Memory
10
Dr. Ihab Talkhan
Binary Logic
AND
OR
-Represented by any of
the following notations:
-Represented by any of
the following notations:
NOT
(inverter)
-Represented by a bar
over the variable
X .AND. Y
X .OR. Y
X.Y
X+Y
-Function definition:
XY
XvY
Z is what X is not
-Function definition:
Z = 1 only if X=Y=1
0 otherwise
-Function definition:
Z = 1 if X=1 or Y =1
or both X=Y=1
0 if X=Y=0
11
Dr. Ihab Talkhan
Binary Logic
AND
OR
NOT
(inverter)
-Symbol:
-Symbol
-Symbol
-Truth Table
-Truth Table
-Truth Table
0
0
1
1
0
1
0
1
0
0
0
1
0
0
1
1
0
1
0
1
0
1
1
1
0
1
1
0
12
Dr. Ihab Talkhan
Important Notes
Various binary systems suitable for representing information
in digital components [ decimal & Alphanumeric].
Digital system has a property of manipulating discrete
elements of information, discrete information is contained in
any set that is restricted to a finite number of elements, e.g. 10
decimal digits, the 26 letters of the alphabet, 25 playing cards,
and other discrete quantities.
13
Dr. Ihab Talkhan
14
Dr. Ihab Talkhan
Voltage
5
Intermediate
region,
crossed only
during state
transition
Logic 1 range
2
Transition , occurs
between the two limits
0.8
Logic 0 range
0
time
15
Dr. Ihab Talkhan
16
Dr. Ihab Talkhan
CPU
Central Processing Unit
Control
Unit
Processor
Unit
Input devices
Output devices
18
Dr. Ihab Talkhan
Numbering Systems
A number is base r contains r digits 0,1,2,..(r-1) and is expressed with a
power series in r.
An An1.... A1 Ao . A1 A2 ...
Radix point
19
Dr. Ihab Talkhan
20
Dr. Ihab Talkhan
Decimal Numbers
The decimal number system is of base or radix r = 10, because the
coefficients are multiplied by powers of 10 and the system uses ten distinct
digits [0,1,2,9].
Decimal number is represented by a string of digits, each digit position has an
associated value of an integer raised to the power of 10.
Consider the number (724.5)10
724.5 7 10 2 10 4 10 5 10
2
21
Dr. Ihab Talkhan
312.45 3 5
1 5 2 5 4 5
1
75 5 2 0.8
Radix 5
82.810
Conversion
from base 5
number to its
equivalent
decimal
number
22
Dr. Ihab Talkhan
Octal
Base 8
- It is a base 2 system
with two digits 0 &
1
- It is a base 8 system
with eight digits from
0-7
- The decimal
equivalent can be
found by expanding
the binary number to
a power series with a
base of 2.
- The decimal
equivalent can be
found by expanding
the Octal number to a
power series with a
base of 8.
Hexadecimal
Base 16
- It is a base 16 system
with sixteen digits
from 0 9 plus
A,B,C,D,E,F letters
from the alphabet.
- The decimal
equivalent can be
found by expanding
the Hexadecimal
number to a power
series with a base of
16.
23
Binary Numbers
Converting a Binary number to its equivalent Decimal:
(11010.11)2
11010.112 1 24 1 23 0 22 1 21 0 20 1 21 1 22
16 8 2 0.5 0.25
26.7510
Note that, when a bit is equal to 0, it does not contribute to the sum
during the conversion. Therefore, the conversion to decimal can be
obtained by adding the numbers with powers of two corresponding to
the bits that are equal to 1.
24
Dr. Ihab Talkhan
Computer Units
210 = 1024 is referred to as Kilo K
220 = 1,048,567 is referred to as Mega M
230 is referred to as Giga G
Example: 16M = 224 = 16,777,216
25
Dr. Ihab Talkhan
26
Dr. Ihab Talkhan
Example
Find the binary equivalent of (625)10
625 512 = 113
113 64 = 49
49 32 = 17
17 16 = 1
1 1= 0
512 = 29
64 = 26
32 = 25
16 = 24
1 = 20
MSB
LSB
(625)10 = 29 + 26 + 25 + 24 + 20 = (1001110001)
Position 10
27
Dr. Ihab Talkhan
General Method
If the number includes a radix point, it is necessary to separate it into an
integer part and a fraction part, since each part must be converted
differently.
The conversion of a decimal integer to a number in base r is done by
dividing the number and all successive quotients by r and
accumulating the remainders.
The conversion of a decimal fraction to base r is accomplished by a
method similar to that used for integer, except that multiplication by r
is used instead of division, and integers are accumulated instead of
remainders.
28
Dr. Ihab Talkhan
Example
Find the binary equivalent of (41.6875)10
Separate the number into an integer part & a fraction part.
Integer Part:
2
2
2
2
2
2
remainder
41
20 +
10
5
2+
1
0+
=1
=0
=0
=1
=0
=1
(41)10 = (101001)2
Fraction Part:
Integer
LSB
0.6875 x 2 = 1.3750
0.3750 x 2 = 0.7500
0.7500 x 2 = 1.5000
0.5000 x 2 = 1.0000
MSB
1
0
1
1
LSB
MSB
( .6875)10 = ( .1011)2
Thus: (41.6875)10 L (101001.1011)2
29
Dr. Ihab Talkhan
Important Note
The process of multiplying fractions by r does not
necessarily end with zero, so we must stop at a certain
accuracy , i.e. number of fraction digits, otherwise this process
might go forever.
30
Dr. Ihab Talkhan
Octal Numbers
Octal number system is a base 8 system with eight digits [
0,1,2,3,4,5,6,7 ].
To find the equivalent decimal value, we expand the number in
a power series with a base of 8 .
Example:
(127.4)8
= 1 x 82 + 2 x 81 + 7 x 80 + 4 x 8-1
= (87.5)10
31
Dr. Ihab Talkhan
Hexadecimal Numbers
The Hexadecimal number system is a base 16 system with the
first ten digits borrowed from the decimal system and the
letters A,B,C,D,E,F are used for digits 10,11,12,13,14 and 15
respectively.
To find the equivalent decimal value, we expand the number in
a power series with a base of 16 .
Example:
(B65F)16
Note
It is customary to borrow the needed r digits for the
coefficients from the decimal system, when the base of the
numbering system is less than 10.
The letters of the alphabet are used to supplement the digits
when the base of the number is greater than 10.
33
Dr. Ihab Talkhan
Decimal
Binary
Octal
Hexadecimal
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
00
01
02
03
04
05
06
07
10
11
12
13
14
15
16
17
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
34
Important Property
The Octal & Hexadecimal systems are useful for representing
binary quantities indirectly because they posses the property
that their bases are powers of 2.
Octal base = 8 = 23 & Hexadecimal base = 16 = 24, from
which we conclude:
Each Octal digit correspond to three binary digits
Each Hexadecimal digit correspond to four binary digits.
35
Dr. Ihab Talkhan
36
Dr. Ihab Talkhan
Example
Find the Octal equivalent of the Binary number:
( 10110001101011.11110000011)2
Added 0s
(010110001101011.111100000110)2 L(26153.7406)8
37
Dr. Ihab Talkhan
Example
Find the Hexadecimal equivalent of the Binary number:
( 10110001101011.11110000011)2
Added 0s
(10110001101011.11110000011)2 L(2C6B.F06)16
38
Dr. Ihab Talkhan
39
Dr. Ihab Talkhan
Example
Find the Binary equivalent of (673.12)8
6
. 1
40
Dr. Ihab Talkhan
Example
Find the Binary equivalent of (3A6.C)16
3
41
Dr. Ihab Talkhan
Important Note
The Octal or Hexadecimal equivalent representation
is more convenient because the number can be
expressed more compactly with a third or fourth of
the number of digits.
42
Dr. Ihab Talkhan
Carry
Two digits
Arithmetic
1 + 1 = 10
Binary
1+1=1
43
Dr. Ihab Talkhan
Arithmetic Operations
Arithmetic operations with numbers in base r follow the same rules
as for decimal numbers
Addition
Subtraction
1 1
Augend
0 1 1 0
Minuend
Addend
0 0 1 1
Subtrahend
Sum
1 0 0 1
Result
44
Dr. Ihab Talkhan
1 0 1 1
Division
divisor
1 0 1
1110
1 0 1 1
1101
1 1 1
subtract
1 0 0
1 1
0 1
0 1
0 0
1 0
0 1
1 1
1 0
1 0 1 1
0 0 0 0
1
Product
dividend
0 1 1
1 0 1 1 1
186
4
100
13 1101
14
14
1110
Dr. Ihab Talkhan
0 1
remainder
45
Notes
The rules for subtraction are the same as in decimal, except
that a borrow from a given column adds 2 to the minuend
digit.
In division, we have only two choices for the greatest multiple
of the divisor Zero and the divisor itself.
46
Dr. Ihab Talkhan
47
Dr. Ihab Talkhan
Example
Add :
(59F)16 + (E46)16
Equivalent Decimal
Hexadecimal
5 9 F
+
E 4 6
3 E 5
15
14
19
14
21
Carry 1
=16+5
=16+3
48
Dr. Ihab Talkhan
Note
The idea is to add F+6 in hexadecimal, by adding the
equivalent decimals 15+6 = 21, then converting (21)10 back to
hexadecimal knowing that;
21 = 16+5 gives a sum digit of 5 and a
carry 1 to the next higher
order column digit
49
Dr. Ihab Talkhan
Multiplication
The multiplication of two base r numbers is done by
performing all arithmetic operations in decimal and converting
intermediate results one at a time.
50
Dr. Ihab Talkhan
Example
Multiply (762)8 x (45)8
carry
Octal
Octal
Decimal
Octal
762
5x2
10=8+2
12
5 x 6 +1
31=24+7
37
5 x 7 + 3 38=32+6
46
3710
4x2
8=8+0
10
43772
4 x 6 +1
25=24+1
31
4 x 7 + 3 31=24+7
37
45
4672
51
Dr. Ihab Talkhan
Complements
Complements are used to simplify the subtraction operation and for logical
manipulation.
Types
Radix Complement
rs complement
(r-1)s complement
rn N
N 0
N 0
52
Dr. Ihab Talkhan
Important Notes
The rs complement is obtained by adding 1 to the (r-1)s
complement.
rs complement of N can be formed by leaving all least
significant 0s unchanged, then subtracting the first nonzero
least significant digit from r, and subtracting all higher
significant digits from (r-1).
(r-1)s complement of N can be formed by subtracting each
digit from (r-1).
53
Dr. Ihab Talkhan
Examples
106-246700
10s complement of :
9s complement of :
246700 753300
246700 753299
(106-1)-246700
54
Dr. Ihab Talkhan
55
Dr. Ihab Talkhan
Note
The (r-1)s complement of Octal or Hexadecimal numbers is
obtained by subtracting each digit from 7 or f (15)
respectively.
If the number contains a radix point, then the point should be
removed temporarily in order to form the rs or (r-1)s
complement. The radix point is then restored to the
complemented number in the same relative position.
The complement of the complement restores the number to its
original value.
56
Dr. Ihab Talkhan
The subtraction method that is based or uses the borrow concept is less efficient
than the method that uses complements, when subtraction is implemented with
digital hardware.
The subtraction of two n-digit unsigned numbers, M-N in base r is done as
follows:
1.
Add the minuend M to the rs complement of the subtrahend N;
M + (rn N) = M- N + rn
2.
If MN, the sum will produce an end carry rn, which is discarded, what is
left is the result M-N .
3.
If M < N, the sum does not produce an end carry and is equal to
rn (N-M)
which is the rs complement of (N-M). to obtain the answer in a familiar
form, take the rs complement of the sum and place a negative sign in front.
57
Dr. Ihab Talkhan
58
Dr. Ihab Talkhan
M N = 72532 03250
72532
-03250
72532
+ 96750
1 69282
10s Complement
sum
Discard the
end carry
59
Dr. Ihab Talkhan
60
Dr. Ihab Talkhan
M N = 03250 - 72532
03250
-72532
no carry
03250
+ 27468
30718
10s Complement
sum
Notes
When subtracting with complements, the negative answer is
recognized by the absence of the end carry and the
complemented result.
62
Dr. Ihab Talkhan
63
Dr. Ihab Talkhan
1s Complement
Example:
X Y = 1010100 1000011
1010100
-1000011
1010100
+ 0111100
1 0010000
1
0010001
1s Complement
sum
End-around carry
answer (X-Y)
64
Dr. Ihab Talkhan
1s Complement (cont.)
Example (cont.):
Y X = 1000011 1010100
1000011
-1010100
1000011
+ 0101011
1s Complement
1101110
sum
Note that, there is no carry in this case
Answer = Y X
= - ( 1s complement of 1101110)
= - 0010001
65
Dr. Ihab Talkhan
66
Dr. Ihab Talkhan
Binary number
Binary Number
Signed number
X = 0 +ve
X = 1 -ve
The left
most bit
Unsigned number
X1010101011
Dr. Ihab Talkhan
67
01001
Signed
+9
Unsigned
25
Signed
-9
Signedmagnitude
System
11001
68
Dr. Ihab Talkhan
8-bit representation
+9
-9
0 0001001
Signed-magnitude representation
10001001
11110110
11110111
69
70
Dr. Ihab Talkhan
+ 6
0000 0110
+ 6
0000 0110
+ 13
0000 1101
- 13
1111 0011
+ 19
00010011
- 7
1111 1001
2s complement
72
Dr. Ihab Talkhan
Decimal Codes
n
73
Dr. Ihab Talkhan
BCD
0
1
2
3
4
5
6
7
8
9
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
23 22 21 20
74
Dr. Ihab Talkhan
75
Dr. Ihab Talkhan
8 bit
It is important to realize that BCD numbers are decimal numbers and not
binary numbers.
76
Dr. Ihab Talkhan
BCD Addition
Each digit in a BCD does not exceed 9, the sum can not be
greater than 9+9+1 = 19, where the 1 being a carry.
The binary sum will produce a result in the range from 0 to 19,
in binary it correspond to 0000 10011, but in BCD
0000 1 1001, thus when the binary sum is equal to or less
1001 (without a carry) the corresponding BCD is correct.
77
Dr. Ihab Talkhan
78
Dr. Ihab Talkhan
Examples
4
0100
0100
1000
+ 5
0101
+ 8
1000
+ 9
1001
1001
12
1100
17
1 0001
0110
0110
1 0010
1 0111
Add 6
carry
79
Dr. Ihab Talkhan
Example (2)
1
184
+ 576
BCD carry
Binary sum
add 6
BCD sum
80
Dr. Ihab Talkhan
BCD Multiplication
Multiply 15 x 16 in BCD
15
5x6
= 30
x 16
6x1+3=9
1001 0000
1x5
=5
1
0001 0101
1x
=1
0010 1110 0000
0110
0010 0100 0000
L0011 0000
L1001
L0101
L0001
81
Dr. Ihab Talkhan
82
Dr. Ihab Talkhan
Binary codes for decimal digits require a minimum 4-bits per digit.
BCD
8421
Repeated code
2421
3 2 1 0
2
2 2 2
Excess-3 code
Negative code
8 4 -2 -1
Weighted
codes
Always add 3 (0011) to the
original binary number, e.g
0000
0011
0001
0100 and so on
Note, some
digits can be
coded in two
possible ways
83
84
Dr. Ihab Talkhan
Notes
You should distinguish between conversion of a decimal
number to binary and the binary coding of a decimal number.
It is important to realize that a string of bits in a computer
sometimes represents a binary number and at other times it
represents information as specified by a given binary code.
85
Dr. Ihab Talkhan
Alphanumeric Codes
ASCII = American Standard Code for
Information Interchange
ASCII consists of 7-bits to code 128 characters
10 decimal numbers [ 0- 9]
32 special printable characters [ #,$,%,&,*,..]
34 control characters
(non-printing C/Cs)
86
Note that, binary codes merely change the symbols not the
meaning of the element of information.
The 34 control characters are used for routing data and
arranging the printed text into the prescribed format
87
Dr. Ihab Talkhan
Control Characters
Format effectors
Information separators
Communication
Control characters
Layout of printing
Transmission of text
between remote
terminals
88
Dr. Ihab Talkhan
Parity bit
ASCII code was modified to 8-bits instead of 7-bits. (ASCII is
1 byte in length)
1 byte = 8 bits
The extra bit, whose position is in the most significant bit [
default is 0] , is used for:
Providing additional symbols such as the Greek Alphabet
or italic type formatetc
Indicating the parity of the character when used for data
communication.
89
Dr. Ihab Talkhan
Even parity
0
1
1
1
0011101
0011010
0101001
0011001
90
Dr. Ihab Talkhan
91
Dr. Ihab Talkhan
Binary Logic
Digital circuits are hardware components that manipulate
binary information.
Gates are circuits that are constructed with electronics
components [ transistors, diodes, and resistors]
Boolean algebra is a binary logic system which is a
mathematical notation that specifies the operation of a gate [
Boolean => the English mathematician George Boole 1854 ]
92
Dr. Ihab Talkhan
Voltage
5
Intermediate
region,
crossed only
during state
transition
Logic 1 range
2
Transition , occurs
between the two limits
0.8
Logic 0 range
0
time
93
Dr. Ihab Talkhan
94
Dr. Ihab Talkhan
Carry
Two digits
Arithmetic
1 + 1 = 10
Binary
1+1=1
95
Dr. Ihab Talkhan
Binary Logic
AND
OR
-Represented by any of
the following notations:
-Represented by any of
the following notations:
NOT
(inverter)
-Represented by a bar
over the variable
X .AND. Y
X .OR. Y
X.Y
X+Y
-Function definition:
XY
XvY
Z is what X is not
-Function definition:
Z = 1 only if X=Y=1
0 otherwise
-Function definition:
Z = 1 if X=1 or Y =1
or both X=Y=1
0 if X=Y=0
96
Dr. Ihab Talkhan
Binary Logic
AND
OR
NOT
(inverter)
-Symbol:
-Symbol
-Symbol
-Truth Table
-Truth Table
-Truth Table
0
0
1
1
0
1
0
1
0
0
0
1
0
0
1
1
0
1
0
1
0
1
1
1
0
1
1
0
97
Dr. Ihab Talkhan
98
Dr. Ihab Talkhan
Timing Diagram
input 1
input 2
AND
X.Y
OR
X+Y
NOT
99
Dr. Ihab Talkhan
Language description
Function description
Boolean Equation
Graphic Symbols
Truth Table
Timing Diagram
Coding (HDL)
100
Dr. Ihab Talkhan
Other Gates
NAND = AND-Invert
NOR Invert-OR
XOR ( odd )
XNOR (even )
-Symbol:
-Symbol
-Symbol
-Symbol
-Truth Table
-Truth Table
-Truth Table
-Truth Table
0
0
1
1
0
1
0
1
1
1
1
0
0
0
1
1
0
1
0
1
1
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
1
0
1
0
1
1
0
0
1
Z=X.Y
Z XY
Z=X+Y
Z XY
101
Basic Function
NOT (inverter)
A
AB
AND
AB
B
B
A
A+B
OR
A
B
A+B
102
Boolean Algebra
It is an algebra that deals with binary variables and logic
operations:
A Boolean function consists of:
An algebraic expression formed with binary variables.
The constants 0 and 1
The logic operation symbol ( . , +, NOT)
Parentheses and an equal sign
103
Dr. Ihab Talkhan
Example
Given a logic function F, defined as follows:
F=
F X YZ
104
Dr. Ihab Talkhan
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
0
1
1
1
1
105
Dr. Ihab Talkhan
F X YZ
AND
output
Complement = need an inverter
F X YZ
Y
Z
Notes
There is only one way to represent a Boolean function in a
Truth Table, where there are a variety of ways to represent the
function when it is in algebraic form.
By manipulating a Boolean expression according to Boolean
Algebra rules, it is sometimes possible to obtain a simpler
expression for the same function, thus reducing the number of
gates in the circuit.
107
Dr. Ihab Talkhan
Commutative
Associative
Distributive
DeMorgan
Duality
X + 0 =X
X+1=1
X+X=X
X+X=1
X = X
X + Y = Y +X
X+(Y+Z) = (X+Y)+Z
X(Y+Z) = XY + XZ
X Y X.Y
X.1=X
X.0=0
X.X=X
X.X=0
XY = YX
X(YZ) = (XY)Z
X+YZ=(X+Y)(X+Z)
X.Y X Y
108
Dr. Ihab Talkhan
Duality
The dual of an algebraic expression is obtained by
interchanging OR and AND operations and replacing
1s by 0s and 0s by 1s.
Notice that when evaluating an expression, the
complement over a single variable is evaluated first ,
then the AND operation and the OR operation
( )
NOT
AND
OR
109
Dr. Ihab Talkhan
X1 X 2 X 3 ... X n X1 .X 2 .X 3 ..X n
X1 .X 2 .X 3 .....X n X1 X 2 X 3 .. X n
110
Dr. Ihab Talkhan
Algebraic Manipulation
F XYZ XY Z XZ
using X X 1
XY XZ
using X.1 X
111
Dr. Ihab Talkhan
F XYZ XYZ XZ
X
0
0
0
0
1
1
1
1
Y
0
0
1
1
0
0
1
1
Z
0
1
0
1
0
1
0
1
F
0
0
1
1
0
1
0
1
F XY XZ
112
Dr. Ihab Talkhan
XY XZ YZ XY XZ YZ ( X X )
XY XZ XYZ XYZ
XY XYZ XZ XYZ
XY(1 Z) XZ(1 Y)
XY XZ
113
Dr. Ihab Talkhan
X YX ZY Z X YX Z
Notice that, two terms are associated with one variable and its
complement and the redundant term is the one which not contain the
same variable.
114
Dr. Ihab Talkhan
Complement of a Function F
The complement of a function F is obtained by
interchanging 1s to 0s and 0s to 1s in the values of F in
the Truth Table.
OR, it can be derived algebraically by applying DeMorgans
Theorem.
The complement of an expression is obtained by interchanging
AND and OR operations and complementing each variable.
115
Dr. Ihab Talkhan
Example
F XY Z X YZ
F XY Z X YZ
XY Z
. X YZ
X Y Z
. X Y Z
116
Dr. Ihab Talkhan
Standard Forms
Standard Forms
Product terms
Sum Terms
0 = complemented variable
1 = complemented variable
1 = uncomplemented variable
0 = uncomplemented variable
A product term in which all the variables appear exactly once either
complemented or uncomplemented is called a minterm, note that there are
2 n distinct minterm for n-variables.
117
Dr. Ihab Talkhan
Mj mj
118
Dr. Ihab Talkhan
Example
X Y
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
Product
Z
term symbol
0 X Y Z m0
1 X YZ m1
0 XY Z m 2
1 X YZ m3
0 XY Z m4
1 XYZ m5
0 XYZ m6
1 XYZ m7
SUM
sum
symbol
M0
XYZ
M1
XYZ
M2
XYZ
M3
XYZ
M4
XYZ
M5
XYZ
M6
XYZ
M7
XYZ
F
1
0
1
0
0
1
0
1
119
Example
Sum of Product
SOP
F X Y Z XY Z X YZ XYZ
m0 m 2 m5 m7
m0,2,5,7
F m1,3,4,6
Product of Sum
POS
F M1 M 3 M 4 M 6
m1 m 3 m 4 m 6
m1 m 3 m 4 m 6
X Y Z X Y Z X Y Z X Y Z
M1,3,4,6
Properties of minterm
1.
2.
3.
4.
121
Dr. Ihab Talkhan
122
Dr. Ihab Talkhan
Example
F AB CD E AB CD CE
123
Dr. Ihab Talkhan
124
Dr. Ihab Talkhan
K-map Procedure
Fill the map from the Truth-Table.
Look at 1s (where F=1).
Make the biggest group possible:
125
Dr. Ihab Talkhan
CD
AB
00
01
11
10
00
01
11
10
Cell
12
13
15
14
ABCD 8
11
10
A BC D
SOP
Dr. Ihab Talkhan
POS
126
Note that there are cases where two squares in the map are considered to
be adjacent,, even though they do not touch each other.
YZ
00
0
1
01
0
4
11
1
5
10
3
7
2
6
127
Dr. Ihab Talkhan
Example
FA, B, C, D m0,1,2,4,5,6,8,9,12,13,14
AB CD
00
01
11
10
00
01
11
10
12
13
15
14
11
10
F C AD BD
128
Dr. Ihab Talkhan
Example 2
FA, B, C, D ABC BCD ABCD ABC
AB CD
00
01
11
10
00
1
01
1
11
10
12
13
15
14
11
1 10
F BD BC ACD
129
Dr. Ihab Talkhan
Prime Implicant
A prime implicant is a product term obtained by combining the
maximum possible number of adjacent squares in the map.
If a minterm in a square is covered by only one prime
implicant , that prime implicant is said to be essential.
130
Dr. Ihab Talkhan
YZ
00
0
1
01
0
4
1
1
11
1
5
10
3
7
2
6
F XZ X Z X Y
XZ X Z YZ
XZ & X Z essential prime implicants
X Y & YZ non - essential prime implicants
131
Dr. Ihab Talkhan
Example 1
AB
CD
00
01
11
10
00
1
01
11
10
1 12
8
13
15
11
2
1
1
6
14
10
F AD BD AB
essential prime
implicants
Non-essential prime
implicant
132
Dr. Ihab Talkhan
Note that, once the essential prime implicants are taken, the third term is not
needed (redundant), as all the minterms are already covered by the essential
prime implicants, thus:
F AD BD
133
Dr. Ihab Talkhan
Example 2
AB CD
00
00
01
11
10
01
11
10
1 12
8
13
1 15
1 11
14
10
Non-essential
ABD
Dr. Ihab Talkhan
134
Complement of a Function
The complement of a function is represented in the K-map by
the squares (cells) not marked by 1s.
135
Dr. Ihab Talkhan
FF
136
Dr. Ihab Talkhan
Example
FA, B, C, D 0,1,2,5,8,9,10
F AB CD BD
CD
AB
dual F A BC D B D 0 0
complement ing each literal
01
F A BC D B D
11
10
00
01
13
15
14
11
12
1
11
10
1
10
137
138
Dr. Ihab Talkhan
Example
AB CD
00
01
11
10
00
X
01
11
10
12
13
15
14
11
10
F1 CD AB F2 CD AD
Algebraically these two functions are not equal , as both covers
different dont care minterms, but the original function is satisfied as
dont care terms will not affect the original function
Dr. Ihab Talkhan
139
140
Dr. Ihab Talkhan
5-variables Map
We use two four-variables maps, the first one has a the variable A=0 as a
common factor, and the second has a common factor A=1.
Each cell in the A=0 map is adjacent to the corresponding cell in the A=1
map, e.g.
5-variables map
DE
BC
00
01
11
10
00
01
11
DE
BC
10
12
13
15
14
11
10
00
01
11
10
A=0
00
01
11
10
16
17
19
18
20
21
23
22
28
29
31
30
24
25
27
26
A=1
142
Dr. Ihab Talkhan
Example
F ( A, B, C, D, E) m(0,2,4,6,9,13,21,23,25,29,31)
DE
BC
00
01
11
10
00
01
11
DE
BC
10
12
13
15
14
11
10
A=0
00
00
01
11
10
common
01
16
11
17
10
19
18
20
21
23
22
28
29
31
30
24
25
27
26
A=1
143
Other Gates
NAND = AND-Invert NOR Invert-OR
Buffer
-Symbol:
-Symbol
-Symbol
-Truth Table
-Truth Table
-Truth Table
0
0
1
1
0
1
0
1
1
1
1
0
0
0
1
1
0
1
0
1
1
0
0
0
Z=X.Y
Z=X+Y
Dr. Ihab Talkhan
0
1
0
1
ZX
144
NAND and NOR gates are more popular than AND and OR gates, as they are
easily constructed with electronic circuits and Boolean functions can be
easily implemented with them.
XY
X Y XY
Invert-OR
AND-invert
145
Dr. Ihab Talkhan
XY
XY X Y
OR-invert
invert-AND
146
Dr. Ihab Talkhan
The implementation of Boolean functions with NAND gates requires that the
function be in the SOP form.
F AB CD
Double inversion
147
Dr. Ihab Talkhan
Example
F(X, Y, Z) m1,2,3,4,5,7
X
Y
00
X
Y
0
1
01
0
4
1
1
11
1
5
1
1
10
3
7
2
6
F XY XY Z
X
Y
X
Y
Z
148
Dr. Ihab Talkhan
3.
4.
149
Dr. Ihab Talkhan
150
Dr. Ihab Talkhan
Example
F A B ABC D
A
B
A
B
A
B
A
B
C
D
C
D
151
Dr. Ihab Talkhan
-Symbol
XOR is equal to 1
if only one variable
is equal to 1 but
not both
XNOR is equal to 1
if both X & Y are equal
to 1 or both are
equal to 0
-Truth Table
-Truth Table
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
1
0
1
0
1
1
0
0
1
Z XY
X Y XY
Dr. Ihab Talkhan
Z XY
XY X Y
152
XOR/XNOR identities
X0 X
X 1 X
XX 0
X X 1
XY XY
XY XY
Commutativ e : X Y Y X
Associative : (X Y) Z X (Y Z) X Y Z
X Y Z X Y XY Z (XY X Y) Z
X Y Z XY Z X YZ XYZ
Dr. Ihab Talkhan
153
154
Dr. Ihab Talkhan
Y
0
0
1
1
0
0
1
1
Z
0
1
0
1
0
1
0
1
P
0
1
1
0
1
0
0
1
C
0
0
0
0
0
0
0
0
P XYZ
C XY ZP
Parity Checker
Parity generator
Dr. Ihab Talkhan
155
Transmission Gates
This gate is available with CMOS type electronic circuits.
C
X
TG
C 1
C0
C0
C 1
Open Switch
Pass signal
156
Dr. Ihab Talkhan
TG2
TG1
TG2
0
0
1
1
0
1
0
1
Close
Close
Open
Open
Open
Open
Close
Close
0
1
1
0
157
Integrated Circuits
It is a small silicon semiconductor crystal, called a chip,
containing the electronic components for the digital gates.
Number of pins may range from 14 in a small OC package to
64 or more in a large package.
158
Dr. Ihab Talkhan
Levels of Integration
Small Scale
Integration
SSI
Medium Scale
Integration
MSI
10 -100 gates
Decoder
Adders
Registers
Large Scale
Integration
LSI
100
few
thousands gates
Thousands for
gates
Processors
Large memory
arrays
Memory chips
Programmable
modules
Complex
microprocessors
159
Dr. Ihab Talkhan
TTL
Diode-Transistor
Logic
TransistorTransistor Logic
ECL
Emitter-Coupled
Logic
MOS
CMOS
Metal-Oxide
Semiconductor
High component
density
Simple processing
technique during
fabrication
Complementary
Metal-Oxide
Semiconductor
Low power
consumption
160
Notes
There are many type of the TTL family
High-speed TTL
Low-power TTL
Schottky TTL
Low-power Schottky TTL
Advanced Low-power Shcottky TTL
ECL gates operates in a nano-saturated state, a condition that
allows the achievement of propagation delays of 1-2
nanoseconds.
161
Dr. Ihab Talkhan
Fan-out
Power-dissipation
Propagation delay
Noise margin
162
Dr. Ihab Talkhan
Fan-out
It specifies the number of standard loads that the output of a
typical gate can drive without impairing its normal operation.
A standard load is usually defined as the amount of current
needed by an input of another similar gate of the same family.
163
Dr. Ihab Talkhan
Power Dissipation
It is the power consumed by the gate which must be available
from the power supply.
164
Dr. Ihab Talkhan
Propagation Delay
It is the average transition delay time for the signal to
propagate from input to output when the binary changes in
value. The operating speed is inversely proportional to the
propagation delay.
165
Dr. Ihab Talkhan
Noise Margin
It is the maximum external noise voltage that causes an
undesirable change in the circuit output.
166
Dr. Ihab Talkhan
Logic value
Signal value
Logic value
Signal value
Negative logic
Positive logic
167
Dr. Ihab Talkhan
Notes
The signal values H & L are usually used in the
components data sheets
The actual truth table is defined according to the definition of
H and L in the data sheet.
168
Dr. Ihab Talkhan
Data
Sheet
L
L
H
H
L
H
L
H
L
L
L
H
X
TTL
Gate
0
0
1
1
0
1
0
1
0
0
0
1
X
Y
X
Y
0
0
1
1
0
1
0
1
1
1
1
0
Logic Circuits
Logic Circuits
Combinational
Sequential
170
Logic Circuits
Logic Circuits
Combinational
n
inputs
Sequential
Outputs
Inputs
Combinational
Circuit
m
outputs
Combinational
Circuit
Next
state
2 n possible input
combination
One possible
output for each
binary
combination of
input variables
Storage
elements
Present state
171
Dr. Ihab Talkhan
Analysis Procedure
2.
3.
Label the gates that are a function of input variables and previous
labeled gates with different arbitrary symbols. Find the Boolean
functions for these gates.
Repeat step 2 until the outputs of the circuit are obtained in terms
of the input variables.
173
Dr. Ihab Talkhan
Example
174
Dr. Ihab Talkhan
T1 BC
, T2 AB
T3 A T1 A BC
T4 T2 D (AB) D ABD AD BD
T5 T2 D AB D
Thus the Boolean functions of F1 and F2 are:
F1 T3 T4 A BC ABD AD BD
A BC BD BD
F2 T5 AB D
175
Dr. Ihab Talkhan
176
Dr. Ihab Talkhan
T1
T2
T3
T4
T5
F1
F2
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
0
1
1
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
0
1
0
1
1
0
1
0
0
1
0
1
1
0
1
0
0
1
1
1
0
1
0
1
0
1
1
1
0
1
0
1
0
1
1
1
1
0
1
0
1
1
1
1
1
1
1
1
0
1
1
1
0
1
0
1
0
1
1
1
0
1
0
1
177
Dr. Ihab Talkhan
Design Procedure
1. Form the specifications of the circuit, determine the required
number of inputs and outputs and assign a letter (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.
178
Dr. Ihab Talkhan
Need to Accomplish
1.
2.
3.
4.
179
Dr. Ihab Talkhan
Example
Design a combinational circuit with three
inputs and one output. The output must
equal 1 when the inputs are less than
three and 0 otherwise. [use only NAND
gates]
0
1
2
3
4
5
6
7
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
1
0
0
0
0
0
180
Dr. Ihab Talkhan
YZ
00
0
1
01
0
11
10
2
6
F XY X Z
X
Y
F XY X Z
Mixed-symbol notation
Dr. Ihab Talkhan
181
Note
When a combinational circuit has two or more outputs, each output must
be expressed separately as a function of all the input variables.
182
Dr. Ihab Talkhan
0
1
2
3
4
5
6
7
8
9
BCD code
Excess-3 code
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
0
0
0
1
1
1
1
1
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
0
183
Dr. Ihab Talkhan
CD
00
01
11
10
CD
AB
AB
00
00
01
00
01
1
X
11
11
10
10
01
11
10
W A BC BD
A B(C D)
X BC BD BCD
B(C D) BCD
Dr. Ihab Talkhan
184
CD
00
01
11
10
CD
00
01
11
10
AB
AB
00
00
01
01
11
10
11
10
Y CD CD
ZD
CD
185
Dr. Ihab Talkhan
186
Dr. Ihab Talkhan
187
Dr. Ihab Talkhan
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
1
0
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
0
1
1
0
1
1
1
0
1
0
0
0
1
0
1
0
1
0
0
0
1
1
1
0
1
1
0
0
1
1
1
1
1
0
1
1
7-outputs
a
f
e
g
d
b
c
188
Dr. Ihab Talkhan
We cannot use the dont care condition here for the six binary
combinations 10101 1111, as the design will most likely
produce some arbitrary and meaningless display of the
unused combinations.
a AC ABD BC D A BC
b A B AC D ACD A BC
c AB AD BC D A BC
d AC D A BC BC D A BC ABC D
e AC D BC D
f ABC AC D AB D A BC
g AC D A BC ABC A BC
14 AND gate and 7 OR
189
Dr. Ihab Talkhan
Arithmetic Circuits
An arithmetic circuit is a combinational circuit that performs
arithmetic operations such as addition, subtraction,
multiplication and division with binary numbers or with
decimal numbers in a binary code.
0+0=0
One digit
0+1=1
Carry is added to
the next higher
1+0=1
order pair of
significant bits
Two digits
1 + 1 = 10
A combinational circuit that performs the addition of two bits
is called a Half Adder.
190
Dr. Ihab Talkhan
191
Dr. Ihab Talkhan
Half-Adder
It is an arithmetic circuit that generates the sum of two binary digits.
S XY X Y X Y
C XY
Ouputs
Inputs
Half-Adder
0
0
1
1
0
1
0
1
0
0
0
1
0
1
1
0
192
Dr. Ihab Talkhan
Full-Adder
It is a combinational circuit that forms the arithmetic sum of three input bits.
S X Y Z
C XY Z ( X Y )
Inputs
Outputs
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
0
1
1
0
1
0
0
1
YZ
X
0
00
01
11
10
1
S X Y Z XY Z X Y Z XYZ
X Y Z
YZ
X
0
00
01
11
10
C XY XZ YZ
XY Z ( X Y X Y )
XY Z ( X Y )
194
A3
FA
C4
S3
B2
C3
B1
A2
FA
C2
S2
FA
S1
4-bit Parallel Adder
Dr. Ihab Talkhan
B0
A1
C1
A0
FA
C0
S0
195
Binary Adder/Subtractor
The subtraction of binary number can be done most
conveniently by means of complements
The subtraction A-B is done by taking the 2s complement
of B and adding it to A .
The 2s complement can be obtained by taking the 1s
complement and adding 1 to the least significant bit.
The 1s complement can be implemented easily with inverter
circuit and we can add 1 to the sum by making the initial
input carry of the parallel adder equal to 1.
196
Dr. Ihab Talkhan
Example
A = 1011
B = 0011
Input Carry
Augend A
Addend B
Sum
Output Carry
197
Dr. Ihab Talkhan
B3
A3
B2
B1
A2
B0
A1
A0
FA
C4
S3
C3
FA
C2
S2
FA
S1
C1
FA
C0
S0
S = C0 = 0
S = C0 = 1
addition
Subtraction
Adder/Subtractor Circuit
198
Dr. Ihab Talkhan
BCD Adder
An adder that perform arithmetic operations directly with decimal number
system employ arithmetic circuit that accept decimal numbers and present
results in the same code.
It requires a minimum of nine inputs and five outputs, Four bits to code
each decimal digit and the circuit must have an input and output carry.
When C=0 , nothing is added to the binary sum
When C=1, binary 0110 is added to the binary sum through the second 4bit adder.
Any output carry from the second binary adder can be neglected.
A decimal parallel adder that adds two n-decimal digits needs n BCD
adders, the output carry from each BCD adder must be connected to the
input carry of the adder in the next higher position.
199
Dr. Ihab Talkhan
Addend
Augend
Z 3 Z 2 Z1 Z 0
input
carry
C K Z1Z3 Z 2 Z3
0
4-bit binary adder
S3
S2
S1
BCD sum
Dr. Ihab Talkhan
S0
200
Binary Multiplier
The multiplicand is multiplied by each bit of the multiplier,
starting from the least significant bit.
Such multiplication forms a partial products.
Successive partial products are shifted one position to the left.
The final product is obtained from the sum of the partial
products.
For j multiplier bits and k multiplicand bits , we need jxk
AND gates and (j-1)k bit adders to produce a product of j+k
bits.
201
Dr. Ihab Talkhan
A0
B1
B0
A1
A0
B1
A1
B1
B0
B0
A0 B1 A0 B0
A1 B1 A1 B0
C3
C2
C1
HA
C0
C3 C 2
2-bit by 2-bit binary multiplier
Dr. Ihab Talkhan
HA
C1
C0
202
Decoders
Discrete quantities of information are represented in digital
computers with binary codes.
A binary code of n-bits is capable of representing up to 2n
distinct elements of coded information.
A decoder is a combinational circuit that converts binary
information from n-coded inputs to a maximum of 2n unique
outputs.
A decoder has n inputs and m outputs and is referred to as
nxm decoder
203
Dr. Ihab Talkhan
Z
Y
X
20
21
22
C
3x8 Decoder
208
Dr. Ihab Talkhan
Encoders
An Encoder has 2n (or less) input lines and n output lines.
209
Dr. Ihab Talkhan
Priority Encoder
It is a combinatinal circuit that implements the priority function.
The operation of the priority Encoder is such that, if two or more inputs are
equal to 1 at the same time, the input having the highest priority will take
precedence.
The input D3 in the following Truth Table has the highest priority,
regardless of the values of the other inputs.
Thus, if D3 is 1 , the output will indicate that A1A0 = 11, i.e. the code
A1A0 = 11 means that any data appears on line D3 will have the highest
priority and pass through the system irrespective of the other inputs.
If D2 = 1 and D3 = 0 the code A1A0 = 10 and this means that D2 has the
highest priority in this case.
210
Dr. Ihab Talkhan
Inputs
D1D0
D3D2
00
Outputs
D3
D2
D1
D0
A1
A0
0
0
0
0
1
0
0
0
1
X
0
0
1
X
X
0
1
X
X
X
0
0
0
1
1
0
0
1
0
1
0
1
1
1
1
01
11
10
D1D0
D3D2
00
01
00
00
11
10
01
01
11
11
10
10
1
211
A 0 D3 D1 D 2
A1 D 2 D3
V D 0 D1 D 2 D3
D3
A0
D2
A1
D1
V
D0
Multiplexers
It is a combinational circuit that selects binary information
from one of many lines and directs it to a single output line.
The selection of a particular input line is controlled by a set of
selection variables.
Normally, there are 2n input lines and n selection variables
whose bit combinations determine which input is selected.
As in decoders, multiplexers may have an enable input to
control the operation of the unit.
When the enable input is in the active state, the outputs are
disabled.
The enable input is useful for expanding two or more
multiplexers onto a multiplexer with a larger number of inputs.
213
Dr. Ihab Talkhan
S0
S1
D0
D1
D2
D3
Function Table
S0
S1
0
0
1
1
0
1
0
1
D0
D1
D2
D3
214
Z, Z,1 or 0
215
Dr. Ihab Talkhan
Example
FX, Y, Z m1,2,6,7
X
0
0
0
0
0
1
0
1
FZ
0
0
1
1
0
1
1
0
FZ
1
1
0
0
0
1
0
0
F0
1
1
1
1
0
1
1
1
F 1
Y
X
4 x 1 MUX
F
Z
Z
0
1
216
General Steps
The Boolean function is first listed in a truth table.
The first n-1 variables listed in the table are applied to the
selection inputs of the MUX.
For each combination of the selection variables, we evaluate
the output as a function of the last variable.
This can be 0, 1, the variable or the complement of the
variable.
217
Dr. Ihab Talkhan
Demultiplexer
It is a digital function that performs the inverse operation of a
MUX.
It receives information from a single line and transmits it to
one of 2n possible output lines.
The selection of the specific output is controlled by the bit
combination of n-selection lines.
218
Dr. Ihab Talkhan
E
S0
D0
D1
S1
D2
D3
1-to-4 Demultiplexer
219
Dr. Ihab Talkhan
Sequential Circuits
220
Logic Circuits
Logic Circuits
Combinational
Sequential
Logic Circuits
Logic Circuits
Combinational
n
inputs
Sequential
Outputs
Inputs
Combinational
Circuit
m
outputs
Combinational
Circuit
Next
state
2 npossible input
combination
One possible
output for
each binary
combination
of input
variables
Storage
elements
Present state
222
Dr. Ihab Talkhan
Sequential Circuits
Sequential Circuits
Synchronous
It is a system whose
behavior can be defined
from the knowledge of its
signals at discrete instants of
time
Asynchronous
It is a system whose
behavior depends upon the
order in which the inputs
change, and the state of the
circuit can be affected at any
instant of time
224
Dr. Ihab Talkhan
225
Dr. Ihab Talkhan
inputs
Combinational
Circuit
Outputs
Next
state
FLIP-Flop
Next state
change only
during a clock
pulse
transition
Clock pulses
Present state
A Flip-Flop circuit has two outputs, one for the normal value
and the other for the complemented value of the bit that is
stored in it.
228
Dr. Ihab Talkhan
Latches
A Flip-Flop 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.
Latches are the basic circuit from which all Flip-Flops are
constructed.
229
Dr. Ihab Talkhan
Action
Set
state
reset
Reset
State
Undefined
set
No change
Action
Set
state
set
Reset
State
Undefined
reset
No change
232
Dr. Ihab Talkhan
233
Dr. Ihab Talkhan
Next state of Q
No change
No change
undetermined
reset
234
235
Dr. Ihab Talkhan
D-Latch
Next state of Q
No change
236
Dr. Ihab Talkhan
237
Dr. Ihab Talkhan
JK Flip-Flop
C
Next state of Q
No change
No change
Complement
(toggle)
238
Dr. Ihab Talkhan
T Flip-Flop
C
Next state of Q
No change
No change
complement
239
Dr. Ihab Talkhan
Flip-Flops Characteristic
Tables & Equations
JK Flip-Flop
SR Flip-Flop
S
Q(t+1)
Operation
Q(t+1)
Operation
0
0
1
1
0
1
0
1
Q(t)
0
1
N/A
No change
Reset
Set
Indeterminate
0
0
1
1
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
Q( t 1) S RQ,
Q( t 1) JQ KQ
SR 0
D Flip-Flop
T Flip-Flop
Q(t+1)
Operation
Q(t+1)
Operation
0
1
0
1
Reset
Set
0
1
Q(t)
Q(t)
No change
Complement
Q( t 1) D
Q( t 1) TQ TQ
Dr. Ihab Talkhan
240
Analysis Procedure
Obtain the binary values of each Flip-Flop input equation in
terms of the present state and input variables
Use the corresponding Flip-Flop characteristic table to
determine the next state.
241
Dr. Ihab Talkhan
242
Dr. Ihab Talkhan
Q(t)
Q(t+1)
Q(t)
Q(t+1)
0
0
1
1
0
1
0
1
0
1
0
X
X
0
1
0
0
0
1
1
0
1
0
1
0
1
X
X
X
X
1
0
Q(t)
Q(t+1)
Q(t)
Q(t+1)
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
1
0
1
0
1
0
1
1
0
243
244
Dr. Ihab Talkhan
In addition to graphical symbols, tables, or equations, FlipFlops can also be described uniquely by means of State
diagrams or State graphs, in which case each state would be
represented by a circle , and a transition between state would
be represented by an arrow.
245
Dr. Ihab Talkhan
Q=
0
SR = 10
SR = 01
SR =00 or 10
Q=
1
SR Flip-Flop
JK =00 or 01
Q=
0
JK = 10 or 11
JK = 01or 11
JK =00 or 10
Q=
1
JK Flip-Flop
246
Dr. Ihab Talkhan
D=0
Q=
0
D=0
D=1
Q=
1
D Flip-Flop
T=1
T=0
Q=
0
T=1
T=0
Q=
1
T Flip-Flop
247
Dr. Ihab Talkhan
248
Dr. Ihab Talkhan
Q=
1
Q=
0
State of a
Flip-Flop
Directed line
249
Dr. Ihab Talkhan
Example
Consider a sequential circuit with two JK Flip-Flops (A & B)
and one input X, specified by the following input equations:
JA B
K A BX
JB X
K B A X AX
250
Dr. Ihab Talkhan
JA B
K A BX
JB X
K B A X AX
Dr. Ihab Talkhan
251
State Table
Present State
Input
Next State
Flip-Flop
Inputs
JA
KA
JB
KB
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
1
1
1
0
1
1
0
1
0
1
0
0
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
1
0
1
1
0
1
0
Q(t)
Q(t+1)
Q(t+1)
Operation
0
0
1
1
0
1
0
1
0
1
X
X
X
X
1
0
0
0
1
1
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
252
Steps
Find J A , K A , J B , K B from the equations
Find the next state from the corresponding J & K inputs using the
characteristic table of the JK Flip-Flop.
253
Dr. Ihab Talkhan
State Diagram
Value of
input X
01
00
0
11
10
0
254
Dr. Ihab Talkhan
Master-Slave Flip-Flop
It consists of two Latches and an inverter.
When clock pulse input C=1, then the output of the inverter is 0. Thus
the Master is enabled and its output Y is equal to the external input D and
the Slave is disabled.
When clock pulse input C=0, then the output of the inverter is 1. Thus
the Slave is enabled and its output Q is equal to the Master output Y and
the Master is disabled.
Any changes in the external D input changes the master output Y but
cannot affect the Slave output Q.
255
Dr. Ihab Talkhan
MASTER
SLAVE
External D
Y
256
Dr. Ihab Talkhan
257
Dr. Ihab Talkhan
SLAVE
258
Dr. Ihab Talkhan
259
Dr. Ihab Talkhan
260
Dr. Ihab Talkhan
261
Dr. Ihab Talkhan
262
Dr. Ihab Talkhan
SET Latch
OUTPUT Latch
263
RESET Latch
Dr. Ihab Talkhan
264
Dr. Ihab Talkhan
Registers
The simplest of the storage components.
Each register consists of n-Flip-Flops driven by a common
clock signal.
SET (Preset) and RESET (Clear) inputs are independent of the
clock signal and have priority over it.
The register store any new data automatically on every rising
edge of the clock.
265
Dr. Ihab Talkhan
Preset
4-bit register
I3
CLK
Clear
Dr. Ihab Talkhan
Q3
Q2
I2
Q1
I1
I0
Q266
0
267
Dr. Ihab Talkhan
Load =
0
enterDr.previous
Ihab Talkhan stored data (Qi , i = 0,1,2,3)
268
Shift Register
It shifts its contents one bit in the specified direction when the
control signal SHIFT is equal to 1.
It is used to convert a serial data stream into a parallel stream.
269
Dr. Ihab Talkhan
4-bit serial-in/parallel-out
Shift-right register
270
Dr. Ihab Talkhan
A Multi-Functional Register
By using a 4-to-1 Selector, you can combine the SHIFT and LOADING
functions into one unit.
It either shift its contents or load new data.
It could shift one-bit either to the left or to the right depending on the
selection mode.
Present state
S1
S0
0
0
1
1
0
1
0
1
Operation
No change
Load input
Shift Left
Shift Right
Next State
Q3
Q2
Q1
Q0
Q3
I3
Q2
IL
Q2
I2
Q1
Q3
Q1
I1
Q0
Q2
Q0
I0
IR
Q1
271
1 i 2
272
Dr. Ihab Talkhan
3 2
3 2
3 2
3 2
273
Dr. Ihab Talkhan
Counters
A counter is a special type of a register.
It incorporates an incremental, which allows it to count upward or downward.
The incremental consists of a series of Half-Adders [HA] arranged such that an HA
in bit position i will have two inputs connected to the output of the Flip-Flop Qi
and the carry Ci from he HA in position i-1.
The counter equation is as follows:
Di Qi Ci
Ci 1 Qi Ci
As long as E=1, the counter will count-up modulo 4, adding 1 to its content on
every rising edge of the clock.
274
Dr. Ihab Talkhan
Enable
Present
Next
>
F.F.
Q2 Q1 Q0
Clear
Q2
Q1
Q0
Q2
Q1
Q0
D2
D1
D0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
2
3
4
5
6
7
Counter
Enable = 0 no change
= 1 count
D Flip-Flop Excitation Table
Q(t)
Q(t+1)
0
0
1
1
0
1
0
1
0
1
0
1
Three states
3 Flip-Flops, we
will use D F.F. as an example
275
Dr. Ihab Talkhan
Q1Q0
00
Q2
0
1
1
01
11
Q1Q0
00
Q2
0
10
1
01
11
10
D1 Q1Q0 Q0 Q1
D0 Q0
Q1Q0
00
Q2
0
1
01
11
10
Q0 Q1
1
1
D2 Q2 Q1 Q2 Q0 Q2Q1Q0
Q2 Q1 Q0 Q2Q1Q0
Q2 Q1Q0 Q2Q1Q0
Q2 Q1Q 0
276
Dr. Ihab Talkhan
Half-Adder
E
C0
C1
C2
C3
carry
D2
D1
Q2
D0
Q1
3-bit up-counter
Dr. Ihab Talkhan
Q0
277
278
Dr. Ihab Talkhan
279
Dr. Ihab Talkhan
280
Dr. Ihab Talkhan
Up/Down Counter
The previous counter can be extended to represent an up/down counter, if
we replace the Half-Adder with a Half-Adder/Subtractor [HAS], which can
increment or decrement under the control of a direction signal D , in this
case the counter equation will be:
Di Qi Ci
Ci 1 DQi Ci DQi Ci
281
Dr. Ihab Talkhan
Direction signal ,
D=0
count up, D = 1
count down
D
E
C3
C0
C1
C2
Carry
D1
D2
CLK
E
0
1
1
X
0
1
D0
CLEAR
No change
Count-up
Count-down
Q2
Q1
Q0
282
Half-Adder/Subtractor
[ HAS ]
D
Qi
E = Ci
Ci+1
Qi
Di
283
Dr. Ihab Talkhan
I1
I0
E
Output carry
HAS
HAS
Selector
HAS
Selector
Selector
Load
CLK
Clear
Q2
Q1
Dr. Ihab Talkhan
Q0 284
Load
Operation
0
0
0
1
0
1
1
X
X
0
1
X
No change
Count-up
Count-down
Load input
285
Dr. Ihab Talkhan
BCD Counter
It can be constructed by detecting when the counter reaches a count of 9
and loading 0 instead of 10 in the next clock cycle.
The detection is accomplished by an AND gate whose output is equal to
1 when the content of the counter is equal to 1001.
The output of the AND is connected to the Counter's Load input, which
allows the counter to load 0 at the next rising edge of the clock.
In the up direction we must load 0 into the counter when it reaches a
count of 9, while in the down direction we must load 9 when the
counter reaches a count of 0.
286
Dr. Ihab Talkhan
Up/Down Counter
BCD up-counter
Dr. Ihab Talkhan
287
Selector
Up/Down Counter
288
Dr. Ihab Talkhan
Asynchronous Counter
All Flip-Flops are not all clocked by the same clock signal
There is no need to use an incremental or decremental, counting is
achieved by toggling each Flip-Flop at half the frequency of the preceding
Flip-Flop.
The Flip-Flop will change its state on every 0-to-1 transition of its clock
input.
Note, the clock signal CLK is used to only clock the Flip-Flop in the
least significant position.
The clock-to-output delay of the ith Flip-Flop is equal to i .
The maximum counting frequency of an n-bit asynchronous counter is:
1
f
n
Dr. Ihab Talkhan
289
290
CLK
Q3
Q2
Q1
Q0
t0
t1
t2
t3
t4
t5
t6
t7
291
Mixed-mode Counters
To speed up an asynchronous counter, we must make it partly
synchronous.
To do this, we divide a large counter into n-bit slices, so that
the operation within each slice is asynchronous, while the
propagation between slices is synchronous, or vice versa.
292
Dr. Ihab Talkhan
Asynchronous
Counter
Asynchronous
Counter
293
Synchronous
Counter
Synchronous
Counter
294
295
Major Units
For any system, there are three major units:
Central processing unit CPU
Memory unit
Input/Output unit
In digital system, memory is a collection of cells capable of
storing binary information (permanent or temporary).
It contains electronic circuits for storing and retrieving
information.
It interacts with the CPU and input/output units.
296
Dr. Ihab Talkhan
Memory types
Random Access Memory
RAM
It is a programmable logic
devices PLDs, which are
integrated
circuits
with
internal
logic
gates
connected
through
electronic fuses.
Programming is done by
blowing these fuses to
obtain the desired logic
function.
It is volatile
297
Dr. Ihab Talkhan
Conventional
Symbol
Array Logic
Symbol
298
Dr. Ihab Talkhan
299
Dr. Ihab Talkhan
300
Dr. Ihab Talkhan
301
Dr. Ihab Talkhan
302
Dr. Ihab Talkhan
303
Dr. Ihab Talkhan
304
Dr. Ihab Talkhan
305
Dr. Ihab Talkhan
306
Dr. Ihab Talkhan
307
Dr. Ihab Talkhan
308
Dr. Ihab Talkhan
Programming Technology
To establish the programmable connections the following
technologies are used:
EPROM
EEPROM
FLASH
309
Dr. Ihab Talkhan
EPROM
used to create a wired AND function. The transistor has two gates, a
select gate and a floating gate, charge can be accumulated and trapped on
the floating gate by a mechanism called avalanche injection or hot electron
injection. These transistors are referred to as FAMOS (Floating gate
Avalanche-injection MOS). Note that without a charge on the floating gate
the FAMOS acts as a normal n-channel transistor in that when a voltage is
applied to the gate, the transistor is turned on. EPROM cells provide a
mechanism to hold a programmed state, which is used in PLDs or CPLDs
to establish or not establish a connection. To erase the cell remove charge
from the floating gate by exposing the device to ultraviolet light. (typical
erasure time is about 35 minutes under high-intensity UV light.
310
Dr. Ihab Talkhan
311
Dr. Ihab Talkhan
EEPROM
E2PROM, used to create a wired AND-function. It consists of two
transistors (select & storage transistors). These transistors are referred to as
FLOTOX (Floating gate Tunnel Oxide transistors). It is similar to the
FAMOS except that the oxide region over the drain is considerably smaller,
less than 10 Ao (Angstroms) compared to 200 Ao for the FAMOS. This
allows charges to be accumulated and trapped on the floating gate by a
mechanism called Fowler-Nordheim tunneling. E2PROM cells require a
select transistor because when the floating gate does not hold a charge, the
threshold voltage of the FLOTOX transistor is negative.
312
Dr. Ihab Talkhan
313
Dr. Ihab Talkhan
314
Dr. Ihab Talkhan
FLASH
like E2PROM, FLASH cells consist of two transistors (select
& storage transistors). They create a wired AND function.
The storage Transistor is a FAMOS, so programming is
accomplished via hot electron injection. However the floating
gate is shared by an eraser transistor that take charge off it via
tunneling.
315
Dr. Ihab Talkhan
316
Dr. Ihab Talkhan
RAM
Random access from any random location.
It stores information in groups of bits (called words.
A word is a group of 1s & 0s (represents numbers,
instructions, alphanumeric characters, binary coded
information).
Normally, a word is a multiples of 8 bits (1 byte) in length,
where 1 byte = 8 bits.
Capacity of memory = total number of bytes.
317
Dr. Ihab Talkhan
318
Dr. Ihab Talkhan
K-address
lines
Read
Write
Memory Unit
2k words
n bits/word
word chosen
R/W Control = Direction of transfer
n data-out lines
Units
Kilo K = 210
Mega M = 220
Gega G = 230
64 K = 216
(26 x 210 )
2 M = 221
4 G = 232
320
Dr. Ihab Talkhan
Memory Address
Binary
Decimal
Memory Content
0000000000
1101100101011100
1111111111
1023
322
Dr. Ihab Talkhan
IN
Out
S
R
R/W
Basic Cell
323
Dr. Ihab Talkhan
Memory Select
Read/Write
Operation
None
Write
Read
Select
R/W =
In to F.F.
IN
Basic
OUT
Cell
R/W
m words of n-bits/word consists of n x m binary storage cells
324
Dr. Ihab Talkhan
Addresslines
RAM
16 x 4
Memory Select
R/W
DataIN
DataOUT
3-State Buffer
It exhibits three distinct states, two of the states are the logic 1
and logic 0 of conventional logic. The third state is the highimpedance (Hi-Z) state.
The high-impedance state behaves like an open circuit, i.e.
looking back into the logic circuit, we would find that the
output appears to be disconnected.
326
Dr. Ihab Talkhan
IN
OUT
ENABLE ) EN)
EN
IN
OUT
0
1
1
X
0
1
Hi-Z
0
1
327
Dr. Ihab Talkhan
Properties of Memory
Integrated circuit RAM may be either Static or Dynamic
RAM
Static RAM (SRAM)
328
Dr. Ihab Talkhan
RAM
Static RAM (SRAM)
SRAM is easier to use and
has shorter read/write cycles.
No refresh is required
330
Dr. Ihab Talkhan
331
Dr. Ihab Talkhan
4 x 4 memory
332
Dr. Ihab Talkhan
4 x 4 Memory
It consists of 16 memory cells MCs.
For each memory access, the address decoder decodes the address and
selects one of the rows.
If RWS & CS are both equal to 1 the new content will be written into
each cell of the row selected. Note that the output drivers are disabled to
allow the new data to be written-in
If RWS = 0 & CS = 1 the data from the row selected will be passed
through the tri-state drivers to the IO pins.
333
Dr. Ihab Talkhan
334
Dr. Ihab Talkhan
Design description
Synthesis
Placement
Routing
Test Benches for design verification
335
Dr. Ihab Talkhan
Design Constraints
Time-to-market
Cost
Design Features
Performance
Manufacturing capabilities
Design constraints
336
Dr. Ihab Talkhan
Increasing Functionality
Higher performance
Lower cost
Lower power consumption
Smaller dimensions
Need to create
highly integrated,
complex systems
with fewer IC
devices and less
printed-circuitboard PCB area.
337
Dr. Ihab Talkhan
Technologies available
PCB technology
Surface mounting Devices (SMD)
Multi-chip Modules MCMS
Custom Design
Application Specific Integrated Circuit ASIC (SC, GA,
PLD, CPLD, FPGA)
338
Dr. Ihab Talkhan
Function description
Algorithms
Equation
Symbols (schematic capture)
Data from graphs
Netlist
Truth table
Waveforms (timing diagrams)
VHDL
339
Dr. Ihab Talkhan
340
Dr. Ihab Talkhan
Schematic Capture
(Small Designs)
341
Dr. Ihab Talkhan
But Capturing
difficult:
Large
designs
is
342
Dr. Ihab Talkhan
343
Dr. Ihab Talkhan
VHDL
&
Verilog
Languages
satisfy
These
requirements
344
Dr. Ihab Talkhan
VHDL
&
Verilog
Languages
satisfy
These
requirements
345
Dr. Ihab Talkhan
Modern Methodologies
in design and test
Semi-custom & Full-custom Application
Specific Integrated Circuit ASIC
High-density Programmable Logic Devices
PLDs
Complex High-density Programmable Logic
Devices CPLDs
Field Programmable Gate Arrays FPGAs
Hardware Description Language VHDL
Very High Speed Integrated Circuit VHSIC
Hardware Description Language
500 to more
than 100,000
gates, thus
Boolean
equations or
gate-level
descriptions are
no longer
efficient to
quickly
complete a
design 346
347
Dr. Ihab Talkhan
VHDL History
VHDL ( a product of the VHSIC (Very High Speed
Integrated Circuit) program funded by the Department of
Defense (US government) in 1970s & 1980s) is well suited
for designing with programmable logic devices (it is one
language for design & simulation).
It was endorsed by IEEE in 1986 in its attempt at
standardization.
By December 1987 the IEEE 1076.1 standard for VHDL was
approved and a VHDL Language Reference Manual (LRM)
was published.
348
Dr. Ihab Talkhan
VHDL properties
it provides high-level language constructs that enable
designers to describe large circuits and bring products to
market rapidly.
It supports the creation of design libraries for reuse in
subsequent designs.
It is a standard language (IEEE standard 1076), thus it
provides portability of code between synthesis and simulation
tools as well as technology-independent design.
349
Dr. Ihab Talkhan
350
Dr. Ihab Talkhan
VHDL Advantages
Standard
Government Support
Industry Support
Portability
Modeling Capability (Power & Flexibility)
Reusability
Technology & Foundry independence
Documentation
New Design methodology
351
Dr. Ihab Talkhan
Standard
VHDL is an IEEE standard (such as graphic X-windows
standard, bus communication interface standard, and so on).
It reduces confusion and makes interfaces between tools,
companies, and products easier.
Any development to the standard would have better chances of
lasting longer and have less chance of becoming obsolete due
to incompatibility with others.
352
Dr. Ihab Talkhan
Government Support
VHDL is a result of the VHSIC program, so it is clear that the
US government supports the VHDL standard for electronic
procurement.
353
Dr. Ihab Talkhan
Industry Support
Companies use VHDL tools not only with regard to defense
contractors, but also for their commercial designs.
354
Dr. Ihab Talkhan
Portability
VHDL permits you to simulate the same design description
that you synthesized, simulating a several-thousand-gate
design description before synthesizing can save a considerable
amount of time & effort.
VHDL is standard, design description can be taken from one
simulator to another, one synthesis tool to another, and one
platform to another, i.e. VHDL design descriptions can be
used in multiple projects.
355
Dr. Ihab Talkhan
Compiler
A
Compiler
B
One design
Compiler
C
Custom
ASIC
Any vendor/device
Modeling Capability
(Power & Flexibility)
It has powerful language constructs (code description of
complex control logic)
It has multiple levels of design description for controlling
design implementation
It supports design libraries & the creation of reusable
components
It provides for design hierarchies to create modular designs
357
Dr. Ihab Talkhan
358
Dr. Ihab Talkhan
Device-independent Design
You can create a design without having to first choose a
device for implementation, with one design description you
can target many device architecture.
It permits multiple styles of design description, i.e. it permits
several classes of design description.
359
Dr. Ihab Talkhan
Device-independent Design
aeqb (a(0) XOR b(0)) NOR (a(1)
XOR b(1));
Netlist
Boolean equationst
Concurrent statements
Sequential statements
2-bit Comparator
360
Dr. Ihab Talkhan
Benchmarking Capabilities
Device-independent design & portability allow you
benchmark a design using different architectures and different
synthesis tools.
361
Dr. Ihab Talkhan
ASIC Migration
The efficiency the VHDL generates allows your product to hit the market
quickly.
When production volumes reach appropriate levels, VHDL facilitate the
development of an ASIC, sometimes the exact code used with the PLD can
be used with the ASIC.
362
Dr. Ihab Talkhan
363
Dr. Ihab Talkhan
364
Dr. Ihab Talkhan