We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 10335

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

Follow this example for Question No. 2
z = 4(a +b) – 16(c+58) page 57 and 58 handouts


Solution A:


Notice that the


SRC does not have a multiply instruction.
multiplication with powers of 2 can be achieved by repeated shift left operations. 
ld R1, c ; c is a label used for a memory location 
addi R3, R1, 58 ; R3 contains (c+58) 
shl R7, R3, 4 ; R7 contains 16(c+58) 
ld R4, a 
ld R5, b 
add R6, R4, R5 ; R6 contains (a+b) 
shl R8, R6, 2 ; R8 contains 4(a+b) 
sub R9, R7, R8 ; the result is in R9 
st R9, z ; store the result in memory location z


Assuming Multiply instruction
ld R1, c ; c is a label used for a memory location 
addi R3, R1, 58 ; R3 contains (c+58) 
mul R7, R3, 4 : R7 contains 16(c+58) 
ld R4, a 
ld R5, b 
add R6, R4, R5 ; R6 contains (a+b) 
mul R8, R6, 2 ; R8 contains 4(a+b) 
sub R9, R7, R8 ; the result is in R9 
st R9, z ; store the result in memory location z

1st 2 steps to do question no 2.do the remaining urself.

muli C , B,  5

addi C,C,4

instruction used in this question will be mull immediate(muli) add immediate(addi)  div immediate(divi) and mul

question number 1 RTL for instruction 2 and 3

1-R[0] c R[3]--- R[2]*R[1]

2-R[5]----R[0] c R[2]/6,R[0]---R[0] c R[2]%6

dotted line (---) is actually arrow used in RTL which is not showing correctly here

  1. Jpl r5, [20]

     Solution:  PC←PC+20

    2. Mul r3, r2, r1

      Solution:  R[0]©R[3]←R[2]*R[1]

question number 1 RTL for instruction 2 and 3

1-R[0] c R[3]--- R[2]*R[1]

2-R[5]----R[0] c R[2]/6,R[0]---R[0] c R[2]%6

dotted line (---) is actually arrow used in RTL which is not showing correctly here

1st 2 steps to do question no 2.do the remaining urself.

muli C , B,  5

addi C,C,4

instruction used in this question will be mull immediate(muli) add immediate(addi)  div immediate(divi) and mul

Q:2 solution

.org 100

a;  .dw 1

 

.org 200

ld r1, B

muli r1, r1, 5

addi r2, r1, 4

divi r3, r2, 3

ld r4,  A

muli r4, r4, 8

mul r4, r4, r3

Store r4, C

anybody tell me plz, is this a right solution????

good  it is right but minor mistake in this answer

Dua pls if there is minor error then pls post with correction..Thansk

i have done

ap ny ass kar le ha to please share kar dy

i've also done

RSS

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.