|
Project Description Interactive Floor Plan Timing Diagrams FSM Design and MEG Major Blocks & Subcells Performance Analysis Summary About Us |
50 word description for MOSIS The chip design is based on the logic game Mastermind. In this version of the game, the Master enters a secret code of 4 pegs, each peg being one of 4 colors: red, yellow, green, and blue. The Guesser then attemps to crack the code in 7 guesses or less. The chip calculates the accuracy of the guess. A black peg is returned each time a guess peg is the correct color in the correct position. A white peg is returned each time a guess peg is the correct color but in the WRONG position. For example, an evaluation of 4 white pegs indicates that the Guesser has guessed all the correct colors, but they are in the wrong positions. A score of 4 black pegs indicates that the Guesser has won the game, or cracked the code!! Four colors are represented by 2 bits. Since there are 4 pegs in a code, the chip has 8 pins/bits to represent a code. The binary encoding of the colors is: red = 00, yellow = 01, green = 10, and blue = 11. The game allows the Guesser 7 attempts to crack the code. An incrementer keeps track of the number of guesses. Three output pins encode the number of guesses used so far in the game. For white peg scoring, the chip requires 3 output pins to represent 0 through 4. For black peg scoring, the chip requires 2 output pins to represent 0 through 3. Two additional pins describe the game state as either "keep guessing," "Guesser wins!," or "Guesser loses!". (The equivalent of a score of 4 black pegs is represented using these game state bits) A finite state machine mediates the entire game. Feedback, barrelshifters, and gates construct the logic that is used to compare the guess with the code. Based on the comparison results, a logic PLA returns the appropriate binary black/white peg score. A low score feature keeps track of the shortest game (the game with the fewest guesses utilized to crack the code). Return to top of page
The entered guess is scored against the secret key in a two-phase process. The first phase determines the number of black scoring pegs awarded for the guess. This is completed by a direct comparison of the guess and key. If there are any matches, both the guess and key pegs corresponding to the match are disabled, meaning that neither peg (guess nor key) will be considered in future comparisons. The number of direct matches is the number of black pegs displayed in the final score. The next phase determines the number of white scoring pegs awarded for the guess. To start this phase, the guess pegs are shifted by one peg with respect to the key. Again, a direct comparison is made. If there is a match between two ENABLED pegs, one white peg is added to the final white peg score. As before, both the guess and key pegs corresponding to the match are disabled. Then, the guess pegs are shifted by one peg again. The scoring steps in phase two are repeated. For the final step, the guess pegs are shifted by one last peg, followed by the same scoring steps. A total of three shifts are made on the guess pegs so that each guess peg is compared to each key peg. Code Description:
int black_cnt = 0; //number of correctly placed pegs, scored with black
pegs Return to top of page
Total Pin Count: 40
Return to top of page |