SlideShare a Scribd company logo
1 of 16
Download to read offline
PONDICHERRY UNIVERSITY
DEPARTMENT OF ELECTRONICS
ENGINEERING
SUBMITTED TO:
PROF. DR. K ANUSUDHA
DEPT. OF ELECTRONICS ENGINEERING
SUBMITTED BY:
AWANISH KUMAR
M.TECH(ECE)-1st Year
21304006
MOORE FSM SEQUENCE DETECTOR
CONTENTS
• OBJECTIVE
• INTRODUCTION
• FSM(FINITE STATE MACHINE)
• SEQUENCE DETECTOR
• MEALY MACHINEAND MOORE MACHINE
• VERILOG CODE
• TEST BENCH
• RTL SCHEMATIC
• CONCLUSION
10-06-2022 AWANISH KUMAR 2
OBJECTIVE
➢This Verilog project is to present a full Verilog code for Sequence
Detector using Moore FSM. A Verilog Testbench for the Moore FSM
sequence detector is also provided for simulation.
➢The Moore FSM keeps detecting a binary sequence from a digital
input and the output of the FSM goes high only when a "1011"
sequence is detected.
10-06-2022 AWANISH KUMAR 3
INTRODUCTION
➢ The Moore FSM output depends on only the current state of the
FSM. The state diagram of the Moor FSM for the sequence detector
is as follows: Next state of the Moore FSM depends on the sequence
input and the current state.
➢ The output of the Moore FSM only depends on the current state.
➢ The output of the sequence detector only goes high when the
"1011" sequence is detected
10-06-2022 AWANISH KUMAR 4
SEQUENCE DETECTOR
• There are basically two types of
sequence detector depending on
the type of sequence they identify,
which are as follows:
• Overlapping Sequence
Detector
• Non-Overlapping Sequence
Detector:
10-06-2022 AWANISH KUMAR 5
Figure : - Sequence Detector
MEALY MACHINE AND MOORE MACHINE
Mealy machine: A simple Mealy machine has one input and one output.
Each transition edge is labelled with the value of the input (shown in red) and the
value of the corresponding output (shown in blue).
The machine starts in state Si.
Figure : - Mealy Machine
MOORE MACHINE
• Simple Moore machines have one input and one output. Output
depends only upon the present state.
• Generally, it has more states than Mealy Machine. Input change can
cause change in output change as soon as logic is done.
• In Moore machines, more logic is needed to decode the outputs since
it has more circuit delays.
10-06-2022 AWANISH KUMAR 7
VERILOG CODE
module
sequence_detector_moore(sequence_in,clock,reset,detector_out);
input clock;
input reset;
input sequence_in;
output reg detector_out;
parameter Zero=3'b000,
One=3'b001,
OneZero=3'b011,
OneZeroOne=3'b010,
OneZeroOneOne=3'b110;
reg [2:0] current_state, next_state;
// sequential memory of the Moore FSM
always @(posedge clock, posedge reset)
begin
if(reset==1)
current_state <= Zero;
// when reset=1, reset the state of the FSM to "Zero" State
else
current_state <= next_state; // otherwise, next state
end
always
@(current_state,sequence_in)
begin
case(current_state)
Zero:begin
if(sequence_in==1)
next_state = One;
else
next_state = Zero;
end
One:begin
if(sequence_in==0)
next_state = OneZero;
else
next_state = Zero;
end
One:begin
if(sequence_in==0)
next_state = OneZero;
else
next_state = One;
end
10-06-2022 AWANISH KUMAR 8
One:begin
if(sequence_in==0)
next_state = OneZero;
else
next_state = One;
end
OneZero:begin
if(sequence_in==0)
next_state = Zero;
else
next_state = OneZeroOne;
end
OneZeroOne:begin
if(sequence_in==0)
next_state = OneZero;
else
next_state = OneZeroOneOne;
end
OneZeroOneOne:begin
if(sequence_in==0)
next_state = OneZero;
else
next_state = One;
end
default:next_state = Zero;
endcase
end
always @(current_state)
begin
case(current_state)
Zero: detector_out = 0;
One: detector_out = 0;
OneZero: detector_out = 0;
OneZeroOne: detector_out = 0;
OneZeroOneOne: detector_out = 1;
default: detector_out = 0;
endcase
end
endmodule
10-06-2022 AWANISH KUMAR 9
TEST BENCH
module tb_Sequence_Detector_Moore;
// Inputs
reg sequence_in;
reg clock;
reg reset;
// Outputs
wire detector_out;
// Instantiate the Unit Under Test
sequence_detector_moore uut (
.sequence_in(sequence_in),
.clock(clock),
.reset(reset),
.detector_out(detector_out));
clock = 0;
forever #5 clock = ~clock;
end
initial begin
// Initialize Inputs
sequence_in = 0;
reset = 1;
// Wait 100 ns for global reset to finish
#30;
reset = 0;
#40;
sequence_in = 1;
#10;
sequence_in = 0;
#10;
sequence_in = 1;
#20;
sequence_in = 0;
#20;
sequence_in = 1;
#20;
sequence_in = 0;
end
endmodule
10-06-2022 AWANISH KUMAR 10
RTL SCHEMATIC
10-06-2022 AWANISH KUMAR 11
RTL SCHEMATIC
10-06-2022 AWANISH KUMAR 12
10-06-2022 AWANISH KUMAR 13
10-06-2022 AWANISH KUMAR 14
CONCLUSION
➢ The simulation waveform of the sequence detector shows exactly
how a Moore FSM works.
➢ Next state of the Moore FSM depends on the sequence input and the
current state.
➢ The output of the Moore FSM only depends on the current state.
➢ The output of the sequence detector only goes high when the "1011"
sequence is detected.
THANK YOU
10-06-2022 AWANISH KUMAR 16

