Here is how you can design Moore Machine in Matlab Simulink in easy 10 steps.

As you might know there are two forms of sequential machine in Digital Signal processing called Moore and Mealy.

These steps can be used to design and stimulate any Moore type sequential machine in Simulink.

1. Open Simulink and a new model and save the model with some name in some folder.

2. Go to Simulink > Commonly Used Blocks and add three sub-system to the model.

moore machine construction in simulink


3. Name the sub-systems as Next State Logic, State Register and Output Logic as shown in the following diagram.

moore machine construction in simulink
4. Double click the input state logic subsystem so that you are inside the sub-system.

moore machine construction in simulink

5. Add Logical Operator block and In1 input port block from the Simulink > Commonly Used Blocks library. Double click on the logical operator and change the name of operator to XOR from the default AND gate. Add them together as shown below-


6. Name the input ports as x and int1 and output port as int2.

7. Go back to the Parent Schematic page by clicking on the Up arrow in the toolbar.

moore machine construction in simulink

8. Similarly go into the State Register Sub-system to edit the content. Add a D Flip Flop to the sub-system which is available in Simulink Extra library. Add Terminator available in Simulink > Commonly Used Blocks, copy paste input ports so that there are 3 input ports, rename and connect them as shown below-


9. Go to the Output Logic Sub-System and add a Logical Operator block as before and change from the default AND to NOT gate. Rename the ports as int5 and z for input and output as shown.

10. Go back to the parent schematic page and complete the following circuit. Add output signal z back to the input part of the input state logic. Add clock from the Simulink Extra library. Add two constant blocks from commonly used blocks and make them 0 and 1 for reset values and also add a manual switch as shown below.

moore machine construction in simulink
This is the basic Moore machine in simulink.

Simulation

Add input signal and output scope to view the input, output digital waveform and other signal of interest as follows.

moore machine simulink

The digital waveform with various signal is shown below,

digital waveform in simulink

0 comments:

Post a Comment

 
Top