SlideShare a Scribd company logo
Digital Design:
An Embedded Systems
Approach Using Verilog
Chapter 4
Sequential Basics
Portions of this work are from the book, Digital Design: An Embedded
Systems Approach Using Verilog, by Peter J. Ashenden, published by Morgan
Kaufmann Publishers, Copyright 2007 Elsevier Inc. All rights reserved.
Verilog
Digital Design — Chapter 4 — Sequential Basics 2
Sequential Basics
 Sequential circuits
 Outputs depend on current inputs and
previous inputs
 Store state: an abstraction of the history of
inputs
 Usually governed by a periodic clock
signal
Verilog
Digital Design — Chapter 4 — Sequential Basics 3
D-Flipflops
 1-bit storage element
 We will treat it as a basic component
 Other kinds of flipflops
 SR (set/reset), JK, T (toggle)
Verilog
Digital Design — Chapter 4 — Sequential Basics 4
Registers
 Store a multi-bit encoded value
 One D-flipflop per bit
 Stores a new value on
each clock cycle
wire [n:0] d;
reg [n:0] q;
...
always @(posedge clk)
q <= d;
event list
nonblocking
asignment
n
n n
n
Verilog
Digital Design — Chapter 4 — Sequential Basics 5
Pipelines Using Registers
Total delay = Delay1 + Delay2 + Delay3
Clock period = Delay1 + Delay2 + Delay3
Interval between outputs > Total delay
Clock period = max(Delay1, Delay2, Delay3)
Total delay = 3 × clock period
Interval between outputs = 1 clock period
combin-
ational
circuit 1
combin-
ational
circuit 2
combin-
ational
circuit 3
combin-
ational
circuit 1
combin-
ational
circuit 2
combin-
ational
circuit 3
Verilog
6
Pipeline Example
 Compute the average of corresponding
numbers in three input streams
 New values arrive on each clock edge
module average_pipeline ( output reg signed [0:13] avg,
input signed [0:13] a, b, c,
wire signed [0:14] a_plus_b;
Wire signed [0:15] sum;
wire signed [0:22] sum_div_3;
reg signed [0:14] saved_a_plus_b
Reg signed [0:13] saved_c
Reg [0:15] saved_sum;
...
input clk );
Verilog
Digital Design — Chapter 4 — Sequential Basics 7
Pipeline Example
...
assign a_plus_b = a + b;
always @(posedge clk) begin // Pipeline register 1
saved_a_plus_b <= a_plus_b;
saved_c <= c;
end
assign sum = saved_a_plus_b + saved_c;
always @(posedge clk) // Pipeline register 2
saved_sum <= sum;
assign sum_div_3 = saved_sum * 7'b0101010;
always @(posedge clk) // Pipeline register 3
avg <= sum_div_3;
endmodule
Verilog
Blockdiagram
Digital Design — Chapter 4 — Sequential Basics 8
a+b
Divide
by 3
Saved a+b
a+b+c
Saved c

More Related Content

What's hot (20)

PPT
Verilog tutorial
Maryala Srinivas
 
PDF
Day2 Verilog HDL Basic
Ron Liu
 
PDF
Lecture 2 verilog
venravi10
 
PPTX
System Verilog Tutorial - VHDL
E2MATRIX
 
PPT
EMBEDDED SYSTEMS 4&5
PRADEEP
 
PDF
Verilog tutorial
Abhiraj Bohra
 
PDF
Verilog lab manual (ECAD and VLSI Lab)
Dr. Swaminathan Kathirvel
 
PPT
3306617
shwetakks
 
DOC
All VLSI programs
Gouthaman V
 
PDF
verilog code for logic gates
Rakesh kumar jha
 
PPT
Fpga 05-verilog-programming
Malik Tauqir Hasan
 
PPT
verilog
Shrikant Vaishnav
 
PDF
VLSI Lab manual PDF
UR11EC098
 
PPTX
System verilog assertions
HARINATH REDDY
 
PDF
Digital system design practical file
Archita Misra
 
