

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
this is practice qui on pipelining in computer organization. here some usefull formula and concept
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Assume that the starting address of array a is saved in register r 1, and the starting address of array b is saved in register r 2. int i; int b[500]; int a[500]; for(i=0; i < 500; i++) { b[i] = a[a[i]]; }
1's in a 32 bit number. Soln: l0: and r1, r0, r mov r0, r0, lsl # cmp r1, # addne r4, r4, # cmp r0, # bne l mov pc, lr count: mov r4, # mov r0, # bl l
l0: cmp r4, # moveq r4, # addeq r2, r2, # mov pc, lr l1: and r3, r1, r cmp r3, # stmfd sp!, {lr}
blne l ldmfd sp!, {lr} cmp r3, # moveq r4, # mov r0, r0, lsl # cmp r0, # bne l mov pc, lr count: mov r2, # mov r0, # mov r4, # bl l
using a recursive algorithm. l1: mod r5, r3, r cmp r5, # addeq r2, r2, # add r4, r4, # cmp r4, r ble l mov pc, lr prime: mov r7, # mov r3, r mov r6, r0, lsr # mov r4, # mov r2, # bl l cmp r2, # moveq r7, #
number of instructions. A is stored in three registers r2, r3 and r4 with the MSB in r2 and LSB in r4. B is stored in registers r5, r6 and r7 with the MSB in r5 and LSB in r7. Place the nal result in r8(MSB), r9 and r10(LSB).