More Related Content

Similar to FSM.pdf

AVR_GENERAL KOSTI.ppt
AVR_GENERAL KOSTI.pptAVR_GENERAL KOSTI.ppt
AVR_GENERAL KOSTI.pptprasadkappala
 
CCIE R&S Real Lab Workbbok 2018 updated
CCIE R&S Real Lab Workbbok 2018 updatedCCIE R&S Real Lab Workbbok 2018 updated
CCIE R&S Real Lab Workbbok 2018 updatedCCIERNSTRICKS.COM
 
JVL The MAC Motor AC-Servo Motors with Integrated Driver
JVL The MAC Motor AC-Servo Motors with Integrated DriverJVL The MAC Motor AC-Servo Motors with Integrated Driver
JVL The MAC Motor AC-Servo Motors with Integrated DriverElectromate
 
Computer Organization
Computer OrganizationComputer Organization
Computer OrganizationAnish Goel
 
Advanced Motor Control Technologies – Part 2
Advanced Motor Control Technologies – Part 2Advanced Motor Control Technologies – Part 2
Advanced Motor Control Technologies – Part 2Design World
 
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019CTY TNHH HẠO PHƯƠNG
 
SMC SMC-12 MCB circuit breaker testing system
SMC SMC-12 MCB circuit breaker testing systemSMC SMC-12 MCB circuit breaker testing system
SMC SMC-12 MCB circuit breaker testing systemErika Herbozo
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...sanjay kumar pediredla
 
Final presentation
Final presentationFinal presentation
Final presentationViral Shah
 
4G-LTE-Wireless-Lab-Simulation-Presentation.pdf
4G-LTE-Wireless-Lab-Simulation-Presentation.pdf4G-LTE-Wireless-Lab-Simulation-Presentation.pdf
4G-LTE-Wireless-Lab-Simulation-Presentation.pdfTechyEdits
 
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...IJPEDS-IAES
 
Oscar compiler for power reduction
Oscar compiler for power reduction Oscar compiler for power reduction
Oscar compiler for power reduction magoroku Yamamoto
 

Similar to FSM.pdf (20)

AVR_GENERAL KOSTI.ppt
AVR_GENERAL KOSTI.pptAVR_GENERAL KOSTI.ppt
AVR_GENERAL KOSTI.ppt
 
CCIE R&S Real Lab Workbbok 2018 updated
CCIE R&S Real Lab Workbbok 2018 updatedCCIE R&S Real Lab Workbbok 2018 updated
CCIE R&S Real Lab Workbbok 2018 updated
 
CCIE R&S Real Lab H3 Config
CCIE R&S Real Lab H3 ConfigCCIE R&S Real Lab H3 Config
CCIE R&S Real Lab H3 Config
 
CCIE R&S Real Lab H1 Config
CCIE R&S Real Lab H1 ConfigCCIE R&S Real Lab H1 Config
CCIE R&S Real Lab H1 Config
 
CCIE R&S Real Lab H2 Config
CCIE R&S Real Lab H2 ConfigCCIE R&S Real Lab H2 Config
CCIE R&S Real Lab H2 Config
 
