Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you write code based on CPUlator's ARMv 7 DE 1 - SoC system containing an ARMv 7 processor ? Sample Output: table [

Can you write code based on CPUlator's ARMv7 DE1-SoC system containing an ARMv7processor?
Sample Output:
\table[[,,,,,],[,,,,,]]Source Code:
The source code is in the attached file.
Explanation:
We have designed a game where we want contestants to estimate the closest
number to the number generated by the system. First, our program generates
a number in the _start, START, TEMP and RANDOM subroutines. And assigns
the necessary fields to the register such as buttons and seven-segment display.
The Seven-segment display also shows PLAY. PLAY will continue to appear until
the user presses key 0. When KEYO is pressed, the game starts for the first
contestant and starts writing 001 on the seven-segment display. Competitors
can change the number they guess using Key3 and Key2. Key3 increases tens
digit from 0 to 9 if the number is 9, it returns to 0, key 2 increases the units'
digit, if the number is 9, it returns 0. These operations are performed using
read, count, compare1, compare2, count10, seg7_code subroutines. After the
first competitor enters the number he wants, he presses key0, so that the
second competitor starts to play and starts writing 002 on the seven-segment
display. In this process, the user subroutine is used. The second competitor
changes the number using key2 and key3, and when he finishes, he presses
key0. After two competitors have successfully entered their predicted
numbers, the program starts calculating the nearest number to the generated
number. It does this with using the result subroutine. In the result subroutine,
the values given by the two competitors are subtracted from the generated
number and the closest number is found. While these operations are being
performed, generated number appears in the seven-segment display. (For
example, if the generated number is 35, then appears 35.) After a certain
period of time, which contestant wins and the winning number will appear on
the seven-segment display. (If the first competitor has entered 45, the second
contestant has entered 56, in this case 451 appears in the seven-segment
display.) After a certain period of time, won text will appear in seven-segment
display, the final subroutine is used for that process and after that the game
will start over. If the constents want to play again, they need to press key0 to
start the game again.
image text in transcribed

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

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions