Lecture Material DSD PDF
Lecture Material DSD PDF
EC-405.01
Digital System Design
Yogesh Tiwari
Emphasis:
Practical
design
circuit implementation..
techniques
and
Lab Experiments
The lab for this course is located in AP1&AP2.
Language
VHDL(Xillinx)
Verilog
Syllabus
Introduction to Programmable logic devices
Electronic Systems Design
MSI & LSI circuits and their Applications
Sequential Machines
Design for Testability
Design Application
Reference books
1.An Engineering Approach To Digital Design,
William I. Fletcher, PHI, Digital System
Design ,John Wakerley. Prentice Hall
International, 2000
Combinational circuits
Sequential circuits
Kmap,Demorgans law, Propagation delay
Latch,flipflop
Edge triggered flipflop, Level triggered flipflop
Synchrounous and asynchronous sequential circuit
State table,State diagram
Serial adder
Metastability
Whenever there are setup and hold time violations in
any flip-flop, it enters a state where its output is
unpredictable: this state is known as metastable state
(quasi stable state); at the end of metastable state, the
flip-flop settles down to either '1' or '0'. This whole
process is known as metastability.
When a flip-flop is in metastable state, its output
oscillate between '0' and '1' as shown in the figure
(here the flip-flop output settles down to '0') . How
long it takes to settle down, depends on the
technology of the flip-flop.
Clock skew
Synchronous design assumes all flip-flops are clocked at the same time.
In real designs, this is not always the case.
The same signal arriving at different parts of the design with different
phase is known as skew. Skew normally refers to clock signals.
Due to:
Wire delay, gates of the path
For flip-flops:
Setup and hold time
Propagation delay
For combinational circuit:
Propagation delay
For sequential circuit:
Combining delay of flip flops and combinational
circuit
What is Hazards??
Static Hazards:
Static-1 Hazard:
The output should be 1 but goes momentary
to 0 as a result of an input change.
(possible in AND-OR circuits)
Static-0 Hazard:
The output should be 0 but goes momentary
to 1 as a result of an input change.
(possible in OR-AND circuits)
Dynamic Hazards
The output changes more than once ( generally 3 or
more) as a result of a single input change
(impossible in 2-level circuits).
Dynamic hazards often occur in larger logic circuits
where there are different routes to the output (from the
input).
Static 1 Hazard
1 0 1
Observe that when input B changes from 1->0, that we jump from one
product term to another product term.
If adjacent minterms are not covered by the same product term, then a
HAZARD EXISTS!!!
Add a loop to the map covering such adjacent 1s, and then add the
corresponding gate to the circuit
The extra product term(AC) does not include the changing input variable(B),
keeps on 1 (for A=C=1) when B changes from 1 to 0, therefore serves to
prevent possible momentary output glitches due to this variable.
Important to note
We will only consider hazards which occurs when a single input variable
changes.
Analysis begin by determining the transient output function,Ft,which
represents the behavior of the network under transient conditions.
The transient output for a network is determined in the same way as
ordinary output function except a variable xi and xi are treated as
independent variables.
This must be done since during transient conditions xi and xi may both
momentarily assume the same values. This means the following theorems
of Boolean algebra cannot be used when manipulating Ft:
XX=0,X+X=1,X+XY=X+Y
The associative, distributive and demorgans laws as well as XX=X,X+XY=X
etc. can be used.
Although in steady state B and B are complements under transient
conditions they are not.
Thus in analysis of a network for hazards, we must treat a variable and its
complement as if they were two independent variables.
Static-0 hazard
"A static-0 hazard occurs in OR-AND circuits when an input
variable and its complement are connected to two different OR
gates.
Ft=(A+B)(B+C)
Dynamic hazard
Definition: A dynamic hazard is the possibility of an output changing more than once
as result of a single input change..
It is caused by structure of a circuit & circuit with more than two levels
It occurs if there are more than 3 paths between input and output.
This is necessary since a dynamic hazards involves triple change in output, so
the effect of the input must reach output by 3 different times.
A network may have a dynamic hazard even if it is free of static hazards.
Introduction:
If a combinational logic circuit is an implementation of
a Boolean function, then a sequential logic circuit can
be considered an implementation of a finite state
machine.
The machine is in only one state at a time; the state it
is in at any given time is called the current state.
It can change from one state to another when initiated
by a triggering event or condition; this is called
a transition.
A particular FSM is defined by a list of its states, and
the triggering condition for each transition.
Each state is represented with a circle, and each transition with an arrow.
The behavior of state machines can be observed in many devices in
modern society which perform a predetermined sequence of actions
depending on a sequence of events with which they are presented.
Simple examples are :
vending machines which dispense products when the proper combination
of coins is deposited
elevators which drop riders off at upper floors before going down.
traffic lights which change sequence when cars are waiting..
combination locks which require the input of combination numbers in the
proper order.
Turnstile which is used to control the access to mall and subways..
Turnstile
Used to control access to subways and amusement
park rides, airport, mall is a gate with three rotating
arms at waist height, one across the entryway.
Moore machine
In Moore machine the output depends only on
current state.
Mealy machine
In Mealy machine the output depend on both
current state and input.
Mealy Machine
Output Depends on State and Inputs
transition condition 1 /
output 1
state 2
state 1
transition condition 2 /
output 2
Moore Machine
Output Depends on State Only
transition
condition 1
state 1 /
output 1
state 2 /
output 2
transition
condition 2
1/0
S0
reset
Meaning
of states:
1/0
S1
0/1
S0: No
elements
of the
sequence
observed
S1: 1
observed
1
S0 / 0
reset
Meaning
of states:
S0: No
elements
of the
sequence
observed
0
S1 / 0
0
S1: 1
observed
S2 / 1
S1: 10
observed
Example 1:
Design a Melay state graph with one input x and one output z.
The output z should be 1 if the input sequence ends either in
010 or 1001,and z should be zero otherwise.
Solution:
Example 2:
Design a Moore state graph with one input x and one
output z. The output z should be 1 if the total number of
1s received is odd and at least two consecutive 0s have
been received ,and z should be zero otherwise.
Solution:
Example 3:
A sequential circuit has one input (X) and one output
(Z). The circuit examines groups of four consecutive
inputs and produces an output Z = 1 if the input
sequence 0101 or 1001 occurs. The circuit resets after
every four inputs. Find a Mealy state graph. A typical
input and output sequence is:
Solution:
A sequential network has one input (x) and one output (z). The output
becomes 1 and remains 1 thereafter when at least two 0s and at least two
1s have occurred as inputs, regardless of the order of occurrence. Draw a
state graph(Moore type) for the network (9 states are sufficient)
Objective:
75
76
77
78
79
Binary Multiplier
State graph for Binary Multiplier Control
80
81
84
85
State diagram
st
1
Q-2(a)
Used to control access to subways and
amusement park rides, airport, mall is a gate
with three rotating arms at waist height, one
across the entryway.
Q-2(c)
Introduction:
Alternative method to represent FSM.
Although it contains same amount of information but it is more
descriptive.
State diagram is useful when machine has a few inputs and
outputs.
ASM chart may be more convenient for larger machines.
ASM charts are also called SM (state machine) charts.
An SM chart differs from an ordinary flowchart in that certain
specific rules must be followed in constructing the SM chart.
When these rules are followed, the SM chart is equivalent to a
state graph, and it leads directly to a hardware realization.
Decision box
Indicates that a given condition is to be tested and the exit path is to be
chosen accordingly
The condition expression consists of one or more inputs to the FSM.
.
The conditional output box describes certain outputs which only become active if
certain conditions described in terms of the system inputs become true.
The outputs are given in the conditional output list and the box is always
associated with a decision box which defines the condition.
This box is always associated with a Mealy model state machine
ASM Block:
Each ASM block contains exactly one state box together with the decision
boxes and conditional output boxes associated with that state.
An ASM block has only one entry path, but any number of exit paths.
Example:ASM Block
a)
If a 1 is received, we have identified the start of a possible sequence, hence, move to
the next state (state S0 detects the first 1)
b)
If a 0 is then received, then we have identified the second digit in the
sequence, move to the next state (state S1 detects the second digit 0)
c)
If a 1 is received then the sequence has been detected and we need to assert
the output (state S2 detects the final digit 1). As this could also be the start
of another sequence, we move back to state S1 to detect the possible next
0.
e)
If we are in S2 and a 0 is received, then we havent detected a correct
sequence, so return to state S0 and start again.
S3/z
Block Diagram
Function Hazards
Function hazards are non-solvable hazards which occurs
when more than one input variable changes at the same
time. Hazards such as function hazards can not be logically
eliminated as the problem lies with actual specification of
the circuit. The only real way to avoid such problems is to
restrict the changing of input variables so that only one
input should change at any given time.
Restrictions are not always possible, for instance let us
imagine some logic circuit that has two inputs. One input is
used for a clock signal, and the other is connected to a
random noise source that we wish to measure. It should be
clear that restrictions in this case would not be an effective
solution.
Fundamental Mode:
All of the input signals are considered to be levels.
This mode assumes that the input signals will be changed
only when the circuit is in a stable state and that only one
variable can change at a given time.
Pulse mode:
The inputs are pulses rather than levels.
In this mode of operation the width of the input pulses is
critical to the circuit operation.
Wire delay
Gates are connected together with wires and these wires do delay the
signal they carry, these delays become very significant when
frequency increases, say when the transistor sizes are sub-micron.
Sometimes wire delay is also called flight time (i.e. signal flight time
from point A to B). Wire delay is also known as transport delay.
Clock skew
Hazards
Hazard a single variable change produces a
momentary output change (commonly referred t
as a glitch) when no output change should occur.
Types: Static-1 hazard
Static-0 hazard
Dynamic hazard
http://www.cs.ucr.edu/~jtarango/cs122a/code
/example_fsm.vhdl
Good for diff
http://www.rsonline.com/designspark/electronics/knowledg
e-item/how-to-implement-state-machines-inyour-fpga
Good for state ecncoding
Moore machineThe FSM uses only entry actions, i.e., output depends only on the
state. The advantage of the Moore model is a simplification of the behaviour.
Consider an elevator door. The state machine recognizes two commands:
"command_open" and "command_close" which trigger state changes. The entry
action (E:) in state "Opening" starts a motor opening the door, the entry action in
state "Closing" starts a motor in the other direction closing the door. States
"Opened" and "Closed" stop the motor when fully opened or closed. They signal
to the outside world (e.g., to other state machines) the situation: "door is open" or
"door is closed".
Fig. 7 Transducer FSM: Mealy model example
Mealy machineThe FSM uses only input actions, i.e., output depends on input and
state. The use of a Mealy FSM leads often to a reduction of the number of states.
The example in figure 7 shows a Mealy FSM implementing the same behaviour as
in the Moore example (the behaviour depends on the implemented FSM execution
model and will work, e.g., for virtual FSM but not for event driven FSM). There are
two input actions (I:): "start motor to close the door if command_close arrives"
and "start motor in the other direction to open the door if command_open
arrives". The "opening" and "closing" intermediate states are not shown.
Introduction
Asynchronous circuit
General block diagram
When next state is same as present state, the circuit is in stable state
Sequential Circuits