Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Memory mapped I/O polling) Write a MIPS program to implement the following single digit adder: keyboard input: X+Y display output: X- Y Z where X

image text in transcribed

image text in transcribed

(Memory mapped I/O polling) Write a MIPS program to implement the following single digit adder: keyboard input: X+Y display output: X- Y Z where X and Y are single digits (such as 2 and 7) and Z is the result (such as 9). A possible way to implement: 1. Polling on the receiver control and read the byte from the receiver data. Doing this for four times so that the four characters X, Y, are stored in an array. 2. Compute the result Z. You need find your own way of converting the ascii byte for a digit into the value of the digit so that the value of Z can be computed. Store the ascii bytes (the result Z might have two digits) into the array. 3. Polling on the transmitter control and write into the transmitter data so that the experssion (such as 5+7 -12) is sent to the display 4. To test your code, you need open the MMIO in the simulator. Goto Tools- Keyboard and Display MMIO make sure you press connect to MIPS" to run your code. Sometimes, it is also helpful to press "reset" on the same screen. 5. Hint: a way to convert a byte storing a single digit into the value of the digit, and the converse (my code is untested (Memory mapped I/O polling) Write a MIPS program to implement the following single digit adder: keyboard input: X+Y display output: X- Y Z where X and Y are single digits (such as 2 and 7) and Z is the result (such as 9). A possible way to implement: 1. Polling on the receiver control and read the byte from the receiver data. Doing this for four times so that the four characters X, Y, are stored in an array. 2. Compute the result Z. You need find your own way of converting the ascii byte for a digit into the value of the digit so that the value of Z can be computed. Store the ascii bytes (the result Z might have two digits) into the array. 3. Polling on the transmitter control and write into the transmitter data so that the experssion (such as 5+7 -12) is sent to the display 4. To test your code, you need open the MMIO in the simulator. Goto Tools- Keyboard and Display MMIO make sure you press connect to MIPS" to run your code. Sometimes, it is also helpful to press "reset" on the same screen. 5. Hint: a way to convert a byte storing a single digit into the value of the digit, and the converse (my code is untested

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

More Books

Students also viewed these Databases questions

Question

List out some inventory management techniques.

Answered: 1 week ago

Question

Understand why customers are loyal to a particular service firm.

Answered: 1 week ago