CCIE R&S Real TS-1 Config
CCIE R&S Real TS-1 ConfigCCIE R&S Real TS-1 Config
CCIE R&S Real TS-1 Config
 
JVL The MAC Motor AC-Servo Motors with Integrated Driver
JVL The MAC Motor AC-Servo Motors with Integrated DriverJVL The MAC Motor AC-Servo Motors with Integrated Driver
JVL The MAC Motor AC-Servo Motors with Integrated Driver
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
Gold Duo Servo Drive | ElmoMC
Gold Duo Servo Drive | ElmoMCGold Duo Servo Drive | ElmoMC
Gold Duo Servo Drive | ElmoMC
 
Advanced Motor Control Technologies – Part 2
Advanced Motor Control Technologies – Part 2Advanced Motor Control Technologies – Part 2
Advanced Motor Control Technologies – Part 2
 
Dear Sir pdf
Dear Sir pdfDear Sir pdf
Dear Sir pdf
 
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019
Catalog biến tần Frenic Micro Fuji Electric mới nhất 2019
 
SMC SMC-12 MCB circuit breaker testing system
SMC SMC-12 MCB circuit breaker testing systemSMC SMC-12 MCB circuit breaker testing system
SMC SMC-12 MCB circuit breaker testing system
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
 
OTV Configuration
OTV ConfigurationOTV Configuration
OTV Configuration
 
Final presentation
Final presentationFinal presentation
Final presentation
 
4G-LTE-Wireless-Lab-Simulation-Presentation.pdf
4G-LTE-Wireless-Lab-Simulation-Presentation.pdf4G-LTE-Wireless-Lab-Simulation-Presentation.pdf
4G-LTE-Wireless-Lab-Simulation-Presentation.pdf
 
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...
Speed Tracking of Field Oriented Control Permanent Magnet Synchronous Motor U...
 
09 ms-exercise
09 ms-exercise09 ms-exercise
09 ms-exercise
 
Oscar compiler for power reduction
Oscar compiler for power reduction Oscar compiler for power reduction
Oscar compiler for power reduction
 

More from AWANISHKUMAR84

PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdfPONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdfAWANISHKUMAR84
 
Cognitive Radio Spectrum Management.pdf
Cognitive Radio Spectrum Management.pdfCognitive Radio Spectrum Management.pdf
Cognitive Radio Spectrum Management.pdfAWANISHKUMAR84
 
Optimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN ChannelOptimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN ChannelAWANISHKUMAR84
 
Optical Channel Capacity of MIMO system
Optical Channel Capacity of MIMO systemOptical Channel Capacity of MIMO system
Optical Channel Capacity of MIMO systemAWANISHKUMAR84
 
Rfid based attendance system using arduino (1)
Rfid based attendance system using arduino (1)Rfid based attendance system using arduino (1)
Rfid based attendance system using arduino (1)AWANISHKUMAR84
 

More from AWANISHKUMAR84 (8)

LMS .pdf
LMS .pdfLMS .pdf
LMS .pdf
 
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdfPONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
 
Cognitive Radio Spectrum Management.pdf
Cognitive Radio Spectrum Management.pdfCognitive Radio Spectrum Management.pdf
Cognitive Radio Spectrum Management.pdf
 
Bit Error rate of QAM
Bit Error rate of QAMBit Error rate of QAM
Bit Error rate of QAM
 
Optimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN ChannelOptimum Receiver corrupted by AWGN Channel
Optimum Receiver corrupted by AWGN Channel
 
Optical Channel Capacity of MIMO system
Optical Channel Capacity of MIMO systemOptical Channel Capacity of MIMO system
Optical Channel Capacity of MIMO system
 
Rfid based attendance system using arduino (1)
Rfid based attendance system using arduino (1)Rfid based attendance system using arduino (1)
Rfid based attendance system using arduino (1)
 
CMOS
CMOS CMOS
CMOS
 

Recently uploaded

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
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
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
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
 
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
 

