Question: MUST BE WRITTEN IN MIPS Problem Description: 'A' is an array of 20 items. Each item consists of two words, representing an x and a
MUST BE WRITTEN IN MIPS
Problem Description:
'A' is an array of 20 items. Each item consists of two words, representing an x and a y coordinate for a point in the plane. 'B' is an array of another 20 items and organized similarly. The vertices of each point will be between -500 and +500.
The distance between points A[i] and B[i], for a particular i, is
Write an Assembly program to find the value of i (from 0 to 19) such that A[i] and B[i] are the closest to each other. Print the result.
Initialize your arrays with the following values. If your program is working correctly, it should print 8.
Note: You do not have to take square roots to write this program. sqrt(p)
| Item | A.x | A.y | B.x | B.y |
| 0 | -491 | 490 | -310 | 9 |
| 1 | 144 | -107 | -266 | -346 |
| 2 | 257 | -233 | -179 | -255 |
| 3 | -388 | 427 | -398 | 94 |
| 4 | -324 | 269 | -35 | 448 |
| 5 | 179 | 41 | 360 | 367 |
| 6 | -433 | 461 | -498 | -260 |
| 7 | 248 | 259 | -132 | 418 |
| 8 | 397 | -326 | 412 | -494 |
| 9 | 435 | -37 | -53 | -469 |
| 10 | -446 | 410 | 63 | 35 |
| 11 | 73 | -338 | -322 | -163 |
| 12 | 329 | 272 | -177 | -22 |
| 13 | -216 | -173 | 390 | 134 |
| 14 | -125 | 117 | -52 | -188 |
| 15 | 179 | -387 | -483 | 325 |
| 16 | 497 | -375 | 107 | -402 |
| 17 | -185 | 490 | 104 | -322 |
| 18 | 338 | 425 | 31 | -421 |
| 19 | 13 | 447 | 475 | 391 |
Submit the Following File(s):
Closest.asm
Required Input:
None, but the A and B item arrays should be initialized as listed above.
Required Output:
Your output should look something like the following example.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