PDF
Programs of VHDL
Rkrishna Mishra
 
PDF
Address/Thread/Memory Sanitizer
Platonov Sergey
 
PDF
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
PDF
Vlsi lab manual exp:2
komala vani
 
PDF
Конверсия управляемых языков в неуправляемые
Platonov Sergey
 
Verilog tutorial
Maryala Srinivas
 
Day2 Verilog HDL Basic
Ron Liu
 
Lecture 2 verilog
venravi10
 
System Verilog Tutorial - VHDL
E2MATRIX
 
EMBEDDED SYSTEMS 4&5
PRADEEP
 
Verilog tutorial
Abhiraj Bohra
 
Verilog lab manual (ECAD and VLSI Lab)
Dr. Swaminathan Kathirvel
 
3306617
shwetakks
 
All VLSI programs
Gouthaman V
 
verilog code for logic gates
Rakesh kumar jha
 
Fpga 05-verilog-programming
Malik Tauqir Hasan
 
VLSI Lab manual PDF
UR11EC098
 
System verilog assertions
HARINATH REDDY
 
Digital system design practical file
Archita Misra
 
Programs of VHDL
Rkrishna Mishra
 
Address/Thread/Memory Sanitizer
Platonov Sergey
 
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
Vlsi lab manual exp:2
komala vani
 
Конверсия управляемых языков в неуправляемые
Platonov Sergey
 

Similar to 04 sequentialbasics 1 (20)

PDF
Lecture07(DHDNBK)-Behavior-Modelling.pdf
thanhfacebook123dn
 
PPT
Sequential_Modelling Design Explainations
GoobeDGreat1
 
PDF
Verilog
abkvlsi
 
PDF
Solution Manual for VHDL for Engineers Kenneth L. Short
carrotazro
 
DOCX
15CS202-unitV.docx HDL CODE FOR II/IV JNTU GV
ssuser03e980
 
DOCX
HDL CODE FOR II/IV B.TECH STUDENTS JNTU GV
ssuser03e980
 
PDF
VHDL Programs
Dr. A. B. Shinde
 
PDF
Basic Synthesis Flow and Commands, Logic Synthesis
Jason J Pulikkottil
 
PDF
design-compiler.pdf
FrangoCamila
 
PPT
09 accelerators
Murali M
 
PDF
ez-clang C++ REPL for bare-metal embedded devices
Stefan Gränitz
 
PDF
Pipeline stalling in vhdl
Sai Malleswar
 
PDF
Basic synthesis flow and commands in digital VLSI
Surya Raj
 
PPTX
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
 
PDF
dokumen.tips_verilog-basic-ppt.pdf
Velmathi Saravanan
 
PDF
Verilog_Cheat_sheet_1672542963.pdf
sagar414433
 
PDF
Verilog_Cheat_sheet_1672542963.pdf
sagar414433
 
PDF
Verilog Cheat sheet-2 (1).pdf
DrViswanathKalannaga1
 
PDF
Verilog for synthesis - combinational rev a.pdf
AzeemMohammedAbdul
 
Lecture07(DHDNBK)-Behavior-Modelling.pdf
thanhfacebook123dn
 
Sequential_Modelling Design Explainations
GoobeDGreat1
 
Verilog
abkvlsi
 
Solution Manual for VHDL for Engineers Kenneth L. Short
carrotazro
 
15CS202-unitV.docx HDL CODE FOR II/IV JNTU GV
ssuser03e980
 
HDL CODE FOR II/IV B.TECH STUDENTS JNTU GV
ssuser03e980
 
VHDL Programs
Dr. A. B. Shinde
 
Basic Synthesis Flow and Commands, Logic Synthesis
Jason J Pulikkottil
 
design-compiler.pdf
FrangoCamila
 
09 accelerators
Murali M
 
ez-clang C++ REPL for bare-metal embedded devices
Stefan Gränitz
 
Pipeline stalling in vhdl
Sai Malleswar
 
