{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


0 notethatdobodywhilecondisnotthesameaswhilecondbody

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: $0, Loop Here the same variable names are used in c code as that of corresponding registers in assembler v0 = 0; do { v0 = v0 + a0 & 1; a0 = a0 >> 1; } while (a0!=0); Note that “do{body} while(cond)” is not the same as “while(cond){body}”! (b) (5 points) Briefly explain in English what the code does Counts the number of 1’s in register $a0, i.e. “population count” (c) (5 points) Assuming 32‐bit MIPS architecture what is the maximum and the minimum number of instructions (i.e. dynamic count) which can be executed by this code? Minimum is when value of register $a0 is 0, i.e. 1 + 4*1 = 5 Maximum is when value of the mos...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online