Recently uploaded (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
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
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
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.
 
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
 

FSM.pdf

  • 1. PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING SUBMITTED TO: PROF. DR. K ANUSUDHA DEPT. OF ELECTRONICS ENGINEERING SUBMITTED BY: AWANISH KUMAR M.TECH(ECE)-1st Year 21304006 MOORE FSM SEQUENCE DETECTOR
  • 2. CONTENTS • OBJECTIVE • INTRODUCTION • FSM(FINITE STATE MACHINE) • SEQUENCE DETECTOR • MEALY MACHINEAND MOORE MACHINE • VERILOG CODE • TEST BENCH • RTL SCHEMATIC • CONCLUSION 10-06-2022 AWANISH KUMAR 2
  • 3. OBJECTIVE ➢This Verilog project is to present a full Verilog code for Sequence Detector using Moore FSM. A Verilog Testbench for the Moore FSM sequence detector is also provided for simulation. ➢The Moore FSM keeps detecting a binary sequence from a digital input and the output of the FSM goes high only when a "1011" sequence is detected. 10-06-2022 AWANISH KUMAR 3
  • 4. INTRODUCTION ➢ The Moore FSM output depends on only the current state of the FSM. The state diagram of the Moor FSM for the sequence detector is as follows: Next state of the Moore FSM depends on the sequence input and the current state. ➢ The output of the Moore FSM only depends on the current state. ➢ The output of the sequence detector only goes high when the "1011" sequence is detected 10-06-2022 AWANISH KUMAR 4
  • 5. SEQUENCE DETECTOR • There are basically two types of sequence detector depending on the type of sequence they identify, which are as follows: • Overlapping Sequence Detector • Non-Overlapping Sequence Detector: 10-06-2022 AWANISH KUMAR 5 Figure : - Sequence Detector
  • 6. MEALY MACHINE AND MOORE MACHINE Mealy machine: A simple Mealy machine has one input and one output. Each transition edge is labelled with the value of the input (shown in red) and the value of the corresponding output (shown in blue). The machine starts in state Si. Figure : - Mealy Machine
  • 7. MOORE MACHINE • Simple Moore machines have one input and one output. Output depends only upon the present state. • Generally, it has more states than Mealy Machine. Input change can cause change in output change as soon as logic is done. • In Moore machines, more logic is needed to decode the outputs since it has more circuit delays. 10-06-2022 AWANISH KUMAR 7
  • 8. VERILOG CODE module sequence_detector_moore(sequence_in,clock,reset,detector_out); input clock; input reset; input sequence_in; output reg detector_out; parameter Zero=3'b000, One=3'b001, OneZero=3'b011, OneZeroOne=3'b010, OneZeroOneOne=3'b110; reg [2:0] current_state, next_state; // sequential memory of the Moore FSM always @(posedge clock, posedge reset) begin if(reset==1) current_state <= Zero; // when reset=1, reset the state of the FSM to "Zero" State else current_state <= next_state; // otherwise, next state end always @(current_state,sequence_in) begin case(current_state) Zero:begin if(sequence_in==1) next_state = One; else next_state = Zero; end One:begin if(sequence_in==0) next_state = OneZero; else next_state = Zero; end One:begin if(sequence_in==0) next_state = OneZero; else next_state = One; end 10-06-2022 AWANISH KUMAR 8
  • 9. One:begin if(sequence_in==0) next_state = OneZero; else next_state = One; end OneZero:begin if(sequence_in==0) next_state = Zero; else next_state = OneZeroOne; end OneZeroOne:begin if(sequence_in==0) next_state = OneZero; else next_state = OneZeroOneOne; end OneZeroOneOne:begin if(sequence_in==0) next_state = OneZero; else next_state = One; end default:next_state = Zero; endcase end always @(current_state) begin case(current_state) Zero: detector_out = 0; One: detector_out = 0; OneZero: detector_out = 0; OneZeroOne: detector_out = 0; OneZeroOneOne: detector_out = 1; default: detector_out = 0; endcase end endmodule 10-06-2022 AWANISH KUMAR 9
  • 10. TEST BENCH module tb_Sequence_Detector_Moore; // Inputs reg sequence_in; reg clock; reg reset; // Outputs wire detector_out; // Instantiate the Unit Under Test sequence_detector_moore uut ( .sequence_in(sequence_in), .clock(clock), .reset(reset), .detector_out(detector_out)); clock = 0; forever #5 clock = ~clock; end initial begin // Initialize Inputs sequence_in = 0; reset = 1; // Wait 100 ns for global reset to finish #30; reset = 0; #40; sequence_in = 1; #10; sequence_in = 0; #10; sequence_in = 1; #20; sequence_in = 0; #20; sequence_in = 1; #20; sequence_in = 0; end endmodule 10-06-2022 AWANISH KUMAR 10
  • 15. CONCLUSION ➢ The simulation waveform of the sequence detector shows exactly how a Moore FSM works. ➢ Next state of the Moore FSM depends on the sequence input and the current state. ➢ The output of the Moore FSM only depends on the current state. ➢ The output of the sequence detector only goes high when the "1011" sequence is detected.