Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


share your solutions here!

Views: 723

Attachments:

Replies to This Discussion

anyone having CS501 Assignment 1 spring 2021 please share here

CS501 Assignment 1 Solution Spring 2021 ||Advance Computer Architecture|| 100% Correct Solution

 

3 - Address

0 - Address

Mul x , a , a

Mul j ,x ,a

 

Mul z , b, b

Mul e ,z ,b

 

Sub s , j, e

 

Mul n, 3, a

Mul m, n, b

 

Sub y, s, m

Push a

Push a

Push a

MUL

Push b

Push b

Push b

MUL

Sub

Push 3

Push a

Push b

Mul

Sub

Pop y

QUESTION NO 1

Write the instructions for both 0-address and 3-address machines to evaluate the following expression.

y = a3 – b3 – 3ab

Note: a, b, and c represent memory locations.

 

SOLUTION:

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION NO 2

 Identify the following SRC machine language instructions and specify the values in the fields

Instruction

Type

ra

rb

rc

C1

C2

C3

Sub R6,R3,R2

D

R6

R3

R2

 

 

 

Str R8,34

C

R8

 

 

34

 

 

Id R2,64

C

R2

 

 

64

 

 

Stop

A

-

-

-

-

---

 

Shc R3,R4,3

D

R3

R4

 

 

 

3

not R2,R5

D

R2

-

R5

 

 

 

SOLUTION:

 

cs501 assignment nb 1solution|cs501 solution with file 2021

3 - Address

0 - Address

Mul x , a , a

Mul j ,x ,a

 

Mul z , b, b

Mul e ,z ,b

 

Sub s , j, e

 

Mul n, 3, a

Mul m, n, b

 

Sub y, s, m

Push a

Push a

Push a

MUL

Push b

Push b

Push b

MUL

Sub

Push 3

Push a

Push b

Mul

Sub

Pop y

QUESTION NO 1

Write the instructions for both 0-address and 3-address machines to evaluate the following expression.

y = a3 – b3 – 3ab

Note: a, b, and c represent memory locations.

 

SOLUTION:

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION NO 2

 Identify the following SRC machine language instructions and specify the values in the fields

Instruction

Type

ra

rb

rc

C1

C2

C3

Sub R6,R3,R2

D

R6

R3

R2

 

 

 

Str R8,34

C

R8

 

 

34

 

 

Id R2,64

C

R2

 

 

64

 

 

Stop

A

-

-

-

-

---

 

Shc R3,R4,3

D

R3

R4

 

 

 

3

not R2,R5

D

R2

-

R5

 

 

 

SOLUTION:

 

RSS

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

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