Digital Electronics PDF
Digital Electronics PDF
Digital Electronics PDF
Sivakumar P R
Founder and CEO
www.maven-silicon.com 1
All the videos, presentations, documents, user guides and source codes
that you are using as part of this online training course are the
proprietary work of Maven Silicon and is fully protected under
copyright and trade secret laws.
www.maven-silicon.com 2
1
2
Maven Silicon Confidential
Specification Floor Planning
Architecture Placement
GDSII
To foundry
www.maven-silicon.com 3
Digital Electronics
Sivakumar P R
Founder and CEO
www.maven-silicon.com 4
2
4
Course Agenda
www.maven-silicon.com 5
Course Agenda
www.maven-silicon.com 6
3
6
Number Systems
www.maven-silicon.com 7
Agenda
www.maven-silicon.com 8
4
8
Number Systems
What is Number System?
It can be defined as the Language of Numbers
Each Language contains different set of symbols for representation
of numbers.
The most commonly used number systems are
Decimal Number System.
Binary Number System.
Octal Number System. Radix or Base
Hexa Decimal Number System.
www.maven-silicon.com 9
Number Systems
Decimal Number System
Example : 12495 (10)
9ABD5 (16)
www.maven-silicon.com 10
5
10
Number system conversions
Any radix to Decimal number system
No. of digits to the left of the radix point.
Value of the number
11
In this case,
p = No. of digits to the left of the radix point
n = No. of digits to the right of the radix point
d = Value of the number
r = Radix of the number system = 2
www.maven-silicon.com 12
6
12
Decimal to other number system
Integer part of Decimal number
Successive Division
by Required Radix number
www.maven-silicon.com 13
13
www.maven-silicon.com 14
7
14
Decimal to other number system
Successive multiplication
www.maven-silicon.com 15
15
Binary to Octal
Appending ‘ 0’s ’ at
MSB position of integer
part, doesn’t change
the value of the
3 5 3 number.
www.maven-silicon.com 16
8
16
Binary to Hexa
www.maven-silicon.com 17
17
Octal to Binary
www.maven-silicon.com 18
9
18
Hexa to Binary
www.maven-silicon.com 19
19
Signed Numbers
www.maven-silicon.com 20
10
20
Sign – Magnitude Representation
MSB is used as sign bit & the other bits represents the magnitude.
Example:
Shortcomings:
• Complex Circuits 00000 +0
• Two representations for 0 10000 -0
www.maven-silicon.com 21
21
Complement Representation
1’s complement - Complementing all bits
Example :
www.maven-silicon.com 22
11
22
2’s Complement for Binary Arithmetic
Addition Subtraction
Key Points
For Subtraction, Take 2’s
Complement of the negative
number and add it with the other
number.
Carry 1 indicates positive number
Carry 0 indicates negative number.
2’s complement of 1101 is 0011
www.maven-silicon.com 23
23
www.maven-silicon.com 24
12
24
Arithmetic using Complement System
www.maven-silicon.com 25
25
www.maven-silicon.com 26
13
26
Codes
Symbolic representation
Types of codes
Weighted binary codes.
Non-weighted codes.
Alphanumeric codes.
Error detecting codes.
www.maven-silicon.com 27
27
www.maven-silicon.com 28
14
28
Non – Weighted Codes
Non –weighted codes are not positional weighted.
Example : Decimal Binary Gray
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
Gray Code 4 0100 0110
• The no. of bit changes is only one
5 0101 0111
between two consecutive numbers
• Used in low power applications 6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
www.maven-silicon.com 29
29
www.maven-silicon.com 30
15
30
ASCII
ASCII stands for American Standard Code for Information
Interchange
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT EF CR SO SI
1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
2 ! -- # $ % & . ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : : < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ / ] ^ _
6 . a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { l } ~ DEL
31
Other codes
www.maven-silicon.com 32
16
32
Logic Circuits
www.maven-silicon.com 33
33
Agenda
Logic gates
Boolean Algebra
NAND and NOR Circuits
Logic Minimisation
www.maven-silicon.com 34
17
34
Logic Gates
NOT gate (Inverter) Truth Table of NOT gate
A(I/P) Y(O/P)
A Y=A
0 1
1 0
35
Logic Gates
OR gate Truth Table of OR gate
A A B Y(O/P)
Y=A+B
B 0 0 0
0 1 1
1 0 1
1 1 1
NAND gate Truth Table of NAND gate
A B Y(O/P)
A
A.B 0 0 1
B
0 1 1
1 0 1
1 1 0
www.maven-silicon.com 36
18
36
Logic Gates
NOR gate Truth Table of NOR gate
A B Y(O/P)
A
A + B 0 0 1
B
0 1 0
1 0 0
1 1 0
XOR gate Truth Table of XOR gate
A B Y(O/P)
A
A + B 0 0 0
B
=AB+AB 0 1 1
1 0 1
1 1 0
www.maven-silicon.com 37
37
A B EXOR
Vcc
A A A B
B B
Inverter
Buffer
www.maven-silicon.com 38
19
38
Properties of XOR Gate
A B EXOR
Since, the total no. of 1’s in inputs and output is even. So, we can consider it as Even
Parity Generator.
Since, No. of 1’s in inputs, is odd. Output has become 1. So, we can consider it as odd
parity detector.
www.maven-silicon.com 39
39
Logic Gates
EXNOR gate Truth Table of EXNOR gate
A A B Y(O/P)
A + B
B 0 0 1
=AB+AB 0 1 0
Can be called
1 0 0
as Equality 1 1 1
Gate
www.maven-silicon.com 40
20
40
Boolean Algebra
(T1) X+0=X (T1') X . 1 = X
(T2) X+1=1 (T2') X . 0 = 0
(T3) X+X=X (T3') X . X = X
(T4) (X') ' = X
(T5) X + X' = 1 (T5') X . X' = 0
41
Boolean Algebra
Expression Dual of the Expression
www.maven-silicon.com 42
21
42
Proof for Consensus Theorem
www.maven-silicon.com 43
43
Gate Equivalents
De Morgan’s rules.
A A A+B A.B
A.B
B B
A A A.B A+B
A + B
B B
A A A+B A.B
A.B
B B
A A A.B A+B
A+B
B B
www.maven-silicon.com 44
22
44
Complement
The complement of a function F is denoted by F' or F
DeMorgan's theorems to compute the complement of a function.
www.maven-silicon.com 45
45
A
A AB
D CD
D
www.maven-silicon.com 46
23
46
Function from circuit
Determine the output function from the given circuit.
A
A A + B = A.B
B
AB .CD
C = AB+CD
D = A+B+C+D
CD
D
www.maven-silicon.com 47
47
www.maven-silicon.com 48
24
48
SOP
A B C Y(O/P)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
To get Complement, Write
1 1 0 1 only the leftout Terms
1 1 1 0
www.maven-silicon.com 49
49
POS
A B C Y(O/P)
0 0 0 1
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1 To get Complement,
1 1 0 0 Write only the left out
Terms
1 1 1 1
www.maven-silicon.com 50
25
50
Positive Logic Vs Negative Logic
Positive Logic Negative Logic
A B Y A B Y
0 0 0 1 1 1
0 1 0 1 0 1
1 0 0 0 1 1
1 1 1 0 0 0
www.maven-silicon.com 51
51
SOP Vs POS
Truth Table
SOP
+ ve Logic NAND Circuit
Truth Table
POS
- ve Logic NOR Circuit
www.maven-silicon.com 52
26
52
Universal Logic Elements
www.maven-silicon.com 53
53
NAND Vs NOR
NAND NOR
54
SOP - NAND Gates
A`
B A`
B B
C B
A` C
C A`
C
www.maven-silicon.com 55
55
Notice the fact that a pair of inverters in cascade doesn’t alter the functionality
A`
B
B
C
Now, the logic circuit
A` consists of NAND gates only
C
www.maven-silicon.com 56
28
56
SOP - NOR Gates
Step 1: Implement the Logic Step 2: Replace the Input & Output
Circuit Normally. wires with a pair of inverters connected
in cascaded.
57
Step 3: replace the bubbled AND Gates at the inputs with NOR
Gate& replace the Inverter with 2 i/p NOR Gate with both the
i/p’s shorted.
A
B`
B`
C`
Now, the logic circuit
A consists of NOR gates only
C`
www.maven-silicon.com 58
29
58
POS - NOR Gates
www.maven-silicon.com 59
59
Notice the fact that a pair of inverters in cascade doesn’t alter the functionality
A`
B
B
C
A` Now, the logic circuit
consists of NOR gates only
C
www.maven-silicon.com 60
30
60
POS - NAND Gates
Step 1: Implement the Logic Step 2: Replace the Input & Output
Circuit Normally. wires with a pair of inverters connected
in cascaded.
www.maven-silicon.com 61
61
www.maven-silicon.com 62
31
62
Implement the function
X + X’Y = X + Y
www.maven-silicon.com 63
63
Logic Minimization
Advantages of Logic Minimization
Less no. of gates for implementation.
Size of the circuit will be less.
Less amount of power consumption.
More speed of operation of the Logic Circuuit.
www.maven-silicon.com 64
32
64
Logic Minimization
Minimize the following expression
C
Y=C
www.maven-silicon.com 65
65
Logic Minimization
Minimize the following expression
www.maven-silicon.com 66
33
66
Karnaugh Map
CD
AB 00 01 11 10 These cells marked with a
specific numbers to
00 0000 0001 0011 0010 represent the corresponding
minterm or maxterm
0 1 3 2
www.maven-silicon.com 67
67
Karnaugh Map
0 1 0 0
0 0 0 1 1 0 0 1 0 0
0 1 0 1 1 1 1 1 1 1
0 1 0 0
www.maven-silicon.com 68
34
68
Karnaugh Map
1 1 0 0
1 0 1 1
1 1 0 0
1 0 1 1
www.maven-silicon.com 69
69
Karnaugh Map
1 1 0 0 1 1 0 0
0 0 1 0 0 0 1 0
0 1 1 1 0 1 1 1
1 1 0 0 1 1 0 0
www.maven-silicon.com 70
35
70
Karnaugh Map - POS
1 0 0 1
0 1 1 0
0 1 1 1
1 1 0 1
www.maven-silicon.com 71
71
Karnaugh Map
1 0 0 1 1 0 0 1
0 1 1 0 0 1 1 0
0 1 1 1 0 1 1 1
1 1 0 1 1 1 0 1
www.maven-silicon.com 72
36
72
Don’t Care Conditions
www.maven-silicon.com 73
73
0 0 1 1
1 0 0 1
1 X 0 X
0 0 1 X
www.maven-silicon.com 74
37
74
K Map Example
Design a circuit for the following output waveforms.
Inputs Outputs
A Time
A B C Fa Fb
B t0 0 0 0 0 0
t1 0 0 1 1 1
C
t2 0 1 0 1 0
t3 0 1 1 0 1
fa (A, B, C)
t4 1 0 0 0 0
t5 1 0 1 0 1
fb (A, B, C)
t6 1 1 0 1 1
t0 t1 t2 t3 t4 t5 t6 t7
t7 1 1 1 1 0
www.maven-silicon.com 75
75
K Map Example
0 1 0 1 0 1 1 0
0 0 1 1 0 1 0 1
www.maven-silicon.com 76
38
76
Combinational Circuits - I
www.maven-silicon.com 77
77
Agenda
www.maven-silicon.com 78
39
78
Digital Logic Circuits
Classification of Logic Circuits
www.maven-silicon.com 79
79
Steps to Design
Understand Problem description and Draw the Block Diagram with
I/P & O/P lines.
Define the truth table based on the functionality.
Get the simplified expression.
Implement the Logic circuit.
www.maven-silicon.com 80
40
80
Combinational Logic Design
Design a combinational circuit with the
specifications given below.
A switching circuit has two control inputs (C1,C2),two data inputs
(X1,X2) and one output (Z). The circuit performs one of the logic
operations on the two data inputs. The function performed depends on
the control inputs as shown below
C1
C1 C2 Operation
C2 0 0 OR
Combinational Z
0 1 EXOR
Logic Circuit
X1 1 0 AND
X2 1 1 EQU
www.maven-silicon.com 81
81
Truth Table
C1 C2 X1 X2 Output (Z)
0 0 0 0 0
0 0 0 1 1
0 0 1 0
OR
C1 C2 Operation 1
0 0 1 1 1
0 0 OR
0 1 0 0 0
0 1 EXOR
0 1 0 1 1
1 0 AND
0 1 1 0 1
EXOR
1 1 EQU
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
AND
With 4 input lines, 16 1 0 1 1 1
possible. 1 1 0 1 0
EXNOR
1 1 1 0 0
1 1 1 1 1
www.maven-silicon.com 82
41
82
Minimization
0 1 1 1
0 1 0 1
1 0 1 0
Possible groupings:
Z = C1'X1'X2 + C1'X1X2' + C1X1X2 + C1'C2' X2 + C1C2X1'X2'
0 0 1 0
Z = C1'X1'X2 + C1'X1X2' + C1C2X1'X2' + C1X1X2 + C1'C2'X1
www.maven-silicon.com 83
83
Implementation
Implementation with
NAND Gates only.
www.maven-silicon.com 84
42
84
RTL Design
Frequency = 1 / T
www.maven-silicon.com 85
85
I/P O/P
www.maven-silicon.com 86
43
86
Delays in Combinational Circuits
Using the following table of timing specifications for each component, what
is the TPD value for the circuit shown below?
30
Gate Tcd Tpd
30
30 INV 3ps 15ps
15
50 ND2 5ps 30ps
AN2 12ps 50ps
50 NR2 5ps 30ps
OR2 12ps 50ps
87
RTL Design
Com Com
Inte
IP 1 IP 2
Comb
IP 3
Frequency = 1 / T
www.maven-silicon.com 88
44
88
Adders & Subtractors
www.maven-silicon.com 89
89
B Carry 1 0 0 1
1 1 1 0
www.maven-silicon.com 90
45
90
Adders – Half Adders
Specifications of Half Adder
Adds 2 bits - A,B & produces Sum & Carry as Outputs
Circuit Digram
A
B Sum
Carry
www.maven-silicon.com 91
91
www.maven-silicon.com 92
46
92
Implementation of Full Adder
Boolean Expressions
0 1 0 1 0 0 1 0
1 0 1 0 0 1 1 1
www.maven-silicon.com 93
93
www.maven-silicon.com 94
47
94
Another Version
C
Implementation of full adder using Carry
Two half adders & OR Gate. www.maven-silicon.com 95
95
4-bit Adder
1 1 0 C2 C1 C0
10 1 0 1 0 A A3 A2 A1 A0
+7 + 0 1 1 1 +B + B3 B2 B1 B0
17 1 0 0 0 1 Cout S3 S2 S1 S0
www.maven-silicon.com 96
48
96
Delays in a 4-bit Adder
97
www.maven-silicon.com 98
49
98
4-bit Carry Look Ahead Adder
Truth Table of Full Adder
A B Cin C-out Sum
0 0 0 0 0
0 0 1 0 1
A + B generates carry, if and only if
0 1 0 0 1
both A and B are 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0 A + B propagates carry, if either
1 1 0 1 0 one of A or B is 1
1 1 1 1 1
www.maven-silicon.com 99
99
www.maven-silicon.com 100
50
100
4-bit Carry Look Ahead Adder
All sum & carry expressions are So, these expressions can be used to
independent of any carry from the realize the hardware of the adder to
previous stage. improve the speed.
www.maven-silicon.com 101
101
102
Subtractors – Half Subtractor
Specifications of Half Subtractor
Subtracts B from A & produces Difference & Borrow as Outputs
www.maven-silicon.com 103
103
Circuit Diagram
www.maven-silicon.com 104
52
104
Adders – Full Subtractor
Specifications of Full Subtractor
Subtracts B and Borrow-in from A
www.maven-silicon.com 105
105
Another Version
C
Implementation of full Subtractor
using Borrow
Two half subtractors & OR Gate. www.maven-silicon.com 106
53
106
Adder Subtractor Circuit
A+B A+B A+ B +0
A- B A + 2’s Comp(B) A + 1’s Comp(B) + 1
www.maven-silicon.com 107
107
www.maven-silicon.com 108
54
108
Combinational Circuits - II
www.maven-silicon.com 109
109
Agenda
www.maven-silicon.com 110
55
110
Encoders
Encoders
Converts Human understandable into machine understandable
codes
Assigns a binary code to an active input line.
One hot to binary converter,
Produces n no. of outputs when there is 2^n no. of inputs,
At most only one of the inputs will ever be high, the binary code
of this 'hot' line is produced
www.maven-silicon.com 111
111
4:2 Encoder
D0 Y0 D3 D2 D1 D0 Y1 Y0
D1 0 0 0 1 0 0
4: 2 Encoder 0 0 1 0 0 1
D2
0 1 0 0 1 0
D3 Y1 1 0 0 0 1 1
www.maven-silicon.com 112
56
112
Decimal to Binary Encoder
Specifications
Take 10 keys as Decimal inputs & produce 4 bit Binary
Output based on the input key What if more than one input is active?
What if no inputs are active?
Block Diagram, Truth Table
D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 Y3 Y2 Y1 Y0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 1
1
0 0 0 0 0 0 0 1 0 0 0 0 1 0
0 0 0 0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
0 0 0 0 1 0 0 0 0 0 0 1 0 1
1 0 0 0 1 0 0 0 0 0 0 0 1 1 0
0 0 1 0 0 0 0 0 0 0 0 1 1 1
0 0 1 0 0 0 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 0 0 0 1 0 0 1
Remaining Combinations X X X X
www.maven-silicon.com 113
113
Priority Encoder
Priority Encoders
Assign priorities to the inputs when more than one input are
asserted simultaneously,
Highest priority input is taken into account to produce the
binary output.
At least any one of the input line should be active, to make the
encoder valid. A ‘valid’ indicator, is included to indicate the
same.
www.maven-silicon.com 114
57
114
8:3 Priority Encoder
Priority to higher order inputs.
D7 D7 D6 D5 D4 D3 D2 D1 D0 Y2 Y1 Y0 Valid
D6 Y2 0 0 0 0 0 0 0 0 X X X 0
D5 0 0 0 0 0 0 0 1 0 0 0 1
Y1
D4 0 0 0 0 0 0 1 X 0 0 1 1
8:3 Priority Y0
0 0 0 0 0 1 X X 0 1 0 1
D3 Encoder
0 0 0 0 1 X X X 0 1 1 1
D2
0 0 0 1 X X X X 1 0 0 1
D1
V 0 0 1 X X X X X 1 0 1 1
D0
0 1 X X X X X X 1 1 0 1
1 X X X X X X X 1 1 1 1
www.maven-silicon.com 115
115
ASCII Encoder
ASCII stands for American Standard Code for Information
Interchange
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT EF CR SO SI
1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
2 ! -- # $ % & . ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : : < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ / ] ^ _
6 . a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { l } ~ DEL
116
Decoders
Covert Machine understandable into Human understandable codes
Convert binary information from n input signals to 2n unique
output signals
used in a wide variety of applications, including data
demultiplexing, seven segment displays, and memory address
decoding.
www.maven-silicon.com 117
117
2:4 Decoder
D1 D0 Y3 Y2 Y1 Y0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
Possible minterms
of D1 and D0
With N to 2N Decoder,
N Variable function can
be implemented
www.maven-silicon.com 118 59
118
Decoders with Active High & Low O/P with Enable inputs.
119
1
1
0
BCD to
7-segment Display 1
Decoder 1
0
1
www.maven-silicon.com 120
60
120
Circuit Design using Decoders
www.maven-silicon.com 121
121
m0
A MSB m1
m2
Sum
m3
B 3:8 Decoder m
4
m5
Cin LSB m6
m7
Carry
www.maven-silicon.com 122
61
122
Boolean Functions using Decoders
m0
A MSB m1
Y
m2
m3
B 3:8 Decoder m
4
m5
C LSB m6
m7
www.maven-silicon.com 123
123
www.maven-silicon.com 124
62
124
Multiplexer (MUX)
Logic Symbol & Functionality
Single output line
I0
One of the data input is routed to
I1 o/p
‘2n’ no. of the output based on the select
MUX
inputs signals.
I2n-1
‘n’ no. of
Select lines
www.maven-silicon.com 125
125
2:1 MUX
Truth Table
I0 S0 I1 I0 O/P
o/p 0 0 0 0
0 0 1 1 O/P same
I1 0 1 0 0 as I0
0 1 1 1
S0 1 0 0 0
1 0 1 0 O/P same
Functional Table 1 1 0 1 as I1
1 1 1 1
S0 O/P
0 I0
1 I1
www.maven-silicon.com 126
63
126
4:1 MUX
Functional Table
I0
S1 S0 O/P
o/p
I1 0 0 I0
I2 0 1 I1
I3
1 0 I2
1 1 I3
S1 S0
www.maven-silicon.com 127
127
www.maven-silicon.com 128
64
128
MUX – Universal Logic
www.maven-silicon.com 129
129
A O/P (Y) 1
0 1 I0 A’
0
1 0 I1 A
Outputs as
Input Signal as
Data Inputs
Select Signal
www.maven-silicon.com 130
65
130
Implementing Logic Gates using MUX
MUX as AND gate
0
II00
0 o/p
II11
0
II22
A B O/P (Y)
1
0 0 0 II33 S0
I0 = 0 S1
0 1 0
1 0 0 A B
I1 = B
1 1 1 0
AB
B
A
www.maven-silicon.com 131
131
OR gate
www.maven-silicon.com 132
66
132
Implementing Logic Gates using MUX
www.maven-silicon.com 133
133
www.maven-silicon.com 134
67
134
Function Implementation Using MUX
A B C D Y
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
www.maven-silicon.com 135
135
A B C D Y
0 0 0 0 0
0 0 0 1 1
I0 = D
0 0 1 0 1
0 0 1 1 1
I1 = 1
0 1 0 0 0
0 1 0 1 0
I2 = 0
0 1 1 0 1
0 1 1 1 1
I3 = 1
1 0 0 0 0
1 0 0 1 1
I4 = D
1 0 1 0 0
1 0 1 1 0
I5 = 0
1 1 0 0 0
1 1 0 1 1
I6 = D
1 1 1 0 1
1 1 1 1 0
I7 = D’
www.maven-silicon.com 136
68
136
Implement Using 4: 1 MUX
A B C D Y
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
I0 = C +D
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
I1 = C
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
I2 = C’D
1 0 1 1 0
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
I3 = C ^D
1 1 1 1 0
www.maven-silicon.com 137
137
Known as Shannon’s
Expression for 2:1 MUX
www.maven-silicon.com 138
69
138
Hierarchical Design
Several issues arise when designing large multiplexers(as 2-level circuits).
• Number of logic gates gets prohibitively large
• Number of inputs to each logic gate (i.e. fan-in) gets prohibitively large
www.maven-silicon.com 139
139
140
8:1 MUX using 4:1 & 2:1 MUX
Truth Table I0 0
S2 S1 S0 O/P
I1 1 Y0
I2 2
0 0 0 I0
0 0 1 I1 I3 3 0
Y0 1 0
0 1 0 I2 Y
S1 S0
0 1 1 I3
1 1
1 0 0 I4 I4 0 0
1 0 1 I5 S2
Y1 I5 1 Y1
1 1 0 I6
I6 2
1 1 1 I7
I7 3
www.maven-silicon.com 141
141
Demultiplexer (DeMUX)
Logic Symbol & Functionality
It's operation is just opposite to
that of a Multiplexer.
Depending on the data on the
select lines, the input will be
redirected to any one specific
output line.
www.maven-silicon.com 142
71
142
1:4 DeMUX
i/p Y1
Y2
Y3
S1 S0
www.maven-silicon.com 143
143
Tristate Buffer
www.maven-silicon.com 144
72
144
Tri State Buffers
Tristate Buffer with Active HIGH Control
Data I/P C X Carry
(X) O/P 0 0 Z
(Z) 0 1 Z
1 0 0
Control I/P (C)
1 1 1
www.maven-silicon.com 145
145
Memory Circuit
WE Mode
0 Switches
1 Counter
WE Mode
0 Write
1 Read
www.maven-silicon.com 146
73
146
Sequential Logic Circuits - I
www.maven-silicon.com 147
147
Agenda
www.maven-silicon.com 148
74
148
Sequential Logic Circuits
‘m’ no. of
inputs Combinational ‘n’ no. of
Logic Circuit outputs
Memory
The output depends on the input & past state of the circuit.
Memory Units
www.maven-silicon.com 149
149
Memory units
www.maven-silicon.com 150
75
150
Logic Circuits as memory units
www.maven-silicon.com 151
151
If A = 0, then Y = B’.
This states that if one of the input to NOR gate is grounded, then
that NOR gate will act as a NOT gate.
www.maven-silicon.com 152
76
152
1-bit memory cell
In this memory cell, these two inverters can be replaced with a pair
of NOR gates with one input connected to ground.
In this circuit, the feedback is in such a way that, output of first
inverter is input to the second inverter & output of second inverter
is the input to the first inverter.
www.maven-silicon.com 153
153
www.maven-silicon.com 154
77
154
1-bit memory cell
155
This states that if one of the input to NOR gate is 0, then the output of the
NOR gate will be complement to the remaining input.
This indicates that, if one of the input is 0, then we cannot predict the output
of the NOR gate without having the knowledge of the remaining input.
www.maven-silicon.com 156
78
156
Behaviour of a NOR gate
A B Y
0 0 1
A Y
0 1 0
B 0
1 0
1 1 0
This states that if one of the input to NOR gate is 1, then the output of the
NOR gate will be always 0 irrespective of the remaining input.
This indicates that, if one of the input is 1, then we can easily predict the
output of the NOR gate without having the knowledge of the remaining input.
www.maven-silicon.com 157
157
RS Latch
0 1 R S Q Q’ State
0 1 1 0 Set
0
1
Recollect the fact that, if one of the input The outputs for this input
to NOR is 1, then output will be ‘0’. combination is 1 & 0.
www.maven-silicon.com 158
79
158
RS Latch
0 1 R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
0
0
www.maven-silicon.com 159
159
RS Latch
1 0 R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
1 0 0 1 Reset
1
0
Recollect the fact that, if one of the The outputs for this input
input to NOR is 1, then output will be ‘0’. combination is 0 & 1.
www.maven-silicon.com 160
80
160
RS Latch
0 0 R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
1 0 0 1 Reset
1 0 0 0 1 No Change
www.maven-silicon.com 161
161
RS Latch
1 0 R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
1 0 0 1 Reset
0 0 0 1 No Change
1
0 1 1 0 0 Invalid
www.maven-silicon.com 162
81
162
RS Latch
0 X R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
1 0 0 1 Reset
X 0 0 0 1 No Change
1 1 0 0 Invalid
0
0 0 X X RACE
1. At the o/p terminals, both 1 & 0 will be
Q 1 0 1 0 1 racing with each other even though
there is no change in the i/p .
2. If invalid combination of i/p is
Q’ 1 0 1 0 1 followed by no change combination of
i/p, race around condition occurs.
www.maven-silicon.com 163
163
RS Latch
R S Q Q’ State
0 1 1 0 Set
0 0 1 0 No Change
1 0 0 1 Reset
0 0 0 1 No Change
1 1 0 0 Invalid
0 0 - - RACE
www.maven-silicon.com 164
82
164
RS Latch – NAND Gates
S’ R’ Q Q’ State
0 1 1 0 Set
1 1 1 0 No change
1 0 0 1 Reset
1 1 0 1 No change
0 0 1 1 Invalid
1 1 - - RACE
The only difference is RS Latch with NOR gates is active HIGH Latch
where as RS Latch with NAND gates is active LOW Latch.
In this case, (0 & 0) input combination is an invalid combination of input
and (1 & 1) input combination doesn’t bring any change in the output.
www.maven-silicon.com 165
165
Gated RS Latch
1
C S R S’ R’ Q Q’ State
0 X X 1 1 No Change
0
1 0 0 1 1 No Change
1 0 1 1 0 0 1 Reset
1 1 1 0 0 1 1 0 Set
1 1 1 0 0 - - Invalid
www.maven-silicon.com 166
83
166
Gated D Latch
C S R S’ R’ Q Q’ State
0 X X 1 1 No Change
1 0 0 1 1 No Change
1 0 1 1 0 0 1 Reset
1 1 0 0 1 1 0 Set
1 1 1 0 0 - - Invalid
C D Q Q’ State
0 X No Change
1 0 0 1 Reset
1 1 1 0 Set
www.maven-silicon.com 167
167
Gated D Latch
www.maven-silicon.com 168
84
168
Master Slave Configuration
www.maven-silicon.com 169
169
www.maven-silicon.com 170
85
170
Master Slave Configuration
www.maven-silicon.com 171
171
Construction of Flipflops
Negative Edge Sensitive flipflop is constructed by using HIGH
level latch as master and LOW level latch as slave.
www.maven-silicon.com 172
86
172
SR Flip-flop
Truth Table
Clk S R Q+ State
X X Q No Change
0 0 Q No Change
0 1 0 Reset
1 0 1 Set
1 1 - Invalid
173
D Flip-flop
Truth Table
Clk D Q+ State
X Q No Change
0 0 Reset
1 1 Set
174
JK Flip-flop
Truth Table
Clk J K Q+ State
X X Q No Change
0 0 Q No Change
0 1 0 Reset
1 0 1 Set
1 1 Q’ Toggle
175
T Flip-flop
Truth Table
Clk T Q+ State
X X No Change
0 Q No Change
1 Q` Toggle
www.maven-silicon.com 176
88
176
Symbols of flipflops
Positive Edge D flipflop Positive Edge RS flipflop
www.maven-silicon.com 177
177
Symbols of flipflops
Positive Edge JK flipflop Positive Edge T flipflop
www.maven-silicon.com 178
89
178
Timing Waveform
Draw the timing waveform for the below components, which receives same
Clk and D input signals.
CLK
QL
Qp
Qn
www.maven-silicon.com 179
179
www.maven-silicon.com 180
90
180
Flipflops with Asynchronous inputs.
Flipflop with active HIGH Asynchronous Inputs.
www.maven-silicon.com 181
181
www.maven-silicon.com 182
91
182
Synchronous Clear
www.maven-silicon.com 183
183
www.maven-silicon.com 184
92
184
Delays in Sequential Circuits
D2Q Delay : change in input D alone cannot bring a change in the
output . So, D2Q delay is not valid.
Clk2Q Delay : Time taken by the flipflop to provide a stable output
after a clock edge occurs.
R2Q Delay : Time taken by flipflop to come to RESET state after
the application of asynchronous CLEAR input.
S2Q Delay : Time taken by flipflop to come to SET state after the
application of asynchronous PRESET input.
www.maven-silicon.com 185
185
www.maven-silicon.com 186
93
186
Setup & Hold Times
A hold time violation is when a input signal change too quickly, after
the clock's active transition
A setup time violation is when a signal arrives too late, and misses
the time when it should advance.
If the setup or hold time parameters are violated, the output would be
either logic0, logic1 or metastable state (output oscillates between 0
& 1).
www.maven-silicon.com 187
187
FF Conversions
www.maven-silicon.com 188
94
188
Sequential Logic Circuits - II
www.maven-silicon.com 189
189
Agenda
Registers
Counters
www.maven-silicon.com 190
95
190
Registers
www.maven-silicon.com 191
191
Classification of Registers
Registers
www.maven-silicon.com 192
96
192
Functionality of a D flipflop
0 0 1 1
www.maven-silicon.com 193
193
Buffer Register
www.maven-silicon.com 194
97
194
Serial Shift Registers
Serial In Serial Out ( Right Shift ) Serial In Serial Out ( Left Shift )
www.maven-silicon.com 195
195
www.maven-silicon.com 196
98
196
SISO Shift Registers
www.maven-silicon.com 197
197
www.maven-silicon.com 198
99
198
PISO Shift Register
0 1 1
1
www.maven-silicon.com 199
199
1 0 1
www.maven-silicon.com 200
100
200
PIPO Shift Register
www.maven-silicon.com 201
201
www.maven-silicon.com 202
101
202
Bidirectional Shift Registers
www.maven-silicon.com 203
203
Counters
What is a counter ?
As the name suggests, it counts the no. of clock pulses.
This counting can be done in a
Sequential manner to count the no. of clock pulses.
Random manner to generate a specific sequence.
www.maven-silicon.com 204
102
204
Classification of Counters
Counters can be classified based on
Clock : Synchronous or Asynchronous
Clock Trigger : Posedge trigger or Negedge trigger.
Counts : Binary, Decade
Count Direction : UP, DOWN, UP-DOWN, RANDOM
Flipflops Used : JK or T or D.
www.maven-silicon.com 205
205
www.maven-silicon.com 206
103
206
Asynchronous counter
3 Bit Asyn Down Counter using +ve edge triggered FF
www.maven-silicon.com 207
207
Asynchronous counter
3-bit Asyn. up counter using Posedge triggered T-Flip Flop
www.maven-silicon.com 208
104
208
UP/DOWN Counter
www.maven-silicon.com 209
209
UP/DOWN Counter
www.maven-silicon.com 210
105
210
Asynchronous counter
3-bit Asyn. up counter using Negedge triggered T-Flip Flop
www.maven-silicon.com 211
211
Asynchronous counter
3-bit Asyn. down counter using Negedge triggered T-Flip Flop
www.maven-silicon.com 212
106
212
Synchronous UP Counter
UP Counting Sequence
Q2 Q1 Q0
Q0 toogles for every cycle.
0 0 0
0 0 1 And Q1 toggles only when Q0
0 1 0 is ‘1’
0 1 1
Q2 toggles only if (Q1 & Q0)
1 0 0
are ‘1’.
1 0 1
1 1 0 Important Point : T FF toggles
1 1 1 only when the T input is ‘1’
0 0 0
www.maven-silicon.com 213
213
Synchronous UP Counter
Q0 toggles for every cycle. So, T0 should be supplied with ‘1’.
www.maven-silicon.com 214
107
214
Synchronous UP Counter
www.maven-silicon.com 215
215
www.maven-silicon.com 216
108
216
Modulus of a Counter
The number of unique states that a counter may have before the
sequence repeats itself is the modulus of the counter.
An UP counter with 3 flipflops counts from 0 to 7 and again repeats
from 0 after 7. So, the no. of states is 8 (i.e., 0 to 7).
So, a counter with ‘n’ no. of flipflops counts from 0 to 2n-1. So, the
Modulus of this counter is 2n.
The output frequency of the last FF of any counter will be the clock
frequency divided by the MOD of the counter.
A T flipflop with T input tied to Vcc acts as divide by 2 counter.
www.maven-silicon.com 217
217
Mod-16 Counter
www.maven-silicon.com 218
109
218
Frequency Division using Counters
Q0 Q1 Q2 Q3
Clk
Q0
Q1
Q2
Q3
www.maven-silicon.com 219
219
www.maven-silicon.com 220
110
220
Counter Design
www.maven-silicon.com 221
221
Counter Design
Design a counter that generates the sequence.
0,2,3,5,6,0,---.
Counter using different 000
ffs are shown here
110 010
101 011
www.maven-silicon.com 222
111
222
Comparison
www.maven-silicon.com 223
223
Comparison
www.maven-silicon.com 224
112
224
Comparison
www.maven-silicon.com 225
225
We are aware of the fact that counters are used for producing a
special sequence of numbers.
Similarly, a shift register with the serial output connected back to
the serial input to produce special sequence.
Two of most common type of shift register counters are :
Ring counter
Johnson counter [ Shift Counter / twisted ring counters].
www.maven-silicon.com 226
113
226
Ring Counter
www.maven-silicon.com 227
227
Ring Counter
Cycle
Q0 Q1 Q2 Q3
Number Modulus of a ‘N’ bit ring
0 1 0 0 0 counter is ‘N’.
1 0 1 0 0
4 Cycles
2 0 0 1 0
3 0 0 0 1
4 1 0 0 0
5 0 1 0 0
4 Cycles
6 0 0 1 0
7 0 0 0 1 For every 4 clock cycles, this
counter goes into the same set
of states. So, modulus of a 4 bit
ring counter is 4.
www.maven-silicon.com 228
114
228
Twisted Ring Counter
www.maven-silicon.com 229
229
Cycle
Q0 Q1 Q2 Q3 Q3‘
Number
0 1 0 0 0 1
1 1 1 0 0 1
For every 8 clock cycles, this
2 1 1 1 0 1 counter goes into the same
3 1 1 1 1 0 set of states. So, modulus of
4 0 1 1 1 0 a 4 bit Jhonson counter is 8.
5 0 0 1 1 0
6 0 0 0 1 0
7 0 0 0 0 1 So, modulus of a ‘N’ bit
8 1 0 0 0 1 Jhonson counter is ‘2N’.
www.maven-silicon.com 230
115
230
Finite State Machines
www.maven-silicon.com 231
231
Agenda
www.maven-silicon.com 232
116
232
Finite State Machines
www.maven-silicon.com 233
233
Mealy Machines
I/P
next
state
Comb. Logic Seq. Logic for Comb. Logic O/P
for next determining the for the
state I/P Clk state. Output
www.maven-silicon.com 234
117
234
Moore Machines
I/P
next
state
Comb. Logic Seq. Logic for Comb. Logic O/P
for next determining the for the
state I/P Clk state. Output
www.maven-silicon.com 235
235
Mealy Vs Moore
Mealy Moore
Output depends on both input & current Output depends only on current state of
state of the circuit. the circuit.
Next state is dependent on both input & Next state is dependent on both input &
current state. current state.
Outputs are Asynchronous. So, glitches Outputs are Synchronous. So, glitches can
can occur. never occur.
Less no. of states. Obviously, less no. of More no. of states. Obviously, more no. of
flipflops are sufficient for implementation. flipflops are required for implementation.
www.maven-silicon.com 236
118
236
Mealy FSM
www.maven-silicon.com 237
237
www.maven-silicon.com 238
119
238
Sequence Detector - Moore
State Meaning
S0 Initial state
S1 0
S2 10
S3 110
S0 S1 S2 S3
www.maven-silicon.com
239
State Meaning
S0 Initial state
S1 0
S2 10
S0 S1 S2
www.maven-silicon.com
120
240
Sequence Detectors
Example
Lets consider a sequence recognizer which is capable of detecting
1001 Sequence.
Cycle Number 1 2 3 4 5 6 7 8 9 10 11 12
Input Sequence 0 1 0 0 1 0 0 1 1 0 0 1
O/P for overlapping
Seq. Detector
0 0 0 0 1 0 0 1 0 0 0 1
O/P of non overlapping
Seq. Detector
0 0 0 0 1 0 0 0 0 0 0 1
www.maven-silicon.com 241
241
State Meaning
S0 Initial state
S1 1
S2 01
S3 001
www.maven-silicon.com 242
121
242
Vending Machine - FSM Design
Specification
Design a vending machine which delivers a product when it
receives Rs.3/- and also it has to return the change if receives
Rs.4/- . The machine can take only two types of coins of
denomination 1 and 2 in any order.
Rst
P
Coin Vending
R
Machine
243
Vending Machine
State Meaning
S0 Initial state
S1 Re.1
S2 Rs.2
S3 Rs.3
S4 Rs.4
S0
P = 0, R=0
S1 S2 S4
P = 0, R=0 P = 0, R=0 P = 1, R=1
S3
P = 1, R=0
www.maven-silicon.com 244
122
244
Odd Parity Detector-FSM Design
Specification
Assert output whenever input bit stream has odd number of 1's.
EVEN
Z=0
Present Next State
I/P (X) O/P (Z)
State (Q) (Q+)
Even 0 Even 0
Even 1 Odd 0
ODD Odd
Odd 0 1
Z=1 Odd Even
1 1
www.maven-silicon.com 245
245
www.maven-silicon.com 246
123
246
Glitches & Hazards
www.maven-silicon.com 247
247
www.maven-silicon.com 248
124
248
Types of Hazards
Static 1 - Hazard
Possibility of a circuit's output producing a 0 glitch
when we would expect the output to remain at a
steady 1.
Static 0 - Hazard
Possibility of a circuit's output producing a 1 glitch
when we would expect the output to remain at a
steady 0.
Dynamic Hazard
Possibility of the output of a circuit changing more
number of times when it should change from (0 to
1) or (1 to 0).
www.maven-silicon.com 249
249
Elimination of Hazards
Technique 1
Adding delay to balance the delays in the parallel paths can
eliminate hazards since, unequal delays is the main cause of
these glitches.
www.maven-silicon.com 250
125
250
Elimination of Hazards
Technique 2
Adding the redundant gates can eliminate the hazards.
0 0 1 0
1 1 1 0
f = AB’ + BC + AC
www.maven-silicon.com 251
251
Elimination of Hazards
Technique 3
Adding the pipelining registers at the outputs the combinational
circuits.
www.maven-silicon.com 252
126
252
Memories
www.maven-silicon.com 253
253
Agenda
Classification of Memories
Basics of Memories
Composition of Memories
www.maven-silicon.com 254
127
254
Classification of Memories
www.maven-silicon.com 255
255
Classification of Memories
Optical memories like CD, DVD and magnetic memories like floppy, HDD
will come under other forms of memories.
Let’s concentrate more on semiconductor memories.
Sequential Access Memories : In these memories, data cannot be accessed
from random address locations. It can be accessed in a serial manner.
Random Access Memories : In these memories, data can be accessed from
random address locations.
FIFO & LIFO comes under sequential access memories.
Volatile Memories : In these memories, stored data will be lost, if there is a
loss in power supply.
www.maven-silicon.com 256
128
256
Classification of Memories
Non - Volatile Memories : In these memories, stored data will not be lost,
even if there is a loss in power supply.
SRAM & DRAM will come under volatile random access memories.
Synchronous DRAM : In these memories, the basic read & write will be
done in synchronism with a clock signal.
Asynchronous DRAM : In these memories, the basic read & write will not
be done in synchronism with a clock signal.
Single Data Rate: 1 Byte of data for each clock cycle, either at posedge or
negedge.
Double Data Rate : 2 Bytes of data for each clock cycle. One data at posedge
& second data at negedge.
www.maven-silicon.com 257
257
Classification of Memories
Double Data Rate – 2nd Gen : 4 Bytes of data for each clock cycle. two
bytes at posedge & two more bytes at negedge.
Double Data Rate – 3rd Gen : 8 Bytes of data for each clock cycle. four
bytes at posedge & four more bytes at negedge.
Double Data Rate – 4th Gen : 16 Bytes of data for each clock cycle. eight
bytes at posedge & eight more bytes at negedge.
In these days, DDR4 is the commonly used memory in LAPTOP’s & Servers.
ROM: Data stored in these memories is fixed at the time of fabricating the
memories and cannot be changed again.
No further write operation is possible. Only READ operation is possible.
Programmable ROM: These memory chips can be programmed only once.
www.maven-silicon.com 258
129
258
Classification of Memories
Erasable Programmable ROM : These memory chips can be programmed
for any no. of times & data will be erased by the application of UV light rays.
Data stored in these memories can be programmed by the user based on his
requirement. Both read & write are possible in these memories.
Electrically Erasable Programmable ROM. These memory chips can be
programmed for any no. of times & data will be erased by the application of
electrical signals.
Erasable Alterable Programmable ROM. These memories are special type
of EEPROMs and data can be written at the block level instead of byte level.
Can be programmed while in the circuit. USB drives, Memory cards & SSD’s
will come under this category.
www.maven-silicon.com 259
259
SRAM vs DRAM
Static RAM Dynamic RAM
Static RAM uses static devices like Dynamic RAM uses dynamic devices like
transistors & MOSFET’s to store the data. capacitors to store the data.
At least, 6 no. of transistors are required for One transistor & one capacitor are sufficient
implementing one bit memory cell. for implementing one bit memory.
Not area efficient. Occupies more area. Area efficient. Occupies less area.
No periodic refresh required. Periodic refresh required.
Less access time b/c of static devices. High access time b/c of usage of capacitors.
Standard IC fabrication process is sufficient Special IC fabrication process is required for
for fabricating these memories. fabricating these memories.
www.maven-silicon.com 260
130
260
Basic Concepts of Memories
8 bit information in each location
(word_size is 8 bits)
clk
rst 0 7 6 5 4 3 2 1 0
0
1
wr_enb 2
wr_addr 3
4 data_out
16
wr_data 8
8 12
13
rd_enb
14
15
rd_addr
4
16 * 8 Memory
www.maven-silicon.com 261
261
Composition of Memories
It is the process of creating large memory module using smaller
memory module.
The following are the different requirements.
We may need to construct a large memory with larger word
size (more bits per word) or
We may need to construct large memory with Wider
addressing space (more words) or
Both
www.maven-silicon.com 262
131
262
Memory with larger word size
MSB LSB
24 bit data_out
www.maven-silicon.com 263
263
www.maven-silicon.com 264
132
264
Memory with more words
O to 63
64 to 127
O to 255
128 to 191
192 to 255
data_out
www.maven-silicon.com 265
265
FIFO
Used to pass data between two asynchronous clock domains.
Used to pass data between two systems working with same clock
but with different throughput.
www.maven-silicon.com 266
133
266
Cache Memory
Speed
www.maven-silicon.com 267
267
Cache Memory
CPU Contains Registers and Cache Memory So, that it can access
frequently accessed data at a faster speed instead of accessing from
slower memories like RAM & HDD.
CPU has only few MB of Cache. But, CPU makes a tremendous use of
this small memory because the speed of data access in cache is high
because it need not do periodic refresh unlike DRAM.
Cache uses SRAM Technology. So, Many no. of memory cells cannot
be fabricated in a small processor. So, cache memories will be in the
order of MB unlike DRAM which will be in the order of GB.
For a better performance, Use a processor with more Cache Memory.
www.maven-silicon.com 268
134
268
VLSI Design
Thank You [email protected]
+91 74067 30555
www.maven-silicon.com
269
135