SlideShare una empresa de Scribd logo
1 de 3
Descargar para leer sin conexión
Please implement the sequential circuit as Verilog code. State Diagram: State Table,
Assignment, and Minimal equation Please implement the sequential circuit as Verilog code.
Solution
`timescale 1ns/1ns
module SM101 (
clock,reset,w,
z);
input clock;
input reset;
input w;
tri0 reset;
tri0 w;
output z;
reg z;
reg [3:0] fstate;
reg [3:0] reg_fstate;
parameter A=0,B=1,C=2,D=3;
always @(posedge clock)
begin
if (clock) begin
fstate <= reg_fstate;
end
end
always @(fstate or reset or w)
begin
if (reset) begin
reg_fstate <= A;
z <= 1'b0;
end
else begin
z <= 1'b0;
case (fstate)
A: begin
if (~(w))
reg_fstate <= A;
else if (w)
reg_fstate <= B;
// Inserting 'else' block to prevent latch inference
else
reg_fstate <= A;
z <= 1'b0;
end
B: begin
if (~(w))
reg_fstate <= C;
else if (w)
reg_fstate <= B;
// Inserting 'else' block to prevent latch inference
else
reg_fstate <= B;
z <= 1'b0;
end
C: begin
if (~(w))
reg_fstate <= A;
else if (w)
reg_fstate <= D;
// Inserting 'else' block to prevent latch inference
else
reg_fstate <= C;
z <= 1'b0;
end
D: begin
if (~(w))
reg_fstate <= C;
else if (w)
reg_fstate <= B;
// Inserting 'else' block to prevent latch inference
else
reg_fstate <= D;
z <= 1'b1;
end
default: begin
z <= 1'bx;
$display ("Reach undefined state");
end
endcase
end
end
endmodule // SM101

Más contenido relacionado

Similar a Please implement the sequential circuit as Verilog code. State Diagr.pdf

Arduino based keyboard and display interfacing
Arduino based keyboard and display interfacingArduino based keyboard and display interfacing
Arduino based keyboard and display interfacingAkash1900
 
lecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxlecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxAYMENGOODKid
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -Wataru Kani
 
TableDrivenProg_20160714
TableDrivenProg_20160714TableDrivenProg_20160714
TableDrivenProg_20160714Teddy Hsiung
 
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfreservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfRTEFGDFGJU
 
The Ring programming language version 1.5.4 book - Part 59 of 185
The Ring programming language version 1.5.4 book - Part 59 of 185The Ring programming language version 1.5.4 book - Part 59 of 185
The Ring programming language version 1.5.4 book - Part 59 of 185Mahmoud Samir Fayed
 
Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
The Ring programming language version 1.6 book - Part 62 of 189
The Ring programming language version 1.6 book - Part 62 of 189The Ring programming language version 1.6 book - Part 62 of 189
The Ring programming language version 1.6 book - Part 62 of 189Mahmoud Samir Fayed
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfaartechindia
 
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceMatlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceAhmed Momtaz Hosny, PhD
 
D-tutorial.pdf
D-tutorial.pdfD-tutorial.pdf
D-tutorial.pdfRizaJr
 
Concepts of Behavioral modelling in Verilog HDL
Concepts of Behavioral modelling in Verilog HDLConcepts of Behavioral modelling in Verilog HDL
Concepts of Behavioral modelling in Verilog HDLanand hd
 
lalr. fo engineering student those who to
lalr. fo engineering student those who tolalr. fo engineering student those who to
lalr. fo engineering student those who toHjJordTzong
 
Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Karthik Rathinavel
 

Similar a Please implement the sequential circuit as Verilog code. State Diagr.pdf (20)

VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Arduino based keyboard and display interfacing
Arduino based keyboard and display interfacingArduino based keyboard and display interfacing
Arduino based keyboard and display interfacing
 
Module nco rtl
Module nco rtlModule nco rtl
Module nco rtl
 
lecture 5 courseII (6).pptx
lecture 5 courseII (6).pptxlecture 5 courseII (6).pptx
lecture 5 courseII (6).pptx
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 
TableDrivenProg_20160714
TableDrivenProg_20160714TableDrivenProg_20160714
TableDrivenProg_20160714
 
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfreservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
 
2_1 Edit Distance.pptx
2_1 Edit Distance.pptx2_1 Edit Distance.pptx
2_1 Edit Distance.pptx
 
The Ring programming language version 1.5.4 book - Part 59 of 185
The Ring programming language version 1.5.4 book - Part 59 of 185The Ring programming language version 1.5.4 book - Part 59 of 185
The Ring programming language version 1.5.4 book - Part 59 of 185
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
The Ring programming language version 1.6 book - Part 62 of 189
The Ring programming language version 1.6 book - Part 62 of 189The Ring programming language version 1.6 book - Part 62 of 189
The Ring programming language version 1.6 book - Part 62 of 189
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
 
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceMatlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
 
D-tutorial.pdf
D-tutorial.pdfD-tutorial.pdf
D-tutorial.pdf
 
Concepts of Behavioral modelling in Verilog HDL
Concepts of Behavioral modelling in Verilog HDLConcepts of Behavioral modelling in Verilog HDL
Concepts of Behavioral modelling in Verilog HDL
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Verilog code
Verilog codeVerilog code
Verilog code
 
lalr. fo engineering student those who to
lalr. fo engineering student those who tolalr. fo engineering student those who to
lalr. fo engineering student those who to
 
Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...
 

Más de ajayinfomatics

Please list the steps of the accounting cycle.Why is this important .pdf
Please list the steps of the accounting cycle.Why is this important .pdfPlease list the steps of the accounting cycle.Why is this important .pdf
Please list the steps of the accounting cycle.Why is this important .pdfajayinfomatics
 
Please let me know about the material structure and properties of So.pdf
Please let me know about the material structure and properties of So.pdfPlease let me know about the material structure and properties of So.pdf
Please let me know about the material structure and properties of So.pdfajayinfomatics
 
Please integrate ( cos(x) sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdf
Please integrate ( cos(x)  sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdfPlease integrate ( cos(x)  sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdf
Please integrate ( cos(x) sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdfajayinfomatics
 
please identify true or false Solar flux or solar constant is the to.pdf
please identify true or false Solar flux or solar constant is the to.pdfplease identify true or false Solar flux or solar constant is the to.pdf
please identify true or false Solar flux or solar constant is the to.pdfajayinfomatics
 
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdf
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdfPlease help. I will rate. Find an orthonormal basis of the plane x1 .pdf
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdfajayinfomatics
 
PLEASE HELP....Scenario In the five years since the midterm scenari.pdf
PLEASE HELP....Scenario In the five years since the midterm scenari.pdfPLEASE HELP....Scenario In the five years since the midterm scenari.pdf
PLEASE HELP....Scenario In the five years since the midterm scenari.pdfajayinfomatics
 
Please I need help with abstract algebra Will rate quicklySoluti.pdf
Please I need help with abstract algebra Will rate quicklySoluti.pdfPlease I need help with abstract algebra Will rate quicklySoluti.pdf
Please I need help with abstract algebra Will rate quicklySoluti.pdfajayinfomatics
 
Please I need a help in this Q Write a sine function and a cosine fu.pdf
Please I need a help in this Q Write a sine function and a cosine fu.pdfPlease I need a help in this Q Write a sine function and a cosine fu.pdf
Please I need a help in this Q Write a sine function and a cosine fu.pdfajayinfomatics
 
please helpA researcher is investigating the relationship betwee.pdf
please helpA researcher is investigating the relationship betwee.pdfplease helpA researcher is investigating the relationship betwee.pdf
please helpA researcher is investigating the relationship betwee.pdfajayinfomatics
 
please select one option Q1. HRM is associated with the manage.pdf
please select one option Q1. HRM is associated with the manage.pdfplease select one option Q1. HRM is associated with the manage.pdf
please select one option Q1. HRM is associated with the manage.pdfajayinfomatics
 
Please round 14.08 to three decimal places......SolutionTo rou.pdf
Please round 14.08 to three decimal places......SolutionTo rou.pdfPlease round 14.08 to three decimal places......SolutionTo rou.pdf
Please round 14.08 to three decimal places......SolutionTo rou.pdfajayinfomatics
 
Please reflect on the role of NPV and payback period in evaluating i.pdf
Please reflect on the role of NPV and payback period in evaluating i.pdfPlease reflect on the role of NPV and payback period in evaluating i.pdf
Please reflect on the role of NPV and payback period in evaluating i.pdfajayinfomatics
 
Please quickly Im taking the exam now.- What are the four reason.pdf
Please quickly Im taking the exam now.- What are the four reason.pdfPlease quickly Im taking the exam now.- What are the four reason.pdf
Please quickly Im taking the exam now.- What are the four reason.pdfajayinfomatics
 
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdf
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdfPLease help!! 5. In a college class of 30 people, sixteen are women,.pdf
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdfajayinfomatics
 
Please Provide details and I will raterigh.SolutionLet S = m.pdf
Please Provide details and I will raterigh.SolutionLet S = m.pdfPlease Provide details and I will raterigh.SolutionLet S = m.pdf
Please Provide details and I will raterigh.SolutionLet S = m.pdfajayinfomatics
 
Please provide detailed solutions To test a proportion of defec.pdf
Please provide detailed solutions To test a proportion of defec.pdfPlease provide detailed solutions To test a proportion of defec.pdf
Please provide detailed solutions To test a proportion of defec.pdfajayinfomatics
 
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdf
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdfPlease provide answer to question 9.2 page 231 of Manufacturing Engi.pdf
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdfajayinfomatics
 
Please provide a step by step and explanation. Turners syndrome is.pdf
Please provide a step by step and explanation. Turners syndrome is.pdfPlease provide a step by step and explanation. Turners syndrome is.pdf
Please provide a step by step and explanation. Turners syndrome is.pdfajayinfomatics
 
Please provide a detailed explanation. Prove by induction on n that .pdf
Please provide a detailed explanation. Prove by induction on n that .pdfPlease provide a detailed explanation. Prove by induction on n that .pdf
Please provide a detailed explanation. Prove by induction on n that .pdfajayinfomatics
 
Please post your response to the following focus questionsWhat is.pdf
Please post your response to the following focus questionsWhat is.pdfPlease post your response to the following focus questionsWhat is.pdf
Please post your response to the following focus questionsWhat is.pdfajayinfomatics
 

Más de ajayinfomatics (20)

Please list the steps of the accounting cycle.Why is this important .pdf
Please list the steps of the accounting cycle.Why is this important .pdfPlease list the steps of the accounting cycle.Why is this important .pdf
Please list the steps of the accounting cycle.Why is this important .pdf
 
Please let me know about the material structure and properties of So.pdf
Please let me know about the material structure and properties of So.pdfPlease let me know about the material structure and properties of So.pdf
Please let me know about the material structure and properties of So.pdf
 
Please integrate ( cos(x) sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdf
Please integrate ( cos(x)  sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdfPlease integrate ( cos(x)  sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdf
Please integrate ( cos(x) sin ^2 (x) )dx a= 4pi3 b= 3pi2.pdf
 
please identify true or false Solar flux or solar constant is the to.pdf
please identify true or false Solar flux or solar constant is the to.pdfplease identify true or false Solar flux or solar constant is the to.pdf
please identify true or false Solar flux or solar constant is the to.pdf
 
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdf
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdfPlease help. I will rate. Find an orthonormal basis of the plane x1 .pdf
Please help. I will rate. Find an orthonormal basis of the plane x1 .pdf
 
PLEASE HELP....Scenario In the five years since the midterm scenari.pdf
PLEASE HELP....Scenario In the five years since the midterm scenari.pdfPLEASE HELP....Scenario In the five years since the midterm scenari.pdf
PLEASE HELP....Scenario In the five years since the midterm scenari.pdf
 
Please I need help with abstract algebra Will rate quicklySoluti.pdf
Please I need help with abstract algebra Will rate quicklySoluti.pdfPlease I need help with abstract algebra Will rate quicklySoluti.pdf
Please I need help with abstract algebra Will rate quicklySoluti.pdf
 
Please I need a help in this Q Write a sine function and a cosine fu.pdf
Please I need a help in this Q Write a sine function and a cosine fu.pdfPlease I need a help in this Q Write a sine function and a cosine fu.pdf
Please I need a help in this Q Write a sine function and a cosine fu.pdf
 
please helpA researcher is investigating the relationship betwee.pdf
please helpA researcher is investigating the relationship betwee.pdfplease helpA researcher is investigating the relationship betwee.pdf
please helpA researcher is investigating the relationship betwee.pdf
 
please select one option Q1. HRM is associated with the manage.pdf
please select one option Q1. HRM is associated with the manage.pdfplease select one option Q1. HRM is associated with the manage.pdf
please select one option Q1. HRM is associated with the manage.pdf
 
Please round 14.08 to three decimal places......SolutionTo rou.pdf
Please round 14.08 to three decimal places......SolutionTo rou.pdfPlease round 14.08 to three decimal places......SolutionTo rou.pdf
Please round 14.08 to three decimal places......SolutionTo rou.pdf
 
Please reflect on the role of NPV and payback period in evaluating i.pdf
Please reflect on the role of NPV and payback period in evaluating i.pdfPlease reflect on the role of NPV and payback period in evaluating i.pdf
Please reflect on the role of NPV and payback period in evaluating i.pdf
 
Please quickly Im taking the exam now.- What are the four reason.pdf
Please quickly Im taking the exam now.- What are the four reason.pdfPlease quickly Im taking the exam now.- What are the four reason.pdf
Please quickly Im taking the exam now.- What are the four reason.pdf
 
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdf
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdfPLease help!! 5. In a college class of 30 people, sixteen are women,.pdf
PLease help!! 5. In a college class of 30 people, sixteen are women,.pdf
 
Please Provide details and I will raterigh.SolutionLet S = m.pdf
Please Provide details and I will raterigh.SolutionLet S = m.pdfPlease Provide details and I will raterigh.SolutionLet S = m.pdf
Please Provide details and I will raterigh.SolutionLet S = m.pdf
 
Please provide detailed solutions To test a proportion of defec.pdf
Please provide detailed solutions To test a proportion of defec.pdfPlease provide detailed solutions To test a proportion of defec.pdf
Please provide detailed solutions To test a proportion of defec.pdf
 
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdf
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdfPlease provide answer to question 9.2 page 231 of Manufacturing Engi.pdf
Please provide answer to question 9.2 page 231 of Manufacturing Engi.pdf
 
Please provide a step by step and explanation. Turners syndrome is.pdf
Please provide a step by step and explanation. Turners syndrome is.pdfPlease provide a step by step and explanation. Turners syndrome is.pdf
Please provide a step by step and explanation. Turners syndrome is.pdf
 
Please provide a detailed explanation. Prove by induction on n that .pdf
Please provide a detailed explanation. Prove by induction on n that .pdfPlease provide a detailed explanation. Prove by induction on n that .pdf
Please provide a detailed explanation. Prove by induction on n that .pdf
 
Please post your response to the following focus questionsWhat is.pdf
Please post your response to the following focus questionsWhat is.pdfPlease post your response to the following focus questionsWhat is.pdf
Please post your response to the following focus questionsWhat is.pdf
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Último (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Please implement the sequential circuit as Verilog code. State Diagr.pdf

  • 1. Please implement the sequential circuit as Verilog code. State Diagram: State Table, Assignment, and Minimal equation Please implement the sequential circuit as Verilog code. Solution `timescale 1ns/1ns module SM101 ( clock,reset,w, z); input clock; input reset; input w; tri0 reset; tri0 w; output z; reg z; reg [3:0] fstate; reg [3:0] reg_fstate; parameter A=0,B=1,C=2,D=3; always @(posedge clock) begin if (clock) begin fstate <= reg_fstate; end end always @(fstate or reset or w) begin if (reset) begin reg_fstate <= A; z <= 1'b0; end else begin z <= 1'b0; case (fstate) A: begin
  • 2. if (~(w)) reg_fstate <= A; else if (w) reg_fstate <= B; // Inserting 'else' block to prevent latch inference else reg_fstate <= A; z <= 1'b0; end B: begin if (~(w)) reg_fstate <= C; else if (w) reg_fstate <= B; // Inserting 'else' block to prevent latch inference else reg_fstate <= B; z <= 1'b0; end C: begin if (~(w)) reg_fstate <= A; else if (w) reg_fstate <= D; // Inserting 'else' block to prevent latch inference else reg_fstate <= C; z <= 1'b0; end D: begin if (~(w)) reg_fstate <= C; else if (w) reg_fstate <= B; // Inserting 'else' block to prevent latch inference else
  • 3. reg_fstate <= D; z <= 1'b1; end default: begin z <= 1'bx; $display ("Reach undefined state"); end endcase end end endmodule // SM101