Submit Search
Upload
Handout14.verilog4.pdf
•
0 likes
•
3 views
D
DrViswanathKalannaga1
Follow
Handout14.verilog4
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 7
Download now
Download to read offline
Recommended
Verilog Lecture2 thhts
Verilog Lecture2 thhts
Béo Tú
Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
Béo Tú
Verilog hdl
Verilog hdl
Muhammad Uzair Rasheed
System verilog assertions
System verilog assertions
HARINATH REDDY
Day2 Verilog HDL Basic
Day2 Verilog HDL Basic
Ron Liu
Prog1-L3.pptx
Prog1-L3.pptx
valerie5142000
always_at_blocks.pdf
always_at_blocks.pdf
Ahmed Abdelazeem
Recommended
Verilog Lecture2 thhts
Verilog Lecture2 thhts
Béo Tú
Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
Béo Tú
Verilog hdl
Verilog hdl
Muhammad Uzair Rasheed
System verilog assertions
System verilog assertions
HARINATH REDDY
Day2 Verilog HDL Basic
Day2 Verilog HDL Basic
Ron Liu
Prog1-L3.pptx
Prog1-L3.pptx
valerie5142000
always_at_blocks.pdf
always_at_blocks.pdf
Ahmed Abdelazeem
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)
Wang Hsiangkai
Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)
Abhishek Bose
Static analysis and writing C/C++ of high quality code for embedded systems
Static analysis and writing C/C++ of high quality code for embedded systems
Andrey Karpov
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
Indira Priyadarshini
vlsi design using verilog presentaion 1
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
Demo4 code.docx
Demo4 code.docx
kalyank35
bluespec talk
bluespec talk
Suman Karumuri
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
Lourens Naudé
Ver1-iitkgp.ppt
Ver1-iitkgp.ppt
SouvikSaha842368
PLSQL
PLSQL
Srinath Reddy
Memory Management with Java and C++
Memory Management with Java and C++
Mohammad Shaker
Random stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbench
Kashyap Adodariya
Control Statement.ppt
Control Statement.ppt
sanjay
03 - Refresher on buffer overflow in the old days
03 - Refresher on buffer overflow in the old days
Alexandre Moneger
PVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernel
PVS-Studio
Conditional branches
Conditional branches
Dilip Mathuria
SystemVerilog Assertion.pptx
SystemVerilog Assertion.pptx
Nothing!
Cipher block modes
Cipher block modes
Joshua Thijssen
verilog_fsm.pdf
verilog_fsm.pdf
Ahmed Abdelazeem
Concept of datatype.pdf
Concept of datatype.pdf
DrViswanathKalannaga1
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
DrViswanathKalannaga1
More Related Content
Similar to Handout14.verilog4.pdf
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)
Wang Hsiangkai
Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)
Abhishek Bose
Static analysis and writing C/C++ of high quality code for embedded systems
Static analysis and writing C/C++ of high quality code for embedded systems
Andrey Karpov
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
Indira Priyadarshini
vlsi design using verilog presentaion 1
vlsi design using verilog presentaion 1
MANDHASAIGOUD1
Demo4 code.docx
Demo4 code.docx
kalyank35
bluespec talk
bluespec talk
Suman Karumuri
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
Lourens Naudé
Ver1-iitkgp.ppt
Ver1-iitkgp.ppt
SouvikSaha842368
PLSQL
PLSQL
Srinath Reddy
Memory Management with Java and C++
Memory Management with Java and C++
Mohammad Shaker
Random stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbench
Kashyap Adodariya
Control Statement.ppt
Control Statement.ppt
sanjay
03 - Refresher on buffer overflow in the old days
03 - Refresher on buffer overflow in the old days
Alexandre Moneger
PVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernel
PVS-Studio
Conditional branches
Conditional branches
Dilip Mathuria
SystemVerilog Assertion.pptx
SystemVerilog Assertion.pptx
Nothing!
Cipher block modes
Cipher block modes
Joshua Thijssen
verilog_fsm.pdf
verilog_fsm.pdf
Ahmed Abdelazeem
Similar to Handout14.verilog4.pdf
(20)
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
LLVM Register Allocation (2nd Version)
LLVM Register Allocation (2nd Version)
Lab3 testbench tutorial (1)
Lab3 testbench tutorial (1)
Static analysis and writing C/C++ of high quality code for embedded systems
Static analysis and writing C/C++ of high quality code for embedded systems
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
vlsi design using verilog presentaion 1
vlsi design using verilog presentaion 1
Demo4 code.docx
Demo4 code.docx
bluespec talk
bluespec talk
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
Ver1-iitkgp.ppt
Ver1-iitkgp.ppt
PLSQL
PLSQL
Memory Management with Java and C++
Memory Management with Java and C++
Random stability in systemVerilog and UVM based testbench
Random stability in systemVerilog and UVM based testbench
Control Statement.ppt
Control Statement.ppt
03 - Refresher on buffer overflow in the old days
03 - Refresher on buffer overflow in the old days
PVS-Studio delved into the FreeBSD kernel
PVS-Studio delved into the FreeBSD kernel
Conditional branches
Conditional branches
SystemVerilog Assertion.pptx
SystemVerilog Assertion.pptx
Cipher block modes
Cipher block modes
verilog_fsm.pdf
verilog_fsm.pdf
More from DrViswanathKalannaga1
Concept of datatype.pdf
Concept of datatype.pdf
DrViswanathKalannaga1
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
DrViswanathKalannaga1
TimesVLSI Notes-1.pdf
TimesVLSI Notes-1.pdf
DrViswanathKalannaga1
Verilog Cheat sheet-2 (1).pdf
Verilog Cheat sheet-2 (1).pdf
DrViswanathKalannaga1
Verilog_Examples (1).pdf
Verilog_Examples (1).pdf
DrViswanathKalannaga1
pci express system architecture.pdf
pci express system architecture.pdf
DrViswanathKalannaga1
INTERVIEW QUESTIONS_Verilog_PART-2.pdf
INTERVIEW QUESTIONS_Verilog_PART-2.pdf
DrViswanathKalannaga1
More from DrViswanathKalannaga1
(7)
Concept of datatype.pdf
Concept of datatype.pdf
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
INTERVIEW QUESTIONS_Verilog_PART-3-5 (1).pdf
TimesVLSI Notes-1.pdf
TimesVLSI Notes-1.pdf
Verilog Cheat sheet-2 (1).pdf
Verilog Cheat sheet-2 (1).pdf
Verilog_Examples (1).pdf
Verilog_Examples (1).pdf
pci express system architecture.pdf
pci express system architecture.pdf
INTERVIEW QUESTIONS_Verilog_PART-2.pdf
INTERVIEW QUESTIONS_Verilog_PART-2.pdf
Recently uploaded
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
Kira Dess
engineering chemistry power point presentation
engineering chemistry power point presentation
sj9399037128
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
archanaece3
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
Mohd Saifudeen
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
Mustafa Ahmed
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
ssuser5c9d4b1
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
Mathias Magdowski
electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
JNTUA
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
MANASINANDKISHORDEOR
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
Amil baba
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
SwarnaSLcse
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
IJECEIAES
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
josephjonse
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
CHAIRMAN M
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
IJECEIAES
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
jigup7320
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
AshishSingh1301
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
IJECEIAES
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
soginsider
Recently uploaded
(20)
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
engineering chemistry power point presentation
engineering chemistry power point presentation
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
21scheme vtu syllabus of visveraya technological university
21scheme vtu syllabus of visveraya technological university
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
electrical installation and maintenance.
electrical installation and maintenance.
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Handout14.verilog4.pdf
1.
VERILOG 4: COMMON MISTAKES
2.
© B. Baas
84 Common Mistake #1: assign in an always block • There is no “assign” keyword in always blocks! • (Why is it so tempting to type it here?) reg out; always @(a or b) begin out = a & b; end reg out2; always @(a or b) begin assign out2 = a ^ b; end
3.
module endmodule © B. Baas
85 Common Mistake #2: Setting the same reg in multiple always blocks • Simulators will typically do what you tell them to do • Synthesis tools and lint checkers will typically give a warning • Never do this in Hardware verilog • You might be able to get away with it in testing verilog but normally don’t do it always @(a or b) begin x = a ^ b; end always @(reset) begin x = 1’b0; end
4.
© B. Baas
86 Mistake #3: Inferring State In Combinational Circuits By: An Incomplete Sensitivity List • always @(a) begin // missing b out = a & b; end • out updates when a changes as expected • out does not update when b changes! – Put another way, b can change all it wants but out will not update—this requires a memory element to remember the last value of out • Synthesis tools and lint checkers will give a warning • Using the construct new in Verilog 1364-2001: always @(*) or always @* eliminates this type of bug, but it is not supported by all modern CAD tools a out b edge detector G
5.
// this "always"
block does not // instantiate combinational logic always @(freq or xyz or abc) begin if (xyz == 4’b0010) begin freq_c = abc; end case (freq) begin 3’b000: freq_c = abc; 3’b001: freq_c = abc + 3’b001; endcase end © B. Baas 87 • Example: attempted combinational circuit – If xyz==4’b0010, freq_c is a function of the inputs – If freq==3’b000 or 3’b001, freq_c is a function of the inputs – Otherwise, freq_c keeps its old value—which implies memory is needed! Which means our combinational circuit is broken. – A failure occurs when the inputs of a statement are different from the signals used for the if or case condition Mistake #4: Inferring State In Combinational Circuits By: Not Setting a reg In All Paths freq_c logic abc xyz freq
6.
// this "always"
block does instantiate combinational logic always @(freq or xyz or abc) begin // “default” section of always block freq_c = freq; // some default value // main logic block if (xyz==4’b0010) begin freq_c = abc; end else begin // perhaps not always applicable freq_c = ...; end case (freq) begin 3’b000: freq_c = abc; 3’b001: freq_c = abc+3’b001; default: freq_c = ...; // perhaps you know freq should never be anything endcase // other than 000 or 001, or perhaps you do want end // freq_c equal to something in these six cases © B. Baas 88 • Example: successful combinational circuit – Solution: freq_c is set regardless of the values of all inputs – One solution: always declare default values at beginning of always blocks – If helpful, declare default case in case statements Mistake #4: Inferring State In Combinational Circuits By: Not Setting a reg In All Paths freq_c logic abc xyz freq Fixes all Fixes if Fixes only case
7.
© B. Baas
89 For Combinational Circuits: Avoid Inferring State by: 1. Including all input variables in the sensitivity list! 2. Set the value of all regs in all paths through every always block • A nice solution is to set default values for all output variables immediately after entering an always block o You will eliminate the chance of this bug if you do
Download now