1 / 18 Lab 4: Designing the Controller & Assembling the Processor Due date: Friday, March 2 nd , 7pm StateCad : Building the control circuit. 1. To use the state machine editor, StateCad , for the ToyProcessor project, select New Source from the Project menu . 2. Highlight State Diagram and give it the name control.dia , click Next , then Finish . Make sure the Add to Project checkbox is checked. This adds control to the list of sources in Project Manager. Important: There is a bug in Xilinx that if you do not enter the extension ‘.dia’, the default name will be used, ‘untitled.dia’. Also, StateCad is not 100% compatible with long file names, especially names with spaces in it. So make sure your project is placed somewhere like c:\XilinxWorks\MyProject\, not somewhere like c:\Documents and Settings\username\My Documents\My Project\. Creating a new state diagram source 3. A new program should automatically open. Open the State Machine Wizard by clicking on the button on the main toolbar.
2 / 18 State Machine Wizard Window 4. Set the Number of states to 6 and click Next . 5. Click Next to build a Synchronous state machine. In the Setup Transitions box , type CLR in the Next: state transition field.
3 / 18 Set-up Transitions Window 6. Click on Finish and place the state machine on the page by clicking the left mouse button on the white sheet. Your state machine will look like this: 7. Double-click the transition condition CLR between State0 and State1. It will be highlighted by a red box after the first click and an Edit Condition window will appear. 8. Delete CLR from the Condition using the Del button. We do not need a condition here. 9. Delete the conditions for all other state transitions except for that between State2 and State3. 10. Click on the transition between State5 and State0 once to highlight it, hit the DEL button. This should delete the transition line between State5 and State0. 11. Double-click CLR between State2 and State3. In the Edit Condition dialog box that pops up, set CLR=’0’. Note the single quote around 0.
4 / 18 Edit Condition CLR Your state diagram should look like this: Drawing the state diagram 12. We will now add outputs to each of the states. Double-click the bubble that represents the state. In the Edit State
You've reached the end of your free preview.
Want to read all 18 pages?
- Spring '12
- project manager