CSL316: Digital Hardware Design
Computer Science & Engineering Department I.I.T. Delhi
Copies of old Lecture Transparencies Instructor: M. Balakrishnan
S.No. Topic No. of Slides No. of Lectures 1. Introduction 20 2 2. Review of Combinational 56 5
Circuit Design
3. Sequential Circuits 83 7 4. Asynchronous Circuits 25 3 5. Microprogrammed Control 60 5 6. Introduction to VHDL 34 3 7. Testing of Digital Circuits 58 5 8. Advanced Topics 37 4
1
Chapter 1: Introduction 1
Digital Hardware Design
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 1: Introduction 2
Introduction
ā¢ What are digital systems ?
ā¢ Applications
ā¢ Design steps
Chapter 1: Introduction 3
Representation
ā¢ Discrete time for signalsā Clock for synchronous systems
ā¢ Quantized for all types of dataā Binary number representation
Chapter 1: Introduction 4
Advantages Over Analog
ā¢ Programmabilityā¢ Predictable accuracyā¢ Maintainability
Though Analog systems are still used at very high frequency
Chapter 1: Introduction 5
Applications
Nature of Application Time Constraintsā¢ Real time computing Hard
ā¢ Interactive computing Soft
ā¢ Off-line computing -
Chapter 1: Introduction 6
Digital System Examples
ā¢ Consumer electronicsā¢ Radar & sonar processingā¢ Control systemsā¢ General computingā¢ Mobile computing
2
Chapter 1: Introduction 7
System Design Steps
Verification
Verification
Specification
Circuit
Synthesis
Chapter 1: Introduction 8
Specification Language
ā¢ English(/any natural language)ā Ambiguous and not suitable for
processing by machineā¢ Hardware description language
ā Machine simulatable/executable but difficult to write
Chapter 1: Introduction 9
Synthesis Methodologies
Synthesis refers to the transformation of specification (behavior) torealization (structure)
ā¢ Manualā Ad-hocā Procedural
ā¢ Automated
Chapter 1: Introduction 10
Digital Systems DevelopmentTechnology & Issues
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 1: Introduction 11
Development of Digital Systems
ā¢ SSI: Small Scale Integrationā¢ MSI: Medium Scale Integrationā¢ LSI: Large Scale Integrationā¢ VLSI: Very Large Scale Integrationā¢ SOC: System on Chip
Chapter 1: Introduction 12
Driving Factor: Semiconductor Technology
ā¢ Key parameter (feature size)ā Distance between two conducting linesā Size of the transistor50.0 micron to 0.12 micron
ā¢ Driving Device: Memory
3
Chapter 1: Introduction 13
Impact on Cost
ā¢ Area is the measure of costā¢ Minimizing logic is less importantā¢ Interconnection area is very significant in
relation to logic areaā¢ Pin count and testing becoming a significant
part of the manufacturing cost
Chapter 1: Introduction 14
Impact on Performance
ā¢ Speed (mainly clock speed in synchronous systems) is the measure of performance
ā¢ Interestingly speed increases automatically with feature size reduction
ā¢ Interconnect delays very significantā¢ At high speed, interconnects start behaving
like transmission lines
Chapter 1: Introduction 15
Impact on Power
ā¢ CMOS is the dominant technologyā¢ Power as a major design metric along with
area and delay ā¢ Low voltage operationsā¢ Special packaging and cooling technologies
Chapter 1: Introduction 16
Design Levels
ā¢ Transistor level
ā¢ Gate level
ā¢ RTL level (register transfer level)
ā¢ Algorithm/behavioral level
Chapter 1: Introduction 17
Classification: Design Methodologies
ā¢ Processors: Instruction set (intermediate)
ā¢ ASICS: Top-down
ā¢ Memories: Bottom-up(other library cells as well)
Chapter 1: Introduction 18
Classification: Combinational or Sequential
ā¢ Combinational
ā¢ Synchronous (sequential)
ā¢ Asynchronous (sequential)
4
Chapter 1: Introduction 19
Course Outline
ā¢ Combinational circuit designā review, MSI blocks, iterative
ā¢ Sequential circuit designā FSM, RTL blocks
ā¢ Asynchronous sequential circuit design
Chapter 1: Introduction 20
Course Outline (contd.)
ā¢ Behavioural design with VHDLā¢ Datapath and control divisionā¢ Microprogrammed controlā¢ Testingā¢ Low power design
1
Chapter 2: Combinational Circuits 1
Review of Combinational Circuit Design
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 2: Combinational Circuits 2
Combinational Circuit: Definition
Inputs Outputsf
O = f ( I )
Present output(s) is a function of presentinputs only.
Chapter 2: Combinational Circuits 3
Boolean Functions
ā¢ AND, OR, NOT, NAND, NOR, EXOR etc.
ā¢ Unique truth table
ā¢ Total of 24 2-input functions
ā¢ Universal gate set {NAND}, {NOR} etc.Chapter 2: Combinational Circuits 4
Canonical Representation
ā¢ Sum of minterms
ā¢ Product of maxterms
Chapter 2: Combinational Circuits 5
Karnaugh Map
y = f(a,b,c,d) = Ī£ (0,3,4,7,8,11,15)
cdab
00 01 11 10
00 1 101 1 111 110 1 1
Chapter 2: Combinational Circuits 6
Karnaugh Map (contd.)
y = f(a,b,c,d) = Ī (1,5,9,13,15)
cdab
00 01 11 10
00 001 011 0 010 0
2
Chapter 2: Combinational Circuits 7
Duality
ā¢ Replace the following and any equality will holdā AND by OR and vice-versaā 0 by 1 and vice-versa
ā¢ Demorgonās lawsā (a + b)ā = aā.bāā (a.b)ā = aā + bā
Chapter 2: Combinational Circuits 8
Minimization Objectives
ā¢ Number of literals for cost/area
ā¢ Number of levels for time
Chapter 2: Combinational Circuits 9
Symmetric Functions
ā¢ Exchange variables and the function does not changeā e.g. parity function
Chapter 2: Combinational Circuits 10
Combinational Circuit Designusing MSI Blocks
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 2: Combinational Circuits 11
Incompletely Specified Functions
cdab
00 01 11 10
00 1 101 1 1 111 1 1 X X10 X X X X
y = f(a,b,c,d) = Ī£ m(2,3,4,5,6,8,9) + Ī£ d(10,11,12,13,14,15)
Chapter 2: Combinational Circuits 12
Why Incompletely Specified Functions ?
ā¢ Outputs actually do not matter for certain subset of inputs
ā¢ A subset of inputs do not (or cannot) occur
3
Chapter 2: Combinational Circuits 13
Combinational MSI Blocks
Blocks for implementing logicā¢ Decodersā¢ Encodersā¢ Multiplexersā¢ ROMsā¢ PLAs
Chapter 2: Combinational Circuits 14
Combinational MSI Blocks (contd.)
Arithmetic MSI Blocksā¢ Addersā¢ Subtractorsā¢ ALUsā¢ Comparators
Chapter 2: Combinational Circuits 15
Decoder
ā¢ n to 2n decoder
Chapter 2: Combinational Circuits 16
Logic Implementation Using Decoders
y = f(a,b,c) = Ī£ m(0,3,4,6,7)
Chapter 2: Combinational Circuits 17
Multiplexer
2n:1 Multiplexer (n select lines)
Chapter 2: Combinational Circuits 18
Logic Implementation Using Multiplexers
y = f(a,b,c) = Ī£ m(0,1,3,5,6)
4
Chapter 2: Combinational Circuits 19
Logic Implementation Using Multiplexers (contd.)y = f(a,b,c) = Ī£ m(0,1,3,5,6)
0 1 2 3aā 1 1 0 1a 0 1 1 0
Chapter 2: Combinational Circuits 20
ROM (Read Only Memory)
2n Ć m ROM (n address and m outputs)
Chapter 2: Combinational Circuits 21
Implementing Logic Using ROMs
ā¢ Direct implementation of the function
ā¢ Extremely flexible as reprogramming can implement a completely different function
Chapter 2: Combinational Circuits 22
PLA (Programmable Logic Arrays)
PLASpecification: n Ć k Ć m (N inputs, K product terms and M outputs)
ANDPlane OR
Plane
Chapter 2: Combinational Circuits 23
Implementing Logic Using PLAs
ā¢ Direct implementation of SoPsā¢ Implement product terms in the AND planeā¢ Implement sum in the OR plane
Chapter 2: Combinational Circuits 24
Implementing Logic Using PLAs (Example)
y1= ab + bācādā y2 = ab + bcā + cādā
a b c d y1 y2
5
Chapter 2: Combinational Circuits 25
Summary
To implement a n-variable function (with k minterms)
ā¢ n to 2n decoder + k input OR gateā¢ 2n:1 multiplexerā¢ 2(n-1):1 multiplexer + 1 inverterā¢ 2nĆ1 ROMā¢ nĆ pĆ 1 PLA with p ā¤ k
Chapter 2: Combinational Circuits 26
Combinational Circuitsusing Multiple Modules
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 2: Combinational Circuits 27
3 to 8 Decoder
Chapter 2: Combinational Circuits 28
4 to 16 Decoder
Chapter 2: Combinational Circuits 29
Coincident Decoding
Chapter 2: Combinational Circuits 30
4:1 Multiplexer
6
Chapter 2: Combinational Circuits 31
Tri-State Buffer
Input = { 0 , 1}
Output = { 0, 1, Z }Chapter 2: Combinational Circuits 32
4:1 Mux Using Tri-state Outputs
Chapter 2: Combinational Circuits 33
64Ć1 ROM
Chapter 2: Combinational Circuits 34
ROM Pin Connections
2nĆm
ROM
Chapter 2: Combinational Circuits 35
Iterative Circuits
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 2: Combinational Circuits 36
Adder
1 - bitFullAdder si = ai + bi + ci-1
ci = ai.bi + ci-1(ai + bi)
ai bi
ci-1
si
ci
7
Chapter 2: Combinational Circuits 37
Comparator
1-bitcomparator
bi
li-1li
ei = e i-1.(aiābiā + ai.bi)gi = ai.biā + g i-1.(aiābiā + ai.bi)li = ai.biā + l i-1.(aiābiā + ai.bi)
ai
ei
giei-1
gi-1
Chapter 2: Combinational Circuits 38
Even-Odd Detection
1 - bitCell
ai
ci-1 ci
Detecting Number of 1ās in a pattern is even/oddci = 1 if number of 1ās among a0 to ai is odd
0 otherwise
Chapter 2: Combinational Circuits 39
Iterative Pattern Recognition
P = ā1101āX = Input Y = Output
yi = 1 if <xi, xi-1, xi-2, xi-3> = ā1101ā0 otherwise
Chapter 2: Combinational Circuits 40
Pattern Recognition: Example
ci = 00 if no match till now01 if 1-bit match till now10 if 2-bit match till now11 if 3-bit match till now
Chapter 2: Combinational Circuits 41
Pattern Recognition: Example
ci-1 xi ci yi
00 0 00 000 1 01 001 0 10 001 1 01 010 0 00 010 1 11 011 0 10 011 1 01 1
Chapter 2: Combinational Circuits 42
Pattern Recognition: Example
c1i = Ī£m (1,3,5,7)
c2i = Ī£m (2,5,6)
yi = Ī£m (7)
c1i
c2ic2
i-1
c1i-1
xi
yi
8
Chapter 2: Combinational Circuits 43
Simplification of Boundary Cells
In each case boundary cells can be simplified
ā¢ Adder circuit: LSB can be half adderā¢ Comparator: Only equal input for LSBā¢ Pattern recognizer: LSB 3-bits can be
simplified
Chapter 2: Combinational Circuits 44
Speeding Up Iterative Structures
Iterative structures are regular but slow as delay adds up.
Techniques used to speed up areā¢ Multi-bit inputs per cellā¢ Carry lookahead generators
Chapter 2: Combinational Circuits 45
Multi-bit Iterative Circuits
C1i+1
C2i+1c2
i-1
c1i-1
2 - bit iterativecell
yi yi+1
xi+1xi
Chapter 2: Combinational Circuits 46
Carry Lookahead Generation
Generate gi = ai.bi
Propagate pi = ai+bi
Chapter 2: Combinational Circuits 47
Logic Minimization: Tabular Methods
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 2: Combinational Circuits 48
QM vs. K-Map
ā¢ K-Map is a graphical method and thus not suitable for large no. of variables
ā¢ K-Map method is also not suitable for programming
ā¢ QM (Quine-Mcluskey) method does not suffer from these disadvantages
9
Chapter 2: Combinational Circuits 49
QM Method: Exampley = f(a,b,c,d,e) = Ī£m(0,6,7,8,20,22,24,26,30,31)
Classify by number of 1ās in the binary rep.
No. of 1ās Minterms0 01 82 6, 20, 243 7, 22, 264 305 31
Chapter 2: Combinational Circuits 50
Combining Minterms: Conditions
Two minterms can be combined to form a implicant (I) if and only if:
ā¢ The integer values of the two minterms differ by 2k for some k ā„ 1
ā¢ The minterm with a larger integer value has more 1ās than the minterm with a smaller integer value
Chapter 2: Combinational Circuits 51
Generation of Implicants
0 01 82 6, 20, 243 7, 22, 264 305 31
Chapter 2: Combinational Circuits 52
Prime Implicants
A prime implicant is which is not fully contained in any other implicant i.e. there is no other implicant which contains all the minterms contained in this implicant.
Chapter 2: Combinational Circuits 53
Cover Table
(0,8) (6,7) (6,22) (22,30) (30,31) (20,22,24,26)0678202224263031
Chapter 2: Combinational Circuits 54
Essential Prime Implicants
Essential prime implicants are those which cover minterm(s) not covered by any other prime implicant.
Any minimal function have to include the essential prime implicants
10
Chapter 2: Combinational Circuits 55
QM Method: Steps
ā¢ Order minterms by no. of 1ās (integer value)ā¢ Generate implicants by repeated combination of
minterms and implicantsā¢ Identify prime implicantsā¢ Prepare a cover tableā¢ Identify essential and other implicants to cover all
the mintermsā¢ Express the function as a sum of selected PIs
Chapter 2: Combinational Circuits 56
QM Method for Incompletely Specified Functions
ā¢ Use donāt care minterms for generation of the implicants
ā¢ Ignore donāt care minterms during the covering process
1
Chapter 3: Sequential Circuits 1
Sequential Circuits : Definitions and Classification
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 2
Definitions
ā¢ Output is a function of not only the present input but also past inputs
ā¢ In synchronous sequential circuits (one under discussion right now) the time is discretised using clock input
ā¢ State captures the ārelevantā history of inputs in a compact form
Chapter 3: Sequential Circuits 3
Classification
ā¢ Finite memory : Only a finite number of past inputs are required to generate the present output e.g. pattern recognition
ā¢ Infinite memory : All the past inputs are required to generate the present output e.g. parity generator
Chapter 3: Sequential Circuits 4
Representation
Machine M is a five tupleM = < I, O, S, f, g >
ā¢ I : Input setā¢ O : Output setā¢ S : State spaceā¢ f is a function mapping I Ī§ S ā Oā¢ g is a function mapping I Ī§ S ā S
Chapter 3: Sequential Circuits 5
Parity Generator Example
ā¢ Define two statesā¢ S0: Number of 1ās received
till now is evenā¢ S1: Number of 1ās received
till now is odd
S0
S1
Chapter 3: Sequential Circuits 6
Pattern Recognition Example
P = ā1101āS0: No match till time tS1: 1-bit match till time tS2: 2-bit match till time tS3: 3-bit match till time t
S0
S1
S2
S3
2
Chapter 3: Sequential Circuits 7
Temporal Iteration vs Spatial Iteration
ā¢ Iterative Circuits: Spatial iteration
ā¢ State machines: Temporal iteration
Chapter 3: Sequential Circuits 8
Mealy Machine
f: I Ī§ S ā Oo(t) = f(i(t), s(t))
g: I Ī§ S ā Ss(t+1) = g(i(t), s(t))
Chapter 3: Sequential Circuits 9
Moore Machine
f: S ā Oo(t) = f(s(t))g: I Ī§ S ā Ss(t+1) = g(i(t), s(t))
Chapter 3: Sequential Circuits 10
State Encoding
Consider a machine with n states and say k bits are required to encode it
ā¢ 1-hot encoding: k=nā¢ 2-hot encoding: kC2 ā„ nā¢ Minimal encoding: k = ā”log2nā¤ā¢ Any other encoding: n ā„ k ā„ ā”log2nā¤
Chapter 3: Sequential Circuits 11
Sequential Circuits : State Equivalence & Minimization
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 12
Terminology
ā¢ Equivalent statesā¢ Distinguishable statesā¢ k-equivalent statesā¢ k-distinguishable states
3
Chapter 3: Sequential Circuits 13
Parity Generator Example
ā¢ States S0 and S1are 1-distinguishable S0
S1
0/0
1/1
0/1
1/0
Chapter 3: Sequential Circuits 14
Pattern Recognition Example
Pattern = ā1101āS0, S1 and S2 are 1-equiv.S2 and S3 are1-disting.S0 and S1 are 2-equiv.
S0
S1
S2
S3
0/0
1/01/0
0/00/0
1/01/10/0
Chapter 3: Sequential Circuits 15
State Machine Minimization
ā¢ Identify equivalent states
ā¢ Replace equivalent states by one state
Chapter 3: Sequential Circuits 16
Theorem for State Equivalence
Two states Si and Sj are k+1 equivalent if and only if
ā¢ they are k-equivalentā¢ and their next states for all inputs are k-
equivalent
Chapter 3: Sequential Circuits 17
Proof: State Equivalence Theorem
Si Si1
SjSj
1
Ī± ā Ī²
Ī± ā Ī²
Sik+1
Sjk+1
Chapter 3: Sequential Circuits 18
Minimization Steps
ā¢ Consider all states to be 0-equivalentā¢ Identify 1-equivalent partition P1 based on outputsā¢ repeat
ā identify i+1 equivalent partition Pi+1 based on Pi
until (Pi+1 = Pi)ā¢ Replace each set of states in a Pi class by a state and define
state transitions accordingly
4
Chapter 3: Sequential Circuits 19
State Minimization: Example
P0 = {Si,S0,S1,S00,S01,S10,S11}P1 = {(Si,S0,S1,S00,S10,S11)(S01)}P2 = {(Si,S0,S00)(S1,S10,S11)
(S01)}P2 = {(Si,S0,S00)(S1,S10,S11)
(S01)}
Si
S0 S1
S00 S10 S01 S11
0/0 1/0
0/0 1/0 0/0 1/0
Chapter 3: Sequential Circuits 20
State Minimization: Example (contd.)
Si
S0 S1
S00 S10 S01 S11
0/0 1/0
0/0 1/0 0/0 1/0
a
b
c
0/0
1/0
0/00/01/1
1/0
Chapter 3: Sequential Circuits 21
Equivalent Mealy & Moore Machines
ā¢ Mealy ā Mooreā For every state with distinct outputs on incident
edges, split it into as many states as number of distinct outputs
ā Associate the edge output with the stateā Redirect the edges appropriatelyā Define the new edges from the split states as
per the original Mealy machine
Chapter 3: Sequential Circuits 22
State Machine Synthesis
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 23
Equivalent Mealy & Moore Machines
ā¢ Mealy ā Mooreā For every state with distinct outputs on incident
edges, split it into as many states as number of distinct outputs
ā Associate the edge output with the stateā Redirect the edges appropriatelyā Define the new edges from the split states as
per the original Mealy machine
Chapter 3: Sequential Circuits 24
Transforming Mealy to Moore: Example
S0
S1
0/0
1/1
0/1
1/0
S00/0
S11/1
0
1
0
1
5
Chapter 3: Sequential Circuits 25
Equivalent Machines: Waveforms
S0 S1 S1 S1 S0Mealy
S00 S11 S11 S11 S00Moore
x
Clk
Chapter 3: Sequential Circuits 26
Transforming Moore to Mealy: Example
A/0
C/0B/1
D/1
10
X
0 1
1
0
AD
CB
1/0
1/1
0/10/1
X/0
Chapter 3: Sequential Circuits 27
State Register Realization
A set of Flip-flopsā¢ SR flip-flop Q(t+1) = Rā(t)Q(t) + S(t)
S(t)R(t) = 0ā¢ JK flip-flop Q(t+1) = Kā(t)Q(t) + J(t)Qā(t)ā¢ D flip-flop Q(t+1) = D(t)ā¢ T flip-flop Q(t+1) = Tā(t)Q(t) +T(t)Qā(t)
Chapter 3: Sequential Circuits 28
Excitation Table: T Flip-flop
Q(t) Q(t+1) T(t)0 0 00 1 11 0 11 1 1
Chapter 3: Sequential Circuits 29
State Machine Realization
AD
CB
1/0
1/1
0/10/1
X/0
State Encoding
AD 00
B 01
C 10
Chapter 3: Sequential Circuits 30
State Machine Realization (contd.)
X PS NS Excite (T) Y0 00 01 01 11 00 10 10 0X 01 00 01 00 10 00 10 11 10 01 11 1
6
Chapter 3: Sequential Circuits 31
Circuit Realization
x y
T1
T2
CombLogic
Chapter 3: Sequential Circuits 32
Steps in State Machine Synthesis
ā¢ Convert the description into state machineā¢ Minimize the state machineā¢ Encode the statesā¢ Choose a set of flip-flops for state registerā¢ Use the excitation table to arrive the
specification of the combinational logicā¢ Synthesize the combinational logic
Chapter 3: Sequential Circuits 33
State Machine Implementation Using Registers & Counters
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 34
Registers & Latches
ā¢ An array of flip-flopsā¢ Edge triggered are generally referred to as
registers while latches are level triggered (transparent latches)
D Q
Clk
Chapter 3: Sequential Circuits 35
Register & Latch Waveforms
Level
Edge
D
Clk
Chapter 3: Sequential Circuits 36
Register Control Variations
LD/EN OELD
7
Chapter 3: Sequential Circuits 37
Counters
ā¢ Ripple counterā¢ Synchronous counters
ā Synchronous controlsā Asynchronous controlsā Mixed controls
Chapter 3: Sequential Circuits 38
Ripple Counter
T Q T Q T Q T Q
Clk
Q0
Q1
Chapter 3: Sequential Circuits 39
Ripple Counter
ā¢ Advantagesā Simple low cost designā High speed operation possible if outputs are not
required to be synchronousā¢ Disadvantages
ā Delay = no. of bits Ć flip-flop delayā Illegal transient states
Chapter 3: Sequential Circuits 40
Synchronous Counter
T Q T Q T Q T Q
Q0
Q1
Clk
Chapter 3: Sequential Circuits 41
Faster Synchronous Counter
T Q T Q T Q T Q
Chapter 3: Sequential Circuits 42
Cascadable Synchronous Counters
ENTENP
ENTENP
ENTENP
CCCEn
Clk
Carry delay is spread over 16 clock cycles
ENTENP C
8
Chapter 3: Sequential Circuits 43
Synchronous Counter with Synchronous Controls
Clk Clr LdEn
D QCounter
Chapter 3: Sequential Circuits 44
Design Example: Mod 10 Counter
S(t+1) = s(t) + 1 if 0 ā¤ s(t) ā¤ 80 otherwise
Dec 9SynchCount Dec 10
AsyncCount
Clr Clr
Chapter 3: Sequential Circuits 45
State Machine Realization
A
CB
1/0
1/1
0/10/1
X/0
State Encoding
A 00
B 01
C 10
Chapter 3: Sequential Circuits 46
State Machine Realization (contd.)
X PS NS En, Clr, Ld D0 00 01 100 X1 00 10 001 10X 01 00 010 X0 10 00 010 X1 10 01 001 01
Chapter 3: Sequential Circuits 47
Circuit Realization
x y
CNT
CombLogic
En, Clr, LdD
Q(PS)
Chapter 3: Sequential Circuits 48
Sample Counter Specification
Clr Ld En Clk D Q(t+1)
1 X X X X 0
0 1 X r D D
0 0 1 r X Q(t) +1
9
Chapter 3: Sequential Circuits 49
Steps in State Machine Synthesisusing Counters
ā¢ Encode the statesā¢ Choose a counter with appropriate control
inputs to implement the state registerā¢ Use the counter functionality table to arrive
at the spec. of the combinational logicā¢ Synthesize the combinational logic
Chapter 3: Sequential Circuits 50
Multiple State Machine Implementation & Clock Period
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 51
Steps in State Machine Synthesisusing Counters
ā¢ Encode the statesā¢ Choose a counter with appropriate control
inputs to implement the state registerā¢ Use the counter functionality table to arrive
at the spec. of the combinational logicā¢ Synthesize the combinational logic
Chapter 3: Sequential Circuits 52
Applications of Sequential Machines
ā¢ Pattern matchingā Overlapped or non-overlappedā Blocked or non-blocked
ā¢ Sequential decodingā¢ Controllersā¢ Memory based circuits
Chapter 3: Sequential Circuits 53
Interacting State Machines : Example
ā¢ Search for a pattern P = ā1101ā within blocks of 256 bits. The pattern should not cross block boundaries.
ā¢ Design two state machines M1 and M2ā M1 is a modulo 256 counterā M2 is the pattern recognizer
ā¢ The 256th transition of M1 should initialize M2
Chapter 3: Sequential Circuits 54
Example (Contd.)
S0
S1
S2
S255
A
B
C
D
0/0
1/00/0
1/0
0/0
1/01/1
0/0
10
Chapter 3: Sequential Circuits 55
Example (Contd.)
M1 M2
Clk
x
y
Chapter 3: Sequential Circuits 56
Example (Contd.)
S0
S1
S2
S255
A
B
C
D
01/0
01/0
00/0
01/0
X0/0,11/1
-/0
-/0
-/0
-/0
-/1
00,1x/0
00,1x/0
1x/0
01/1
Chapter 3: Sequential Circuits 57
Design Summary: Example
ā¢ M1 : 8-bit free running counterā¢ M2 : Counter with synchronous clear
which dominates
M1 M2
Clk
yClr
8-bit Cntr 2-bit CntrLogic +
x
Chapter 3: Sequential Circuits 58
Register & Latch Waveforms
Mod256
Cntr
Clk
S253 S254 S255 S0 S1
Chapter 3: Sequential Circuits 59
Multiple State Machines: Another Example
ā¢ In a bit stream, count the number of ā@ā (ASCII Code) characters in blocks of 256 8-bit characters
ā¢ Three state machines: M1, M2 and M3ā M1: Pattern recognizer for ā@ā characterā M2: 8-bit counter for counting 256 charactersā M3: 8-bit Counter for counting no. of ā@ā
Chapter 3: Sequential Circuits 60
Second Example (Contd.)
Specification of M1y1 = 1 if <x(t-7)..x(t)> = ā@ā and t mod 8 = 7 y2 = 1 if t mod 8 = 7
M1
M2
M3
Clk
x
y
y2 En
y1 En Clr
11
Chapter 3: Sequential Circuits 61
Clock Period
x y
PS NS
Clk
SR
CombLogic
thtsu
Chapter 3: Sequential Circuits 62
Clock Period Computation
to: Critical path delay (x,PS) to ytns: Critical path delay (x,PS) to NStd: SR delaytsu: Setup time of the SRth: Hold time of the SR
tclk ā„ max{ td + to, td + tns + tsu }
Chapter 3: Sequential Circuits 63
Designing with Memories
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 3: Sequential Circuits 64
Classification of Memory Devices
ā¢ ROMā ROM, PROM, EPROM, EEPROM, UVPROM
ā¢ RAMā SRAM (Static RAM)ā DRAM (Dynamic RAM)
Chapter 3: Sequential Circuits 65
SRAM Device Signals
AddressData
rd/wrcs
SRAM
Chapter 3: Sequential Circuits 66
SRAM Timing
Adr
Data
Rd/wr
12
Chapter 3: Sequential Circuits 67
Circuit Example using Memory
RAM
RO
RI
Adr
Rd/Wr
ADBUSDBUS
Chapter 3: Sequential Circuits 68
Reading Memory in a SM
S1
S2En_Adr_src
Ld_Dat_Reg
Inc_Adr
Chapter 3: Sequential Circuits 69
Writing Memory in a SM
S1
S2
S3
Adr
Data
WrChapter 3: Sequential Circuits 70
Dynamic RAM Device Signals
Address
Data_inrd/wrcs
SRAMrascas
Data_out
Chapter 3: Sequential Circuits 71
DRAM Timing
ras
cas
Adr
Chapter 3: Sequential Circuits 72
System Design Case Studies
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
13
Chapter 3: Sequential Circuits 73
Data-Control Partition
DataPart
ControlPart
Statussignals
Controlsignals
Chapter 3: Sequential Circuits 74
Steps in System Design
ā¢ Choose an algorithmā¢ Identify the data modules (operators &
storage)ā¢ Identify the control signalsā¢ Extract the state machine for controlā¢ Implement the state machine to complete
the design
Chapter 3: Sequential Circuits 75
Case Study1: GCD Computer
GCDComputer
x
y
z
Chapter 3: Sequential Circuits 76
GCD Algorithm
Input x, y;while ( x ā y ) do
if ( x > y ) then x := x - yelse y := y - x
endif;endwhile;z := x;end.
Chapter 3: Sequential Circuits 77
GCD Computer: Data Part
R2R1
R3Comp SUB
Chapter 3: Sequential Circuits 78
Modified GCD Algorithm (RTL)
R1:= x, R2:= y;while ( R1 ā R2 ) do
if ( R1 > R2 ) then R1:= R1 - R2else R2:= R2 - R1endif;
endwhile;R3:= R1;
14
Chapter 3: Sequential Circuits 79
GCD Computer: State Diagram
S1
S2
S3S4S5
Chapter 3: Sequential Circuits 80
GCD Computer: Interface
GCDComputer
x
y
z
start eoc
Chapter 3: Sequential Circuits 81
Case Study 2: FIFO
FIFOData In Data Out
emptyfull
adddelete
Chapter 3: Sequential Circuits 82
FIFO: Data Part
Head
Tailf e
Memory
Chapter 3: Sequential Circuits 83
FIFO: State Machine
S0
S1S3
S4 S2
1
Chapter 4: Asynchronous Circuits 1
Asynchronous Circuits
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 4: Asynchronous Circuits 2
Terminology
ā¢ Input Stateā¢ Secondary or
internal state ā¢ Secondary or
internal variablesā¢ Fundamental mode
Comb.Logic
Delay
x z
Yy
Chapter 4: Asynchronous Circuits 3
Illustrative Example
Consider a circuit with 2 inputs (x1 and x2) and 1 output (z). The output is ā1ā only when x1 and x2 are ā1ā with x1 being ā1ā first.
x1
x2
z
Chapter 4: Asynchronous Circuits 4
Total States
x1
x2
z
1 2 3 4 1 4 5 1
Chapter 4: Asynchronous Circuits 5
Primitive Flow Table
x1,x2 00 01 11 101 1 ,0 4 - 22 1 - 3 2 ,03 - 4 3 ,1 24 1 4 ,0 5 -5 - 4 5 ,0 2
Chapter 4: Asynchronous Circuits 6
Merger Graph
ā¢ Identify compatibilityā¢ Identify cliques
A (1,2,3)B (4,5)
1
2
3
4
5
2
Chapter 4: Asynchronous Circuits 7
Reduced Flow Table
x1, x2 00 01 11 10A 1 ,0 4 3 ,1 2 ,0B 1 4 ,0 5 ,0 2
Chapter 4: Asynchronous Circuits 8
Final State Table
x1, x2 00 01 11 100 0 ,0 1 ,0 0 ,1 0 ,01 0 ,0 1 ,0 1 ,0 0 ,0
z = yāx1x2
y = x1āx2 + yx2
Chapter 4: Asynchronous Circuits 9
Asynchronous Circuit
z = yāx1x2y = x1āx2 + yx2
Chapter 4: Asynchronous Circuits 10
Asynchronous Sequential Circuit Design
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 4: Asynchronous Circuits 11
Another Example
Consider a circuit with 1 input (x ) and 1 output (z). The output should suppress every alternate pulse on the input starting with the first.
x
z
Chapter 4: Asynchronous Circuits 12
Total States
1
x
z
2 3 4 1
3
Chapter 4: Asynchronous Circuits 13
Primitive Flow Table
x 0 11 1 ,0 22 3 2 ,03 3 ,0 44 1 4 ,1
Chapter 4: Asynchronous Circuits 14
State Encoding
ā¢ Let us choose the following encoding
1 : 002 : 013 : 104 : 11
Chapter 4: Asynchronous Circuits 15
Final State Table
y1 y2 x Y1 Y2 z0 0 0 0 0 00 0 1 0 1 00 1 0 1 0 00 1 1 0 1 01 0 0 1 0 01 0 1 1 1 11 1 0 0 0 01 1 1 1 1 1
Chapter 4: Asynchronous Circuits 16
Asynchronous Circuit
z = y1.xY1 = y1ā.y2.xā + y1.y2ā+y1.xY2 = x
Chapter 4: Asynchronous Circuits 17
Races & Cycles
State assignment of secondary states could result in races and cycles.
ā¢ Racesā Criticalā Non-critical
ā¢ Cycles
Chapter 4: Asynchronous Circuits 18
State Assignment in Asynchronous Circuits
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
4
Chapter 4: Asynchronous Circuits 19
Illustration for Races & Cycles
x1x2y1y2
00 01 11 10
00 11 00 10 0101 11 00 10 0111 11 00 10 1110 11 10 10 11
Chapter 4: Asynchronous Circuits 20
State Assignment
x 0 11 1 22 3 23 3 44 1 4
x 0 100 00 0101 10 0110 10 1111 00 11
Chapter 4: Asynchronous Circuits 21
Alternative State Assignment
x 0 11 1 22 3 23 3 44 1 4
x 0 100 00 0101 10 0111 11 1010 00 10
Chapter 4: Asynchronous Circuits 22
Transition Graph
Transition Graph is drawn to capture adjacency requirements
1 2 3 4
Chapter 4: Asynchronous Circuits 23
Another Transition Table
x1x2y1y2
00 01 11 10
1 3 1 4 22 3 1 4 23 3 1 4 34 3 4 4 3
1 2
3 4
(01) (10)
(11)(11)
(11) (10)
(01)
Chapter 4: Asynchronous Circuits 24
Transition Diagram
x1x2 00 01 11 100 1 3 4 4
1 2 4
1 2
3 4
(01) (10)
(11)
(11) (10)
5
Chapter 4: Asynchronous Circuits 25
Additional Permanent States
0 1
00 a a
01 b d
11 b d
10 c c
y1y2y3y4
00 01 11 10
00 a b e e01 a b f f11 c c e f10 d d e f
1
Chapter 5: Microprogrammed Control 1
Microprogrammed Control
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 5: Microprogrammed Control 2
Data-Control Partition
DataPart
ControlPart
Statussignals
Controlsignals
Chapter 5: Microprogrammed Control 3
Control Unit Design Options
ā¢ Adhoc Designā Combination of MSI & SSI modules
ā¢ Random logic implementationā Starting from a state machinedescription
ā¢ Microprogrammed controlā Starting from a RTL description or even a
modified state machine description
Chapter 5: Microprogrammed Control 4
Terminology
ā¢ Microprogramā¢ Microinstructionā¢ Microoperationsā¢ Microinstruction formatā¢ Microsequencerā¢ Control/Microprogram ROMā¢ Microinstruction register
Chapter 5: Microprogrammed Control 5
Block Diagram
Seq ControlROM
REG
DataPart
Chapter 5: Microprogrammed Control 6
Microprogrammed Control: Advantages & Disadvantages
ā¢ Advantagesā Flexible and structured designā Testing sequences can be easily incorporatedā Easy to document and debug
ā¢ Disadvantagesā Expensive especially for small designsā Slower than random logic
2
Chapter 5: Microprogrammed Control 7
Microinstruction Format
1: Data Part Control Signals m2:Sequencer control/action select k3: Status control select s4: Next address n
w (word length) = m + k + s + n
1 2 3 4
Chapter 5: Microprogrammed Control 8
Component Sizes
ā¢ Data Part: m control inputs,S status outputs
ā¢ Microsequencer: k+1 inputs, n outputsā¢ Status mux: S status inputs,
s select lines, 1 outputā¢ Control ROM: N Ī§ w bitsā¢ Microinst. Reg.: w bits
Chapter 5: Microprogrammed Control 9
Labeled Block diagram
Seq ControlROM
REG
DataPart
MUX1
n w m
Ssk
Chapter 5: Microprogrammed Control 10
Clock Period Computation
ā¢ tdp :Maximum delay in data part ā¢ tstatus : Maximum delay for status gen.ā¢ tsta_mux : Delay of status multiplexerā¢ tseq : Microsequencer delayā¢ trom : Control ROM delayā¢ treg : Register delay
Chapter 5: Microprogrammed Control 11
Performance & Clock Period
tclk ā„ max { tdp, tstatus + tsta_mux + tseq + trom + treg}
Total Time (T) = tclk Ī§ nclk
Pipelining can be used to decrease the clock period but may also result in increasing the number of clocks.
Chapter 5: Microprogrammed Control 12
Microprogrammed Control Design: Example
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
3
Chapter 5: Microprogrammed Control 13
Design Steps
ā¢ Design the datapart and identify the control and status signals
ā¢ Design the microsequencer based on the branchings required
ā¢ From the schedule of operations finalize the size of the control ROM
ā¢ Finalize the microinstruction formatā¢ Generate the microprogram
Chapter 5: Microprogrammed Control 14
Case Study: GCD Computer
GCDComputer
x
y
z
starteoc
Chapter 5: Microprogrammed Control 15
GCD Algorithm
s: wait till (start=1);input x, y; eoc := 0;while ( x ā y ) do
if ( x > y ) then x := x - yelse y := y - x
endif;endwhile;z := x; eoc := 1; go to s; end. Chapter 5: Microprogrammed Control 16
GCD Computer: Data Part
R2R1
R3Comp SUB
eoc
Chapter 5: Microprogrammed Control 17
GCD Computer: State Diagram
S0
S2
S4S5S6
S1
S3
Chapter 5: Microprogrammed Control 18
Control Flow Requirements
ā¢ Next microinstructionā¢ If (cond) then ā¦
else ām(i + 1)ācond = {startā, .eq.,.gt.}
ā¢ Go to ām(0)ā
4
Chapter 5: Microprogrammed Control 19
Microsequencer Specifications
Microsequencer instructions
ā¢ Next (or continue)ā¢ Conditional jumpā¢ Unconditional Jump
Chapter 5: Microprogrammed Control 20
Block Diagram
Seq ControlROM
REG
DataPart
MUX1
n w m
Ssk
n
Chapter 5: Microprogrammed Control 21
Microinstruction Format
ā¢ Data part control signalsā sel_R1, sel_R2, sel_sub1, sel_seb2, ld_R1,
ld_R2, ld_R3, clr_eoc, pr_eocā¢ Control Part signals
ā seq._ins (2 bits), cond_sel(2 bits), Next_adr(3 bits)
ā¢ Status signalsā startā, .eq., .gt.
Chapter 5: Microprogrammed Control 22
Symbolic Microprogram
ā¢ M0: s_ins = cjmp, c_sel = startā, NA=0ā¢ M1: s_R1=x, s_R2 = y, ld_R1, ld_R2,
clr_eoc, s_ins = contā¢ M2: s_ins = cjmp, c_sel = .eq., NA= 6 ā¢ M3: s_ins = cjmp, c_sel = .gt., NA= 5ā¢ M4: sub1= R1, sub2 = R2, ld_R1, s_ins= jp ,NA=2ā¢ M5: sub1= R2, sub2 = R1, ld_R2, s_ins= jp, NA = 2ā¢ M6: pr_eoc, ld_R3, s_ins = jp, NA = 0
Chapter 5: Microprogrammed Control 23
Microsequencer Design
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 5: Microprogrammed Control 24
Microsequencer Design Steps
The role of the microsequencer is to generate the next address.
ā¢ Enumerate the microsequencer instructions that need to be supported
ā¢ Identify all the inputs to the āNext Addressā multiplexer
ā¢ Synthesize the logic for the select input of the āNext Addressā multiplexer
5
Chapter 5: Microprogrammed Control 25
Microsequencer Synthesis: Example
Microsequencer instructions to be supported
Instruction Encodingā¢ NEXT 0 0ā¢ CJMP 0 1ā¢ JMP 1 0
Chapter 5: Microprogrammed Control 26
āNAā Mux Inputs
NAMux
ĀµPC
+1
NABA
Cond
Āµseq_instSel Logic
Chapter 5: Microprogrammed Control 27
Next Address Select Logic
Microseq. Instr. Cond NA_selI1 I0 C S0 0 X 00 1 0 00 1 1 11 0 X 11 1 X X
Chapter 5: Microprogrammed Control 28
A Generic Microsequencer
NAMux
ĀµPC
+1
BA
Cond
Āµseq_inst
Sel Logic
b
ā0āDec 0
Lpcntr
NA
Stack
Cond_en
OE
Chapter 5: Microprogrammed Control 29
Microsequencer Instructions
ā¢ NEXT (or CONT)ā¢ JPCā¢ JMPā¢ JZEROā¢ JSUBā¢ RETā¢ LD_CNTRā¢ RPNZ
Chapter 5: Microprogrammed Control 30
Block Diagram
Āµ seqControlROM
ĀµInsreg
DataPart
6
Chapter 5: Microprogrammed Control 31
Timing Diagram
Clk
NA
Āµseq_instr
a a+1
JSUB b
b
NEXT
MI[a] MI[a+1] MI[b]Āµinstr
Chapter 5: Microprogrammed Control 32
Multi-way Branching
ā¢ Multiple address fieldsā¢ Address mapping through look up tablesā¢ Address mapping through address
translation and encoding
Chapter 5: Microprogrammed Control 33
Multiple Address Fields
Si
Si+1 Sj Sk
Micro-sequencer
BAc1
c2c3
Sta.mux
c2+c3
c3
j k
MUX0 1
Chapter 5: Microprogrammed Control 34
Multi-way Branching
ā¢ Mapping ROMor Address encoding
ā¢ JMAP instruction
IR
Mapping ROM
Microsequencer
BA
Chapter 5: Microprogrammed Control 35
Microprogram Optimization
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 5: Microprogrammed Control 36
Optimization Types
ā¢ Vertical optimizationā¢ Horizontal optimization
Control ROM
m X n
7
Chapter 5: Microprogrammed Control 37
Vertical Optimization
ā¢ Rescheduling or reassignment of control signals to control steps/microinstructions
ā¢ Merging of microinstructionsā¢ Timing isssues
Chapter 5: Microprogrammed Control 38
Horizontal Optimization
ā¢ Reducing the width of microinstructionsā Compromising on the available concurrency in
the data/control partā Without compromising the concurrency
availableā¢ Encode multiple microoperations/control
signals in the same field
Chapter 5: Microprogrammed Control 39
Microinstruction Formats
ā¢ Horizontal formatā Separate bits (/fields) for all control signals
(/microoperations)ā No loss of concurrencyā Large width of microinstructions and low
utilization
Chapter 5: Microprogrammed Control 40
Microinstruction Format (contd.)
ā¢ Vertical formatā Only one microoperation (or register transfer
operation) per microinstructionā Difinite loss of concurrencyā Smallest possible width of microinstructions
and very high utilization
Chapter 5: Microprogrammed Control 41
Microinstruction Format (contd.)
ā¢ Minimally encoded formatā Multiple microoperations (or register transfer
operation) per microinstructionā Concurrency may or may not be compromisedā Architecture driven or application driven
encoding
Chapter 5: Microprogrammed Control 42
Encoding Example
A B C
D E F
En_A En_B En_C
Ld_D Ld_E Ld_E
8
Chapter 5: Microprogrammed Control 43
Horizontal Format
En_A En_B En_C Ld_D Ld_E Ld_F
Chapter 5: Microprogrammed Control 44
Vertical Format
0000 No Operation0001 Transfer_A_Dā¦ā¦1001 Transfer_C_F
Transfer _ X _ Y
Chapter 5: Microprogrammed Control 45
Minimal Encoding
ā¢ Architecture Dependent
Bus_Src00 A01 B10 C
Bus_Src Ld_D Ld_E Ld_F
Chapter 5: Microprogrammed Control 46
Minimal Encoding (contd.)
ā¢ Application Dependent
Bus_Src Bus_Dest00 A 00 Noop01 B 01 D & E10 C 10 E
11 F
Bus_Src Bus_Dest
Chapter 5: Microprogrammed Control 47
Impact of Encoding
ā¢ Costā Reduction in the control ROM sizeā Additional decoders
ā¢ Performanceā Increase in the clock period if the decoders are
in the critical path
Chapter 5: Microprogrammed Control 48
Complex Microinstruction Encoding & Formats
ā¢ Multiple level encodingā¢ Nanoprogramming
9
Chapter 5: Microprogrammed Control 49
Microinstruction Optimization
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 5: Microprogrammed Control 50
Input-Output Specification
Inputs: A horizontal microinstruction formatSymbolic microprogram
Output: Microinstruction format
Chapter 5: Microprogrammed Control 51
GCD Example
s: wait till (start=1);input x, y; eoc := 0;while ( x ā y ) do
if ( x > y ) then x := x - yelse y := y - x
endif;endwhile;z := x; eoc := 1; go to s; end.
Chapter 5: Microprogrammed Control 52
Symbolic Microprogram
1 Sta_s, Seq_i, BA2 R1_s, R1_ld, R2_s, R2_ld, eoc_c, Seq_i3 Sta_s, Seq_i, BA4 Sta_s, Seq_i, BA5 Sub1_s, Sub2_s, R1_s, R1_ld, Seq_I, BA6 Sub1_s, Sub2_s, R2_s, R2_ld, Seq_I, BA7 eoc_p, R3_ld, Seq_i, BA
Chapter 5: Microprogrammed Control 53
Horizontal Format
A = Sta_s(2) B = Seq_I (2) C = BA(3)D = R1_s E = R1_ld F = R2_sG = R2_ld H = eoc_c I = S1_sJ = S2_s K = R3_ld L = eoc_p
Microinstruction word length = 16 Chapter 5: Microprogrammed Control 54
Disjoint Graph
A B C
D
E
FGHI
K
L
J
10
Chapter 5: Microprogrammed Control 55
Microinstruction Formats
{A,B,C,D,E,F,G,H,I,J,K,L} 16
{(A,D,L),B,(C,H),(E,K),F,G,I,J} 13
Chapter 5: Microprogrammed Control 56
Reflecting Control Signal Properties
ā¢ Non-linear cost reduction due to encodingā Reflect in ācostā computation
ā¢ Nature of control signals: default value is fixed or donāt careā Mark the nodes and reflect in clustering
ā¢ Width of control signalsā Multiple copies of the same node with bit
number
Chapter 5: Microprogrammed Control 57
Modified Disjoint Graph
A B C
D
E
FGHI
K
L
J
Chapter 5: Microprogrammed Control 58
Additional Microinstruction Formats
{A,B,C,D,E,F,G,H,I,J,K,L} 16
{(A,D,L),B,(C,H),(E,K),F,G,I,J} 13
{(A1,E),(A2,G),B1,B2,(C1,H),C2,C3,(I,L),(J,K)} 9
Chapter 5: Microprogrammed Control 59
Column Compatibility
ā¢ Based on the optimized format, generate the binary microprogram
ā¢ Based on the compatibility between columns, draw the compatibility graph
ā¢ Again apply clique partitioning to eliminate redundant columns
Chapter 5: Microprogrammed Control 60
Microinstruction Optimization Steps
ā¢ Generate the symbolic microprogramā¢ Design a horizontal microinstruction formatā¢ Optimize to generate the fields in the
optimized formatā¢ Generate binary microprogramā¢ Eliminate redundant columnsā¢ Design the decoders and fanout logic
1
Chapter 6: Introduction to VHDL 1
Introduction to VHDL
M. BalakrishnanDept of Computer Science & Engg.
I.I.T. Delhi
Chapter 6: Introduction to VHDL 2
Domains of Description :Gajskiās Y-Chart
Behavioraldomain
Structuraldomain
Physical domain
Level of abstraction
VHDL models
Chapter 6: Introduction to VHDL 3
VHDL Development
ā¢ US DoD initiated in 80āsā¢ Very High Speed ASIC Description
Languageā¢ Initial objective was modeling only and thus
only a simulator was envisagedā¢ Subsequently tools for VHDL synthesis
were developed
Chapter 6: Introduction to VHDL 4
HDL Requirements
ā¢ Abstractionā¢ Modularityā¢ Concurrencyā¢ Hierarchy
Chapter 6: Introduction to VHDL 5
Abstraction
VHDL supports description of components as well as systems at various levels of abstraction
ā¢ Gate and component delaysā¢ Clock cyclesā¢ Abstract behavior without any notion of
delays
Chapter 6: Introduction to VHDL 6
Modularity
ā¢ Every component in VHDL is referred to as an entity and has a clear interface
ā¢ The interface is called an entity declaration ā¢ The āinternalsā of the component are
referred to as the architecture declarationā¢ There can be multiple architectures at even
different levels of abstraction associated with the same entity
2
Chapter 6: Introduction to VHDL 7
VHDL Example
a
bcAND
Chapter 6: Introduction to VHDL 8
VHDL Description: AND gate
entity AND2 isport (a, b: in bit ;
c : out bit);end AND2;
architecture beh of AND2 isbegin
c <= a and b;end beh;
Chapter 6: Introduction to VHDL 9
Concurrency in VHDL Descriptions
signals
process 1 process 2 process n
signals
Chapter 6: Introduction to VHDL 10
Concurrent and Sequential Computations
ā¢ Processes are concurrentā¢ Sequential activity within each process
Nesting of statements :ā¢ Concurrent statements in a concurrent statementā¢ Sequential statements in a concurrent statementā¢ Sequential statements in a sequential statement
Chapter 6: Introduction to VHDL 11
Hierarchy in VHDL
S1
S2
C4
S3
S13
S14
S4
S5
C5
C1
S6
C6
S7
S8
S9
S10
C7
C2
S11
S12
C3
C0
Chapter 6: Introduction to VHDL 12
Modeling Styles in VHDL
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
3
Chapter 6: Introduction to VHDL 13
Modeling Stylesā¢ Semantic model of VHDL
ā¢ Structural description
ā¢ Data Flow description
ā¢ Algorithmic description
ā¢ RTL description
Chapter 6: Introduction to VHDL 14
Modeling Choices in VHDLā¢ Behavioral and Structural Domains
ā Several Levels of Abstractionā¢ Multiple Styles of Behavioral Description:
ā Data Flow Style (concurrent)ā Procedural Style (sequential)
ā¢ Combinations, variations and special cases of these, e.g.,ā special case of data flow style - FSM described using
guarded blocksā special case of procedural style - FSM described using
case statement in a process
Chapter 6: Introduction to VHDL 15
Structural Descriptionā¢ Carries same information as a NET LISTā¢ Net List = (Component instances) + (Nets)ā¢ Structural Description in VHDL =
(Signals) + (Component instances + Port maps)ā¢ Many sophisticated features in VHDL to make it
more versatile:* Variety of signal types* Generic components* Generate statements for creating arrays of component instances* Flexibility in binding components to design entities and
architecturesChapter 6: Introduction to VHDL 16
Behavioral Descriptionā¢ Procedural
(textual order => execution order)
ā¢ Sequential statementsā¢ Control constructs alter
normal sequential flow
Called Behavioral description in VHDL
ā¢ Non-procedural (textual order NOT =>
execution order)ā¢ Concurrent statementsā¢ Data flow (or rather data
dependency restricts concurrency)
Called Data flow description in VHDL
Chapter 6: Introduction to VHDL 17
Concurrent Statements in VHDL
ā¢ process statement -- behaviorā¢ concurrent procedure call -- behaviorā¢ concurrent signal assign. -- data flowā¢ component instantiation -- structureā¢ generate statement -- structureā¢ block statement -- nestingā¢ concurrent assertion stmt -- error check
Chapter 6: Introduction to VHDL 18
Example: 1-bit Full Adder
entity FullAdder isport (X, Y, Cin: in bit; -- Inputs
Cout, Sum: out bit); -- Outputsend FullAdder;
XY
Cin
Sum
CoutFullAdder
4
Chapter 6: Introduction to VHDL 19
Example: 1-bit Full Adder (contd.)
Architecture Equations of FullAdder isbegin -- Concurrent Assignment
Sum <= X xor Y xor Cin after 10 ns;Cout <= (X and Y) or (X and Cin) or (Y and Cin) after 15 ns;
end Equations;
Chapter 6: Introduction to VHDL 20
Example: 4-bit Adder
entity Adder4 isport (A, B: in bit_vector(3 downto 0);Ci: in bit; -- InputsS: out bit_vector(3 downto 0);Co: out bit); -- Outputs
end Adder4;
Chapter 6: Introduction to VHDL 21
Example: 4-bit Adder (contd.)Architecture Structure of Adder4 isComponent FullAdder
port (X, Y, Cin: in bit; Cout, Sum: out bit);signal C: bit_vector (3 downto 1);begin -- Instantiations
FA0: FullAdder port map (A(0), B(0), Ci, C(1), S(0));FA1: FullAdder port map (A(1), B(1), C(1), C(2), S(1));FA2: FullAdder port map (A(2), B(2), C(2), C(3), S(2));FA3: FullAdder port map (A(3), B(3), C(3), Co, S(3));
end Structure;Chapter 6: Introduction to VHDL 22
Example: 4-bit Comparator
entity nibble_comparator isport (a, b: in bit_vector (3 downto 0);
gt,eq,lt : in bit;a_gt_b, a_eq_b, a_lt_b : out bit);
end nibble_comparator;
Chapter 6: Introduction to VHDL 23
Structural Description (contd.)architecture iterative of nibble_comparator is
component comp1port (a, b, gt,eq,lt : in bit; a_gt_b, a_eq_b, a_lt_b : out bit);
end component;for all : comp1 use entity work.bit_comparator(gate_level);signal im: bit_vector (0 to 8);
beginc0:comp1 port map(a(0),b(0), gt, eq, lt, im(0), im(1), im(2));c1toc2: for i in 1 to 2 generate
c:comp1 port map(a(i),b(i),im(i*3-3),im(i*3-2),im(i*3-1), im(i*3+0),im(i*3+1),im(i*3+2));
end generate;c3: comp1 port map(a(3),b(3),im(6),im(7),im(8),
a_gt_b, a_eq_b, a_lt_b);end nibble_comparator;
Chapter 6: Introduction to VHDL 24
Example: 1-bit Comparator (data flow)
entity comp1 isport (a, b, gt,eq,lt : in bit; a_gt_b, a_eq_b, a_lt_b : out bit);
end comp1;architecture dataflow of comp1 issignal s : bit;begin
s <= (a and b) or (not a and not b);a_gt_b <= (gt and s) or (a and not b);a_lt_b <= (lt and s) or (not a and b);a_eq_b <= eq and s;
end dataflow;
5
Chapter 6: Introduction to VHDL 25
References
ā¢ Digital Systems Design Using VHDLCharles H. Roth, Jr., PWS Publishing Co.Chapter 2 (pp. 44 to 84)
ā¢ The Designerās Guide to VHDLPeter J. Ashenden, Morgon Kaufmann
Chapter 6: Introduction to VHDL 26
Behavioral Description in VHDL
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 6: Introduction to VHDL 27
Modeling Stylesā¢ Semantic model of VHDL
ā¢ Structural description
ā¢ Data Flow description
ā¢ Algorithmic description
ā¢ RTL description
Chapter 6: Introduction to VHDL 28
Concurrent Statements in VHDL
ā¢ process statement -- behaviorā¢ concurrent procedure call -- behaviorā¢ concurrent signal assign. -- data flowā¢ component instantiation -- structureā¢ generate statement -- structureā¢ block statement -- nestingā¢ concurrent assertion stmt -- error check
Chapter 6: Introduction to VHDL 29
Example: D Flip-Flop
entity DFF isport (D, CLK: in bit;
Q: out bit; QN: out bit := ā1ā) ; end DFF;
D
CLK
Q
QNDFF
Chapter 6: Introduction to VHDL 30
Example: DFF (contd.)Architecture Beh of DFF isbegin process (CLK)
begin if (CLK = ā1ā thenQ <= D after 10 ns;QN <= not D after 10 ns;
endif;endprocess;
end Beh;
6
Chapter 6: Introduction to VHDL 31
Concurrent Conditional Assignment: 4 to 1 Multiplexery <= x0 when sel = 0
else x1 when sel = 1else x2 when sel = 2else x3 when sel = 3
x0x1x2x3
sel
y
Chapter 6: Introduction to VHDL 32
CASE Statement: 4 to 1 Multiplexer
Case sel iswhen 0 => y <= x0when 1 => y <= x1when 2 => y <= x2when 3 => y <= x3
end case
x0x1x2x3
y
Chapter 6: Introduction to VHDL 33
Variables And SignalsArchitecture var of dummy is
signal trigger, sum: integer := 0;begin process
variable var1: integer:= 1;variable var3, var2: integer:= 2;begin wait on trigger;
var3 := var1 + var2;var1 := var3;sum <= var1;
end process; end var;
Chapter 6: Introduction to VHDL 34
Variables And SignalsArchitecture sig of dummy is
signal trigger, sum: integer := 0;signal sig1: integer:= 1;signal sig3, sig2: integer:= 2;
begin processbegin wait on trigger;
sig3 <= sig1 + sig2;sig1 <= sig3;sum <= sig1;
end process; end sig;
1
Chapter 7: Testing Of Digital Circuits 1
Testing of Digital Circuits
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 2
Design Approaches
ā¢ Test pattern generation to cover a large fraction of the faults
ā¢ Design for testability
ā Built-in-self-test (BIST)
ā¢ Fault tolerant design
Chapter 7: Testing Of Digital Circuits 3
Faults: Sources and Types
ā¢ Sourcesā Design processā Device defectsā Manufacturing process
ā¢ Typesā Dynamicā Static
Chapter 7: Testing Of Digital Circuits 4
Fault Modelsā¢ Stuck-at faults correspond to a simple fault
modelā Stuck-at-0 (s-a-0)ā Stuck-at-1 (s-a-1)
ā¢ More complex models are also used but beyond the scope of this work
Chapter 7: Testing Of Digital Circuits 5
Combinational Circuits: Test Pattern Generation
Problem definition:
Given a set of faults (F) and a set of test vectors (T), identify the smallest possible subset of test vectors (V) which covers either all the faults in F or say a predetermined fraction of faults (say 98%).
Chapter 7: Testing Of Digital Circuits 6
Fault Simulation
Given a test vector, by simulating the circuit with the fault, identify all faults covered by the test vector.
Testvectors (T) Faults (F)
2
Chapter 7: Testing Of Digital Circuits 7
Test Generation
ā¢ Given a fault, identify all the test vectors which can cover that fault.
Testvectors (T) Faults (F)
Chapter 7: Testing Of Digital Circuits 8
Limitationsā¢ Only one fault is expected to occur at one
timeā¢ Faults other than stuck-at faults are
expected to show up as stuck-at faults at some other location
ā¢ By and large fault location is not possibleā¢ These approaches are valid only for
combinational circuits
Chapter 7: Testing Of Digital Circuits 9
Typical Circuit Enhancements
ā¢ Insertion of test pointsā¢ Pin amplificationā¢ Test modesā¢ Scan chains
Chapter 7: Testing Of Digital Circuits 10
Test Generation Methods
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 11
Parallel Fault Simulation
ā¢ In parallel fault simulation, evaluation is performed simultaneously for many faults
ā¢ The number of faults that can be simultaneously simulated corresponds the word length of the host machine
Chapter 7: Testing Of Digital Circuits 12
Parallel Fault Simulation (Example)
a
bc
de
f
g
h
i
3
Chapter 7: Testing Of Digital Circuits 13
Parallel Fault Simulation(Example contd.)
ff a0 a1 b0 b1 c0 c1 d0a 0 0 1 0 0 0 0 0b 1 1 1 0 1 1 1 1c 0 0 0 0 0 0 1 0d 1 1 1 1 1 1 1 0e 0 0 0 0 0 0 0 0f 0 0 0 0 0 0 1 0g 0 0 0 0 0 0 0 1h 1 1 1 1 1 1 1 1i 1 1 1 1 1 1 1 1
Chapter 7: Testing Of Digital Circuits 14
Deductive Fault Simulation
ā¢ At each of the primary inputs generate the list of faults that can be detected by the test vector
ā¢ Use these lists to generate the lists at other nodes by āappropriateā operations on these lists
Chapter 7: Testing Of Digital Circuits 15
Deductive Fault Simulation (example)
a
bc
de
f
g
h
i
La = {a1} Lb = {b0} Lc = {c1} Ld = {d0} Le = {e1}0
10
10
Lfp = Lbā ā© Lc = {c1}Lf = {c1, f1}Lgp = (Ldā āŖ Le)ā = {d0}Lg = {d0, g1}Lhpā = (Lf ā© Lg)ā, Lhp = Ī¦Lh = {h0}Lipā = La āŖ Lhā, Lip = {h0}Li = {h0, i0}
0
01
1
Chapter 7: Testing Of Digital Circuits 16
Deductive Fault Simulation(example contd.)
a
bc
de
f
g
h
i
La = {a1} Lb = {b0} Lc = {c0} Ld = {d0} Le = {e1}0
11
10
Lfpā = Lbā ā© Lcā = { b0, c0}Lf = {b0, c0, f0}Lgp = (Ldā āŖ Le)ā = {d0}Lg = {d0, g1}Lhpā = (Lf āā© Lg)āLhp = {d0,g1} , Lh = {d0,g1,h0}Lipā = La āŖ Lhā, Lip = {d0, g1,h0}Li = {d0, g1, h0, i0}
1
01
1
Chapter 7: Testing Of Digital Circuits 17
Test Generation Methods Boolean Difference & D-Algorithm
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 18
Boolean Difference
Consider a function f of say 4 variablesf(x0, x1, x2, x3) Boolean difference of f w.r.t to xi is defined as
follows:df/dxi = fāxi=0 + fāxi=1
4
Chapter 7: Testing Of Digital Circuits 19
Boolean Difference (example)a
bc
de
f
g
h
i
i = a + ((b.c). (d +e)ā)ā
di/da = iāa=0 + iāa=1 = ((b.c).(d+e)ā)ā + 1 = (b.c)(d+e)ā
Chapter 7: Testing Of Digital Circuits 20
Example (contd.)
di/da = (b.c)(d+e)ās-a-0 fault at a can be tested by
a.di/da = 1 or a.b.c(d+e)ā = 1 ā test vectors (1,1,1,0,0)s-a-1 fault at a can be tested by
aā.di/da = 1 or aā.b.c(d+e)ā = 1 ā test vectors (0,1,1,0,0)
Chapter 7: Testing Of Digital Circuits 21
Boolean Difference (contd.)
bc
de
f
g
h
i = a + (f. (d +e)ā)ā
di/df = iāf=0 + iāf=1 = 1 + (a +d+e)= (a+d+e)ā = aādāeā
a
Chapter 7: Testing Of Digital Circuits 22
Boolean Difference (contd.)
di/df = aā.dā.eās-a-0 fault at f can be tested by
f.di/df = 1 or faādāeā = b.c.aādāeā =1 ā test vectors (0,1,1,0,0)s-a-01fault at f can be tested by fā.di/df = 1 or fā.aādāeā = (b.c)ā.aādāeā = 1 ā test vectors (0,0,X,0,0) and (0, X,0,0,0)
Chapter 7: Testing Of Digital Circuits 23
D-Algorithm
There are three main steps in the D-Algorithmā¢ Generate the faultā¢ Propagate the fault to one of the outputs
(Forward or D-Drive)ā¢ Back propagate to get consistent assignment
for inputs (Backward drive or back-propagation)
Chapter 7: Testing Of Digital Circuits 24
D-Algorithm (Step 1)
bc
de
f
g
h
Let us say we choose the fault g node s-a-0
1
2
3
4
Assign inputs to gate 2 to generate the faulti.e. d = 0 and e = 0
a i
5
Chapter 7: Testing Of Digital Circuits 25
D-Algorithm (Step 2)
bc
de
f
g
h1
2
3
4a
00
D Choose a path to the o/pand propagate the fault
f is to be assigned 1 and a is to be assigned 0 to propagate D to the output i
i
Chapter 7: Testing Of Digital Circuits 26
D-Algorithm (Step 3)
bc
de
f
g
h1
2
3
4a
00
D
i
1
0
Dā
Dā
Consistency Check
Assign inputs to gates (whose outputs have been specified ) consistent with other assignments
Chapter 7: Testing Of Digital Circuits 27
D-Algorithm Result
bc
de
f
g
h1
2
3
4a
00
D
i
1
0
Dā
Dā1
1
The test vector is (0,1,1,0,0)
Chapter 7: Testing Of Digital Circuits 28
D-Algorithm
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 29
Terminology
ā¢ Singular Coverā¢ D-intersectionā¢ Primitive D-cube of a fault (pdcf)ā¢ Propagation D-cubes (pdf)
Chapter 7: Testing Of Digital Circuits 30
Singular Cover
SC of a gate (or any circuit element) is nothing but a compact version of the truth table. SC of a AND gate with a and b as inputs and c as output
a b c0 X 0X 0 01 1 1
6
Chapter 7: Testing Of Digital Circuits 31
Singular Cover (contd.)
SC of a NOR gate with a and b as inputs and c as output
a b c1 X 0X 1 00 0 1
Chapter 7: Testing Of Digital Circuits 32
D-Intersection
0 1 X D D'0 0 D' 0 Ļ Ļ1 D 1 1 Ļ ĻX 0 1 X D D'D Ļ Ļ D D *D' Ļ Ļ D' * D'
Chapter 7: Testing Of Digital Circuits 33
Primitive D-Cube of Fault (pdcf)
For generating a s-a-0 fault at node c, choose a SC row which gives an o/p of 1 for the nor gate and intersect with (X,X,0).pdcf is (0, 0, D)
ab
c
Chapter 7: Testing Of Digital Circuits 34
PDCF (contd.)
For generating a s-a-1 fault at node c, choose a SC row which gives an o/p of 0 for the nor gate and intersect with (X,X,1).pdcf is (1, X, D) or (X, 1, D)
ab
c
Chapter 7: Testing Of Digital Circuits 35
Propagation D-Cube (pdc)
ā¢ PDC consists of a table for each circuit element which has entries for propagating faults on any one of its inputs to the output.
ā¢ To generate PDC entry corresponding to any one column, D-intersect any two rows of SC which have opposite values (0 and 1) in that column.
ā¢ There can be multiple rows for one column Chapter 7: Testing Of Digital Circuits 36
PDC Example
PDC of a AND gate with a and b as inputs and c as output
a b c1 D DD 1 D
7
Chapter 7: Testing Of Digital Circuits 37
PDC Example (contd.)
PDC of a NOR gate with a and b as inputs and c as output
a b c0 D DāD 0 Dā
Chapter 7: Testing Of Digital Circuits 38
D-Algorithm Steps
ā¢ Choose a stuck-at-fault at any of the nodes.ā¢ Choose a pdcf for generating the fault. ā¢ Choose an output and a path to the output and
propagate the fault to the output by choosing pdc for all circuit elements on the path. (D-Drive)
ā¢ Use the SC of all unassigned circuit elements to arrive at a consistent set of inputs. (back-propagate or consistency check)
Chapter 7: Testing Of Digital Circuits 39
D-Algorithm: PDCF Examplea
bc
de
f
g
h
i
Choose a fault say g s-a-0. Choose pdcf of gate 2 for generating this fault(a b c d e f g h i ) = (X X X 0 0 X D X X)
1
2
3
4
Chapter 7: Testing Of Digital Circuits 40
D-Algorithm: D-Drive Example
Propagate the fault to the o/p using pdc of gates 3 &4 a
bc
de
f
g
h
i
1
2
3
4
00
D pdc 3 (X X X 0 0 1 D Dā X)pdc 4 (0 X X 0 0 1 D Dā Dā)
Chapter 7: Testing Of Digital Circuits 41
D-Algorithm: Consistency Example
Perform consistency operation for gate 1 a
bc
de
f
g
h
i
1
2
3
4
00
D (X X X 0 0 1 D Dā X)sc 1 (0 1 1 0 0 1 D Dā Dā)
Chapter 7: Testing Of Digital Circuits 42
D-Algorithm: Summary
a b c d e f g h iInitial x x x x x x x x xpdcf 2 x x x 0 0 x D x xpdc 3 x x x 0 0 1 D D' xpdc 4 0 x x 0 0 1 D D' D'consis. 1 0 1 1 0 0 1 D D' D'
D
8
Chapter 7: Testing Of Digital Circuits 43
Testing of Sequential Circuits
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 44
Testing Techniques
ā¢ State table verificationā¢ Random testingā¢ Transition count testingā¢ Scan based testingā¢ Signature analysis
Chapter 7: Testing Of Digital Circuits 45
State Table Verification
Verify each transition by first taking the machine to a specific initial state, applying the input to perform the transition and then verifying the final state.
For this purpose we need a homing sequence and distinguishing sequence
Chapter 7: Testing Of Digital Circuits 46
Homing & Distinguishing Sequence
ā¢ Homing sequence: An input is said to be a homing sequence for a m/c if the m/cāsresponse to the sequence is always sufficient to determine uniquely its final state.
ā¢ Distinguishing sequence: An input sequence which when applied to a machine will produce a different output sequence for each choice of initial state.
Chapter 7: Testing Of Digital Circuits 47
Example
PS X = 0 X = 1
A B, 0 D, 0
B A, 0 B, 0
C D, 1 A, 0
D D, 1 C, 0
Chapter 7: Testing Of Digital Circuits 48
Example: Homing Sequence
(ABCD)
(AB)(D) (ABCD)
(AB)(D) (BD)(C)
(A)(D)(D) (BC)(A)
0 1
0 1
0 1
9
Chapter 7: Testing Of Digital Circuits 49
Random Testing
Randompatterngenerator
Knowngood ckt
Circuitunder test
Compare
Chapter 7: Testing Of Digital Circuits 50
Transition Count Testing
ā¢ Count the number of transitions for a specific input pattern and compare with the value stored for āgoodā circuits
ā¢ Reduction in data storage for storing correct responses
ā¢ āAliasingā errors
Chapter 7: Testing Of Digital Circuits 51
Scan Based Testing
ā¢ Form a scan chain for all the storage elements (āflip-flopsā) in the circuit
ā¢ Use this scan chain for inserting the test patterns as well as reading the results
ā¢ Use combinational circuit test pattern generator methods generating test inputs
Chapter 7: Testing Of Digital Circuits 52
Scan Based Testing (contd.)
logic logicReg
Reg
Reg
Chapter 7: Testing Of Digital Circuits 53
Signature Analysis & Built-in-self-test (BIST)
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 7: Testing Of Digital Circuits 54
Signature Analysis
ā¢ Test results available in a very compact form and thus very suitable for BIST
ā¢ In-speed testing possibleā¢ PRBS generators use for test pattern
generation as well as test result generation
10
Chapter 7: Testing Of Digital Circuits 55
PRBS Generator
A PRBS or pseudo random binary sequence generator consists of a long shift register with serial input generated by taking exclusive-or of some of the intermediate inputs
Chapter 7: Testing Of Digital Circuits 56
BIST Example
logicL1
logicL2
R1
R2
R3
Chapter 7: Testing Of Digital Circuits 57
BIST Registers Modes
ā¢ Normal mode (PIPO)ā¢ PRBS generator modeā¢ Signature capture modeā¢ Scan mode
Chapter 7: Testing Of Digital Circuits 58
BIST Steps: Example
ā¢ R1 : PRBS mode, R2: Signature modeGenerate finite number of test patterns
ā¢ R1, R2, R3: Scan modeScan out the signature of L1 and compare
ā¢ R2 : PRBS mode, R3: Signature modeGenerate finite number of test patterns
ā¢ R1, R2, R3: Scan modeScan out the signature of L2 and compare
1
Chapter 8: Advanced Topics 1
Multi-Level Logic Synthesis
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 8: Advanced Topics 2
Objective
The objective in multi-level logic synthesis is to minimize the cost under a given time-constraint (reflected as number of levels) or to perform an area-time tradeoff.
Chapter 8: Advanced Topics 3
Issues in Multi-level Logic Synthesis
The main issue is to factorise the multiple outputs (or sub-expressions in a single output function) with a view to extract the common sub-expressions.
Chapter 8: Advanced Topics 4
Common Subexpression Extraction
y1 y2 y1 y2
x1 x2 xn
Chapter 8: Advanced Topics 5
Example
y1 = ac + bāc + dey2 = aeā + bāeā + eāf
t1 = (a + bā)y1 = t1c + dey2 = t1eā + eāf
Chapter 8: Advanced Topics 6
Binary Decision Diagram (BDD)
For representation and manipulation of boolean functions, BDDs are used.
For a given ordering of variables, the BDD representation for a function is canonical and for this reduced and ordered BDDs called ROBDDs are used.
2
Chapter 8: Advanced Topics 7
Example: BDD
y1 = a + bāca
b
c c c c
b0 1
0 1 01
1 1 1 110 0 0
Chapter 8: Advanced Topics 8
Example: ROBDD
a
c
b0
01
10
1
0 1
Chapter 8: Advanced Topics 9
Low Power Design
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 8: Advanced Topics 10
Why Low Power Design ?
The need for low power design originates from two different considerations
ā¢ Mobile applications: Battery life is a critical factor in making a product commercially successful
ā¢ High-frequency VLSI circuits where low power dissipation is critical for circuit functionality and reliability
Chapter 8: Advanced Topics 11
Technology
ā¢ Universally the technology of choice for low power is CMOS
ā¢ A major component of power consumption is the switching power with leakage etc. contributing insignificantly
ā¢ The power dissipated by a gate is given by0.5 Ć Cload Ć Vdd
2 Ć E(transitions)/ Tcyc
Chapter 8: Advanced Topics 12
Issues in Low Power Design
ā¢ Accurate estimations of power consumption at higher levels of design abstractions
ā¢ Power reducing design transformationsā¢ Uniform distribution of power in the chipā¢ Packaging for effective power dissipation to
maintain ācoolā operations
3
Chapter 8: Advanced Topics 13
Power Estimation
Power can be estimated by simulating the behavior at different levels.
ā¢ Transistor levelā¢ Gate levelā¢ RTL module levelā¢ Software power estimationā¢ Architecture level
Chapter 8: Advanced Topics 14
Design Transformations
ā¢ Critical path reductionā¢ Reducing the number of operationsā¢ Reducing the transition activityā¢ Reducing the interconnect capacitanceā¢ Operation substitutionā¢ Bit-width optimization
Chapter 8: Advanced Topics 15
Critical Path Reduction
ā¢ Reducing the critical path implies larger acceptable delays which in turn means a lower Vdd
Vdd
Delay
Chapter 8: Advanced Topics 16
Transition Activity Reduction
ā¢ Reduction in variation in path lengthsā¢ Coding of numbersā¢ Coding of states and instructions
Chapter 8: Advanced Topics 17
Transition Activity Reduction (contd.)
+
+
+
+ +
+
a b
c
d
a b c d
Chapter 8: Advanced Topics 18
Operation Substitution
ā¢ Some operations are very expensive in terms of power and in case it can be replaced by equivalent operations its is preferable e.g multiply by shift and add especially for multiplications with a constant
4
Chapter 8: Advanced Topics 19
Behavioral Synthesis
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 8: Advanced Topics 20
Why Behavioral Synthesis ?
There is urgent need for pushing up the abstraction level at which the design can start. The reasons for this are:
ā¢ As the complexity increases, this is the only way to reduce the design turn around time
ā¢ An algorithmic description of the functionality is far easier to write than designing hardware
Chapter 8: Advanced Topics 21
Steps in Behavioral Synthesis
ā¢ Data path synthesisā Schedulingā Resource allocation (where resources include
functional units, storage units, buses and interconnects)
ā Resource bindingā¢ Control synthesisā¢ Clock synthesis
Chapter 8: Advanced Topics 22
Scheduling
ā¢ Assigning operations to control stepsā¢ This phase has a lot of influence on
resource allocation as what can be done concurrently depends upon the resource availability
ā¢ Complexity arises due to the range of available functional units (pipelined, multi-functional, multi-cycle etc.)
Chapter 8: Advanced Topics 23
Resource Allocationā¢ Typically manual but automating allocation
algorithms are also availableā¢ FU allocation: Complexity due to the range
of operators i.e. Multi-cycle, multi-function, pipelined, mixed speed operators for the same operation
ā¢ Storage allocation: e.g. Registers, Memory units, Multi-port memories, Register files
Chapter 8: Advanced Topics 24
Resource Binding
ā¢ Examples of binding to be carried out areā Operation-operator bindingā Variable-storage unit bindingā Transfer-interconnect/bus binding
ā¢ Binding has considerable influence on number of interconnects
ā¢ Scheduling also influences binding
5
Chapter 8: Advanced Topics 25
Control & Clock Synthesis
ā¢ Generate a state machine from the control flow of the algorithm
ā¢ Identify the control and status signalsā¢ Synthesize the control partā¢ Analyze the critical path to decide on the
clock period
Chapter 8: Advanced Topics 26
Objectives in Behavioral Synthesis
ā¢ Minimize delay time or maximize performance
ā¢ Minimize cost or areaā¢ Meet constraints on area and/or
performance
Chapter 8: Advanced Topics 27
Recent Trends in Behavioral Synthesis
ā¢ Incorporate testability conditions in synthesis
ā¢ Incorporate power minimization as part of the design objective i.e. explore the design space from power considerations
Chapter 8: Advanced Topics 28
System Level Design & Modeling
M. BalakrishnanDept. of Comp. Sci. & Engg.
I.I.T. Delhi
Chapter 8: Advanced Topics 29
Issues in System Level Design
ā¢ Specificationā At different levels of design
ā¢ Verificationā Formal verificationā Simulation
ā¢ Partitioning and estimationā¢ Synthesis
Chapter 8: Advanced Topics 30
Characteristics of Current Systems
ā¢ One (or more) processorsā Heterogeneous processor set
ā¢ IP cores for critical parts of the applicationā¢ Mixed hardware/software implementationā¢ Many systems are real-time reactive
systems
6
Chapter 8: Advanced Topics 31
System Level Design Methodology
Chapter 8: Advanced Topics 32
Specification
ā¢ Functionalityā¢ Concurrencyā¢ Time/performance constraintsā¢ Interface timingsā¢ Area and power constraints
Chapter 8: Advanced Topics 33
Estimation
ā¢ Hardware estimateā Area(cost), performance and power estimation
ā¢ Software estimateā Code size, performance and power estimation
ā¢ Interface estimateā Bus bandwidth and power estimation
Chapter 8: Advanced Topics 34
Partitioning
ā¢ Hardware-software partitioningā¢ Task partitioning across multiple processorsā¢ Communication partitioning across multiple
buses
Chapter 8: Advanced Topics 35
Synthesis
ā¢ Processor synthesis (ASIPs)ā Application specific instruction processor
ā¢ Hardware synthesisā Behavioral as well as logic
ā¢ Software synthesisā Code generation and retargetable compilers
ā¢ Interface synthesis
Chapter 8: Advanced Topics 36
Formal Verification
ā¢ Formal verification of functional specification by proving that the implementation is equivalent to specifications.ā Theorem proving techniquesā Temporal logic systems