L10 Verilog - Expressing Sequential-Cct
L10 Verilog - Expressing Sequential-Cct
2
Combinational + Memory = Sequential
Sequential Circuit
outputs
inputs
Combinational
Circuit
Storage
Element
3
Review: Sequential Logic
• In a combinational circuit, the values of the outputs
are determined solely by the present values of its
inputs.
4
Review: Gated D Latch
5
Review: Master Slave D-flip flop
6
Level-Sensitive vs Edge-Triggered
Storage Elements
A flip-flop is a storage element that can have its output state changed
only on the edge of the controlling clock signal
7
Discussion: Level-Sensitive vs Edge-Triggered
Storage Elements
• Ref to fig in the previous slide:
• Observe that:
– the gated D latch follows the D input as long as the clock is
high.
– The positive-edge-triggered flip-flop responds only to the
value of D when the clock changes from 0 to 1
– The negative-edge-triggered flip-flop responds only to the
value of D when the clock changes from 1 to 0.
8
Expressing Sequential Circuits in
Verilog-HDL
9
Sequential Logic in Verilog
• Define blocks that have memory:
– Flip-Flops, Latches, Finite State Machines
10
Recall: The “always” Block
12
Describing a Positive-Edge D-Flip Flop
endmodule
13
Describing a Positive-Edge D-Flip Flop
module flop(input logic clk,
input logic d,
output logic q);
endmodule
• Also note:
◼ assign statement is not used within an always block
◼ <= describes a non-blocking assignment
◼ clk is the only input that can cause an event on the output
◼ Therefore clk is the only signal in the sensitivity list
endmodule
16
THANK YOU