Question: Arrays/Matrics such an array B[n][m] are stored in row-major order that is B[0][0] B[0][1] ... B[0][m-1] B[1][0] B[1][1] ... B[1][m-1] ... B[n-1][0] B[n-1][1]... B[n-1][m-1] We

Arrays/Matrics such an array B[n][m] are stored in row-major order that is B[0][0] B[0][1] ... B[0][m-1] B[1][0] B[1][1] ... B[1][m-1] ... B[n-1][0] B[n-1][1]... B[n-1][m-1]

We have the following two pieces of code. They utilize an array A[n][n] i.e. an n-row n-column matrix A. TYPE-1 (A,n) sum=0; for(i=0; i for(j=0; j sum += A[j][i]; } }

TYPE-2 (A,n) sum=0; for(j=0; j for(i=0; i sum += A[j][i]; } }

The memory of a computer (some addresses only) contains the following. Addresses and contents are in hexadecimal.

006 0006 007 1006 008 5006 009 0000

LIST OF OPCODES (OPCODE is in binary) 0000 = HALT ; halts execution of an instruction cycle 0001 = Load AC from memory 0010 = Store AC to memory (where to?) 0101 = Add to AC from memory

The previous instruction has just completed its execution. Current values of registers PC and AC as shown. PC is 0x007. AC 0x0077. The microprocessor continues its program execution with the next intstruction. Answer the following questions.

a. When the microprocessor completes its program execution what are the contents of register PC ? Convert in hexadecimal (answers in 0X not in 0x)

b. When the microprocessor completes its program execution what are the contents of register AC in hexadecimal? Convert in hexadecimal (answers in 0X not in 0x)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!