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.

CS501 Assignment No 01 Solution & Discussion Due Date: 09-11-2017

Questions No 01 Marks (12)
Write the code/instructions to implement the expression A = (B – C) + 15(D - 45) on 3, 2, 1, and 0-address machines.


Questions No 02 Marks (08)
Compute the total memory traffic in bytes for both instruction fetch and instruction execution for the code that implements the expression evaluation for the four machines in question # 1.

Note:
Assume opcodes occupy one byte, addresses occupy three bytes, and data values also occupy three bytes. Don’t mix it with code size of instruction.

+ 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: 3119

.

+ 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

                                                           

BC150401472

                                                    ARSLAN

 

 

Assignment no 1:

CS501 - Advance Computer Architecture:

Due date: 9 Nov 2017:

 

Q-1)

 

Solution:

 

3-Address Machine

2-Address Machine

1-Address Machine

0-Address Machine

Subtract x,b,c

 

Subtract y,d,45

 

Multiply r,y,15

 

Add A,x,r

Load x,b

 

Subtract x,c

 

Load r,d

 

Subtract r,45

 

Multiply r,15

 

Add x,r

 

Store x,A

 

 

Load d

 

Subtract 45

 

Multiply 15

 

Store r

 

Load b

 

Subtract c

 

Store a

Push d

 

Push 45

 

Subtract

 

Push 15

 

Multiply

 

Push b

 

Push c

 

Subtract

 

Pop A

 

 

 

Q-2)

Solution:

0-Address Machine = 45 bytes                  (instruction fetch=27, instruction execution=18)

1-Address Machine = 49 bytes                  (instruction fetch=28, instruction execution=21)

2-Address Machine = 91 bytes                  (instruction fetch=49, instruction execution=42)

3-Address Machine = 76 bytes                  (instruction fetch=40, instruction execution=36)

 

 

 

 

Mя Hөиєү  thanks for sharing 

Note for All Members: You don’t need to go any other site for this assignment/GDB/Online Quiz solution, Because All discussed data of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

total memory traffic is
3-address machine ( ) byte
2-address machine ( ) byte
1-address machine ( ) byte
0-address machine ( ) byte

Advanced Computer Architecture (CS501)
Assignment # 01
VU ID: MC160400478
QUESTION#1
Write the code/instructions to implement the expression A = (B – C) + 15(D - 45) on 3, 2, 1, and 0-address machines
Answer:

.

3-Address Machine 2-Address Machine 1-Address Machine 0-Address
Sub x,b,c
Sub y,d,45
Mul r,y,15
Add A,x,r Load x,b
Sub x,c
Load r,d
Sub r,45
Mul r,15
Add x,r
Store x,A
ida d
suba 45
mula 15
sta r
Ida b
suba c
Sta a Push d
Push 45
Sub
Push 15
Mul
Push b
Push c
Sub
Pop A

QUESTION NO. 2
Compute the total memory traffic in bytes for both instruction fetch and instruction execution for the code that implements the expression evaluation for the four machines in question # 1.

Note:
Assume opcodes occupy one byte, addresses occupy three bytes, and data values also occupy three bytes. Don’t mix it with code size of instruction.
ANSWER:
For example
Load x, b, b requires 7 bytes to represent the instruction (1 byte for the opcode, 3 bytes for address x, and 3 bytes for address b). Fetching and executing requires reading 7 bytes of instruction, reading 3 bytes for B, and then writing 3 bytes for into x.
The total memory traffic is:
3-Address Machine: (76 )bytes
2-Address Machine: (91) bytes
1-Address Machine: (49) bytes
0-Address Machine: (45) bytes

CS501 Assignment#01 Solution 

Attachments:

how to solve question#2?

2nd question answer

0-Address machine = 45 bytes

1-Adress machine= 49 bytes

2-Address Machine = 91 bytes

3-Address Machine = 76 bytes

can any one please brief answer of Q2, 

1-address=if execution 18, then how fetch 27 ?

0-address=how 28fetch, 21 exe........why not 32fetch, 24exe?? what term to eliminate ??

koi plz ya bta do capital letter us kr skty hn ya nh...A = (B – C) + 15(D - 45)
is expression ki instruction ma..eg sub A,B,C like this..is it right???
plz fast

jo expression hai wohi use kro means capital

One mistake in zero address correct it, you all miss Add before pop A ?? 

2nd question ma bot confusion ho ri koi 2nd ka correct ans ya do ka procedure bata do kasy karna

RSS

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

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

.