Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a circuit for managing batches of rock - paper - scissors game. Two players enter a move, which can be paper, rock, or scissors.

Design a circuit for managing batches of rock-paper-scissors game.
Two players enter a move, which can be paper, rock, or scissors. For each round, the player winning is decreed by the following rules:
Rock beats scissors;
Scissors beats paper;
Paper beats stone.
If the two players choose the same move, the round ends in a draw.
To make it more exciting, each game is divided into several rounds, with the following rules:
A minimum of four rounds must be played;
A maximum of nineteen rounds can be played. The maximum number of runs comes set to the clock cycle in which the game is started;
The first player to win two more rounds than his opponent wins, provided to have played at least four matches;
At each round, the winning player of the previous round cannot repeat the last one move used. If he did so, the round would not be valid and would have to be repeated (therefore, not counted);
At each round, in case of a tie the round is counted. On to the next round, both players can use all moves.
The circuit has three inputs:
FIRST [2 bit]: move chosen by the first player. The moves have the following codes:
-00: no move;
-01: Stone;
-10: Card;
-11: Scissors;
SECOND [2bit]: move chosen by the second player. The moves have the same codes as the first player.
START [1 bit]: when it is 1, it returns the system to the initial configuration. Furthermore, the concatenation of FIRST and SECOND inputs is used to specify the maximum number of matches beyond the mandatory four. For example, if you entered the values FIRST =00 and SECOND =00, it would indicate playing exactly four games. If you entered the value FIRST =00 and SECOND =01, it would be indicated to play at most 5 games (the 4 mandatory ones, plus the value 1 indicated by 0001). If you entered the values FIRST =10 and SECOND =01, yes would indicate playing thirteen games (the 4 mandatory, plus the value 9 indicated by 1001).
When it is 0, the game continues normally.
The circuit has two outputs:
ROUND [2 bit]: provides the result of the last game played with the following coding:
-00: invalid run;
-01: round won by player 1;
-10: round won by player 2;
-11: heat tied.
MATCH [2 bit]: provides the result of the match with the following encoding:
-00: the game is not over;
-01: the game is over, and player 1 has won;
-10: the game is over, and player 2 has won;
-11: the match ended in a draw.
The circuit must be implemented in Verilog (in the behavioral style) and in SIS. The entrances and exits of the Verilog and SIS implementations must have the same order as above. The main module Verilog will have to be called RockPaperScissors. The Verilog testbench must generate, by printing the file called testbench.script, a script that acts as a testbench for the SIS model.
The Verilog model must generate a file, called output_verilog.txt, that every clock cycle reports the outputs with the following format:
Outputs: ROUND[1] ROUND[0] MATCH[1] MATCH[0]
The report must explain in detail at least the following points:
a. The general architecture of the circuit (FSMD scheme);
b. The state diagram of the controller;
c. The datapath architecture;
d. Circuit statistics before and after area optimization;
e. The number of gates and delay obtained by mapping the design to the technology library synch.genlib;
f. The description of any design choices made.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago