Professional Documents
Culture Documents
Lab Overview
"n this lab you will# $lip flop designs %&$$ '(&$$ T&$$ Sequential machine design using flip flop
Background:
There are two main types of sequential circuits and their classification depends on the timing of their signals. ). * synchronous sequential circuit is a system whose behavior can be defind from the knowledge of its signals at discrete instant of time +. The behavior of an asynchronous sequential circuit depends upon the input signals at any time and the order in which the inputs change.
The storage elements used in clocked sequential circuit are called flip flops. * flip flop is a binary storage device capable of storing one bit of information. The state of a flip flop can change only during a clock pulse transition. ,atches are used to model asynchronous circuits. * latch also holds one bit value but the state of the latch can change with changes in inputs and does not require synchroni-ation with clock pulse. "n this lab we will learn to model different flip flops using .erilog. %&$$! '(&$$ and T&$$ are the common flip flops used in synchronous sequential circuits. $unction table are used to describe different flip flops. %&$$ is the simplest of the flip/flops because its next state is equal to its present state
Table ) % $lip/$lop
D 0 1 Q(t+1) 0 1
'(&$$ has its next state equal to its present state when inputs ' and ( are both equal to 0. 1hen (2) and '20! the clock resets the flip/flop and 34t5)6 2 0. 1ith '2) and (20! the flip/flops sets and 34t5)6 2). 1hen both ' and k are equal to )! the next state changes to the complement of the present state.
T&$$ toggles when the T2) otherwise the state of T&ff does not change.
Table 7 T $lip/$lop
T 0 1 Q(t+1) Q(t) Q(t+1)
Lab Tasks:
). 1rite verilog code for % flip flop and write a test bench to verify the design. +. 1rite verilog code for '( flip flop and write a test bench to verify the design. 7. 1rite verilog code for T flip flop and write a test bench to verify the design. 8. 1rite verilog code for the figure ). 9. 1rite a test bench to verify the design as shown in the table 8.
$igure )
VLSI System Design
Documentation
Submit the codes along with the wave diagrams for the %! '(! T flip flops and :C% to excess/7 code converter.
Lab Overview
"n this lab you will learn# State machines State diagrams State machine design in .erilog
Background:
$inite State =achines are used to model Sequential circuits since the states of the sequential circuits change depending upon the inputs at the clock edge. * state diagram is used to describe the sequential behavior of the circuit showing the transition of states according to the inputs. >ere a traffic light controller example is presented to show the .erilog coding of $inite state machine.
The following specifications must be considered: 1. The traffic signal for the main highway gets highest priority because cars are continuously present on the main highway. Thus, the main highway signal remains green by default. 2. Occasionally, cars from the country road arrive at the traffic signal. The traffic signal for the country road must turn green only long enough to let the cars on the country road go. 3. As soon as there are no cars on the country road, the country road traffic signal turns yellow and then red and the traffic signal on the main highway turn green again. 4. There is a sensor to detect cars waiting on the country road. The sensor sends a signal X as input to the controller. X = 1 if there are cars on the country road; otherwise, X= 0. The state machine diagram and the state definitions for the traffic signal controller are shown in the following figure
$igure 9.+ State diagram Table 9.) State and output signals
Lab Tasks:
). 1rite verilog code. +. 1rite a test bench to verify the design
Documentation
Submit the code along with the wave diagrams for the sequence detector