Professional Documents
Culture Documents
Aim
To design, simulate and implement FSM Moore and Mealy machine in FPGA using Verilog HDL
Software Required
Vivado 2014.4
Hardware Required
Nexys A7: FPGA Trainer Board
Theory
The synchronous sequence machine is described by the finite state machine (FSM),
which is an abstract model. In a sequential circuit, the output is determined by the current input as
well as previous history, necessitating an endless storage capacity.
Finite state machines are utilized because machines with infinite storage capacity are
impossible to implement. Finite state machines are sequential circuits with a finite number of
ways in which their past history might affect their future behavior.
Machines with a finite number of states are known as finite state machines. There are a
limited number of memory devices in any finite-state system. We can construct a periodic
sequence of fewer than or equal to n-states using an n-state machine.
There are two types of finite state machines (FSM). The way the output is generated is
the main difference between them.
o Moore Machine
o Mealy Machine
The fundamental difference between the Mealy and Moore machines is that the dependency
of output is on the current state and input. The current output of the Moore machine is solely
determined by its current state. The current output of the Mealy machine is determined by the
present state and present external inputs. Moore and Mealy machines are quite complex
machines.
Moore and mealy machines are generators. Moore and Mealy machines have no knowledge
of a final state because they aren't used to recognize languages. Moore and Mealy machines are
finite-state deterministic devices.
Moore Machine
Next State
Present State Out
in = 0 in = 1
S0 S1 S0 0
S1 S1 S2 0
S2 S3 S0 0
S3 S1 S2 1
18. Goto project manager right click on Simulation SourcesSelect Add or create simulation sources,
19. Click on Create File Select your file type as Verilog
20. Enter your “file name” and click Finish.,
21. Goto project manager and click your verilog file under Simulation Sources.,
22. Enter your program and save file.,
23. Click on”run synthesis”Running synthesis.,
24. After successful synthesis completion, close the pop-up window and select Simulation Run
Behavioural Simulation is enough to see output waveform If we run through testbench program.
25. Else After the Run Behavioral Simulation, Force the value for inputs by Force Constant option and
save the waveform
26. Run the simulation by clicking on Run for amount of time previously set Output of simulation is
verified with the help of waveform
RTL Schematics and Output
RTL
Schematics
Moore
Machine
Output
RTL
Schematics
Mealy
Machine
Output
Steps for Implementation
Output : 1
Input : 0101
Implemented Melay in
Nexys A7: FPGA Trainer
Board
Output : 1
Input : 0101
Result
Thus the simulation of Moore and Mealy machines of FSM were done, implemented in Nexys
A7 FPGA Trainer Board and outputs were verified
Practice Question
Design and simulate the performance of a module to detect ‘00’ and ‘11’ in a 2 bit counter