DOC PREVIEW
MIT 6 111 - Study Guide

This preview shows page 1-2-3-21-22-23-43-44-45 out of 45 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

module mainfsm(clock, globalreset, displaymode, writemode, wandenable, wandreset, inputreset, MSGmuxsel, writeenable, loadenable, loaddone, writefinished);input clock, globalreset, displaymode, writemode, writefinished, loaddone;output inputreset, wandreset, MSGmuxsel, loadenable, writeenable, wandenable;reg inputreset, wandreset, MSGmuxsel, loadenable, writeenable, wandenable;reg [2:0] state;parameter Init = 0;parameter Wait = 1;parameter Write = 2;parameter WEreset = 3;parameter Display = 4;parameter LEset = 5;parameter LEreset = 6;parameter WandEnable = 7;always@ (posedge clock)if (globalreset) state <= Init;elsecase(state)Init: beginwandenable <= 0; wandreset <= 1; inputreset <= 1;MSGmuxsel <= 0; writeenable <= 0; loadenable <= 0;state <= Wait;endWait: beginPage 1 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/mainfsm.vwandreset <= 0; inputreset <= 0;if (writemode) state <= Write;else if (displaymode) state <= Display;else state <= Wait;endWrite: beginwriteenable <= 1;if (writefinished) state <= WEreset;else state <= Write;endWEreset: beginwriteenable <= 0; state <= Wait;endDisplay: beginwriteenable <= 0; MSGmuxsel <= 0;state <= LEset;endLEset: beginloadenable <= 1; state <= LEreset;endLEreset: beginloadenable <= 0;Page 2 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/mainfsm.vif (loaddone) state <= WandEnable;else state <= LEreset;endWandEnable: beginMSGmuxsel <= 1; wandenable <= 1;enddefault: state <= Wait;endcaseendmodulePage 3 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/mainfsm.v# Reading E:/Modeltech_6.0b/tcl/vsim/pref.tcl # // ModelSim SE 6.0b Dec 1 2004 # //# // Copyright Mentor Graphics Corporation 2004# // All Rights Reserved.# //# // THIS WORK CONTAINS TRADE SECRET AND # // PROPRIETARY INFORMATION WHICH IS THE PROPERTY# // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS# // AND IS SUBJECT TO LICENSE TERMS.# //# OpenFile "//eecslabs/labsroot/users/byte/Desktop/TW5/backtimer.v"# Reading E:/Modeltech_6.0b/tcl/vsim/pref.tcl # // ModelSim SE 6.0b Dec 1 2004 # //# // Copyright Mentor Graphics Corporation 2004# // All Rights Reserved.# //# // THIS WORK CONTAINS TRADE SECRET AND # // PROPRIETARY INFORMATION WHICH IS THE PROPERTY# // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS# // AND IS SUBJECT TO LICENSE TERMS.# //# OpenFile "//eecslabs/labsroot/users/byte/Desktop/TW5/backtimer.v"module loadstage(Clock, Reset, LoadEnable, LoadDone, WriteEnable, WriteAddr, WriteData, ReadAddr, ReadData);input Clock, Reset, LoadEnable;input [6:0] ReadData;output LoadDone, WriteEnable;output [3:0] ReadAddr;output [6:0] WriteData;output [6:0] WriteAddr;wire [2:0] Shift;wire [39:0] Data;wire [6:0] ROMAddr;loadmsgfsm loadmsgfsm1(Clock, Reset, LoadEnable, LoadDone, ReadAddr, ReadData, ROMAddr, Shift, WriteEnable, WriteAddr);sr sr1(Clock, Shift, Data, WriteData);charrom charrom1(ROMAddr, Clock, Data);endmodulePage 1 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/loadstage.vmodule outputstage(Clock, WandReset, WandEnable, Left,Right, MsgRamAddr, LEDdata, leds);input Clock, WandReset, WandEnable, Left, Right;input [6:0] LEDdata;output [5:0] MsgRamAddr;output [6:0] leds;wire CountUp, CountDown, ReStart, StartTimer, LightsOff, NextLine, ledMuxSel;wandoutfsm wandoutfsm1(Clock, WandReset, ledMuxSel, StartTimer, LightsOff, NextLine, CountUp, CountDown, ReStart, Left, Right, MsgRamAddr, WandEnable);backtimer backtimer1(Clock, WandReset, CountUp, CountDown, ReStart);timer timer1(Clock, StartTimer, LightsOff, NextLine);ledmux ledmux1(Clock, LEDdata, leds, ledMuxSel);endmodulePage 1 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/outputstage.vmodule loadmsgfsm(clock, reset, LoadEnable, LoadDone, ReadAddr, Char, ROMAddr, Shift, WriteEnable, WriteAddr);input clock, reset, LoadEnable;input [6:0] Char; //ASCII Character from bufferoutput [6:0] ROMAddr, WriteAddr;output [3:0] ReadAddr;output [2:0] Shift;output WriteEnable, LoadDone;reg WriteEnable, LoadDone;reg [6:0] ROMAddr, WriteAddr;reg [3:0] ReadAddr;reg [2:0] Shift;reg [3:0] state;parameter initialize = 1;parameter Wait = 2;parameter CheckChar = 3;parameter StartWrite = 4;parameter Wait1 = 5;parameter Wait2 = 6;parameter WriteRAM = 7;parameter WriteDone = 8;parameter IncShift = 9;parameter CheckShift = 10;parameter IncrementChar = 11;parameter Done = 12;parameter Wait3 = 13;always @ (posedge clock) beginif (reset) beginstate <= initialize;endelse case(state)initialize:beginReadAddr <= 0;Page 1 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/loadmsgfsm.vWriteAddr <= 1;ROMAddr <= 0;LoadDone <= 0;state <= Wait; endWait:beginif (LoadEnable) state <= CheckChar;else state <= Wait;endCheckChar:beginif (ReadAddr == 8) state <= Done;else state <= StartWrite;endDone:beginLoadDone <= 1;state <= initialize;endStartWrite:beginROMAddr <= Char;Shift <= 0;state <= Wait1;endWait1: state <= Wait2;Page 2 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/loadmsgfsm.vWait2: state <= WriteRAM;WriteRAM:beginWriteEnable <=1;state <= WriteDone;endWriteDone:beginWriteEnable <=0;state <= IncShift;endIncShift:beginShift <= Shift+ 1;WriteAddr <= WriteAddr + 1;state <= CheckShift;endCheckShift:beginif (Shift == 5) state <= IncrementChar;else state <= Wait2;endIncrementChar:beginReadAddr <= ReadAddr + 1;state <= Wait3;Page 3 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/loadmsgfsm.vendWait3: state <= CheckChar;endcaseendendmodulePage 4 User byte May 12, 2005//eecslabs/labsroot/users/byte/Desktop/TW5/loadmsgfsm.vmodule wandoutfsm(Clock, Reset_Sync, LEDenable, StartTimer, LightsOff, NextLine, CountUp, CountDown, StartAgain, Left, Right, ReadAddr, EnableWand);input Clock, Reset_Sync, LightsOff, NextLine, Left, Right, StartAgain, EnableWand;output StartTimer, CountUp, CountDown, LEDenable;output [5:0] ReadAddr;reg [5:0] ReadAddr;reg StartTimer, direction, CountUp, CountDown, LEDenable;reg [3:0] state;parameter initialize = 1;parameter ResetTimer = 2;parameter OutputLine = 4;parameter LEDsOff = 5;parameter UpdateAddr = 6;parameter WaitNextLine = 7;parameter Done = 8;parameter WaitForLeft = 9;parameter WaitForRight = 10;parameter SetDirection = 11;parameter WaitBackTimer = 12;parameter ResetTimer2 = 13; always @ (posedge Clock) beginif (Reset_Sync) begindirection <= 0;state <= initialize;endelse case(state)initialize:beginPage 1 User byte May 12,


View Full Document

MIT 6 111 - Study Guide

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?