instructor: yuzhuang hu [email protected]. another design example: pig (chapter 7-10) pig is a single...

33
CMPT 250 Computer Architecture Instructor: Yuzhuang Hu [email protected]

Upload: chad-fletcher

Post on 01-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

CMPT 250 Computer Architecture

CMPT 250 Computer ArchitectureInstructor: Yuzhuang [email protected] Design Example: PIG (Chapter 7-10)PIG is a single dice game. Two players roll the dice in turns. When 1 is rolled, the current total becomes 0. The first player to reach or exceed 100 wins. HOLDROLLNEW GAMERESETPlayer 1Player 2Turn TotalInputs, Outputs, and Registers of PIGSymbolFunctionTypeROLL1: Starts die rolling, 0: Stops die rollingControl inputHOLD1: Ends player turn, 0: Continues player turnControl inputNEWGAME1: Starts new game, 0: Continues current gameControl inputRESET1: Resets game to INIT state, 0: No actionControl inputDIEDIE value-Specialized Counter to count 1..63-Bit data registerSURSubtotal for active player-parallel load register7-bit data registerTR1Total for player 1-parallel load register7-bit data registerTR2Total for player 2-parallel load register7-bit data registerFPFirst player-flip-flop 0:Player 1, 1:Player 21-bit control registerCPCurrent player1-bit control registerState-Machine Diagram for PIG Default: P1=CP, P2=CPTR1