Basic synthesis flow and commands in digital VLSI
Surya Raj
 
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
 
dokumen.tips_verilog-basic-ppt.pdf
Velmathi Saravanan
 
Verilog_Cheat_sheet_1672542963.pdf
sagar414433
 
Verilog_Cheat_sheet_1672542963.pdf
sagar414433
 
Verilog Cheat sheet-2 (1).pdf
DrViswanathKalannaga1
 
Verilog for synthesis - combinational rev a.pdf
AzeemMohammedAbdul
 
Ad

Recently uploaded (20)

PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PPTX
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PDF
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PDF
Additional Information in midterm CPE024 (1).pdf
abolisojoy
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PPTX
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
PDF
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PPTX
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PDF
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
PPTX
Electron Beam Machining for Production Process
Rajshahi University of Engineering & Technology(RUET), Bangladesh
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Additional Information in midterm CPE024 (1).pdf
abolisojoy
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
A presentation on the Urban Heat Island Effect
studyfor7hrs
 
Electron Beam Machining for Production Process
Rajshahi University of Engineering & Technology(RUET), Bangladesh
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Hashing Introduction , hash functions and techniques
sailajam21
 
Ad

04 sequentialbasics 1

  • 1. Digital Design: An Embedded Systems Approach Using Verilog Chapter 4 Sequential Basics Portions of this work are from the book, Digital Design: An Embedded Systems Approach Using Verilog, by Peter J. Ashenden, published by Morgan Kaufmann Publishers, Copyright 2007 Elsevier Inc. All rights reserved.
  • 2. Verilog Digital Design — Chapter 4 — Sequential Basics 2 Sequential Basics  Sequential circuits  Outputs depend on current inputs and previous inputs  Store state: an abstraction of the history of inputs  Usually governed by a periodic clock signal
  • 3. Verilog Digital Design — Chapter 4 — Sequential Basics 3 D-Flipflops  1-bit storage element  We will treat it as a basic component  Other kinds of flipflops  SR (set/reset), JK, T (toggle)
  • 4. Verilog Digital Design — Chapter 4 — Sequential Basics 4 Registers  Store a multi-bit encoded value  One D-flipflop per bit  Stores a new value on each clock cycle wire [n:0] d; reg [n:0] q; ... always @(posedge clk) q <= d; event list nonblocking asignment n n n n
  • 5. Verilog Digital Design — Chapter 4 — Sequential Basics 5 Pipelines Using Registers Total delay = Delay1 + Delay2 + Delay3 Clock period = Delay1 + Delay2 + Delay3 Interval between outputs > Total delay Clock period = max(Delay1, Delay2, Delay3) Total delay = 3 × clock period Interval between outputs = 1 clock period combin- ational circuit 1 combin- ational circuit 2 combin- ational circuit 3 combin- ational circuit 1 combin- ational circuit 2 combin- ational circuit 3
  • 6. Verilog 6 Pipeline Example  Compute the average of corresponding numbers in three input streams  New values arrive on each clock edge module average_pipeline ( output reg signed [0:13] avg, input signed [0:13] a, b, c, wire signed [0:14] a_plus_b; Wire signed [0:15] sum; wire signed [0:22] sum_div_3; reg signed [0:14] saved_a_plus_b Reg signed [0:13] saved_c Reg [0:15] saved_sum; ... input clk );
  • 7. Verilog Digital Design — Chapter 4 — Sequential Basics 7 Pipeline Example ... assign a_plus_b = a + b; always @(posedge clk) begin // Pipeline register 1 saved_a_plus_b <= a_plus_b; saved_c <= c; end assign sum = saved_a_plus_b + saved_c; always @(posedge clk) // Pipeline register 2 saved_sum <= sum; assign sum_div_3 = saved_sum * 7'b0101010; always @(posedge clk) // Pipeline register 3 avg <= sum_div_3; endmodule
  • 8. Verilog Blockdiagram Digital Design — Chapter 4 — Sequential Basics 8 a+b Divide by 3 Saved a+b a+b+c Saved c