We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

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

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.

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

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

Views: 3185

Attachments:

### Replies to This Discussion

w
in fetch we add both opcode + (inst,mem)
in execution add all except opcode

total=fetch+exe

plz define what is the mistake???

3-address instruction • The code size is 10 bytes (1+3+3+3 = 10 bytes) • Number of bytes accessed from memory is 22 (10 bytes for instruction fetch + 6 bytes for source operand fetch + 3 bytes for storing destination operand = 19 bytes)

2-address instruction • The code size is 7 bytes (1+3+3 = 7 bytes) • Number of bytes accessed from memory is 16(7 bytes for instruction fetch + 6 bytes for source operand fetch + 3 bytes for storing destination operand = 16 bytes)

1-address instruction • The code size is 4 bytes (1+3= 4 bytes) • Number of bytes accessed from memory is 7 (4 bytes for instruction fetch + 3 bytes for source operand fetch + 0 bytes for storing destination operand = 7 bytes)

0-address instruction • The code size is 1 byte • Number of bytes accessed from memory is 10 (1 byte for instruction fetch + 6 bytes for source operand fetch + 3 bytes for storing destination operand = 10 bytes) The following table summarizes this information

so the ans is

ya confirm theak ha kia waqar

## Latest Activity

30 minutes ago

### CS605 GDB Fall 2020 Solution / Discussion Due Date: 10-dec-2020

3 hours ago
shifa arshad joined +M.Tariq Malik's group

### CS605 Software Engineering-II

3 hours ago
иαвєєℓ αнмє∂ and Ali Fahad joined +M.Tariq Malik's group

### MGT503 Principles of Management

4 hours ago
6 hours ago
shifa arshad joined +M.Tariq Malik's group

### MGT502 Organizational Behavior

6 hours ago
6 hours ago
+ ᴄᴏғғᴇᴇ updated their profile
6 hours ago
Rizwan Mushtaq joined +M.Tariq Malik's group

### HRM626 Recruitment and selection

7 hours ago
Arooj Shahid liked 乇ﾒ-丂ｲひり3刀ｲ.'s discussion *** My Drawing ***
7 hours ago
Arooj Shahid liked 乇ﾒ-丂ｲひり3刀ｲ.'s discussion *** الوداع اردو ***
7 hours ago
Arooj Shahid liked Miss. Churhail's discussion LOVE YOUR LIFE!!!!!
7 hours ago
7 hours ago
Arooj Shahid liked Omar's discussion Dua
7 hours ago
+!!! ❤️ Shadow Girl❤️!!! liked 乇ﾒ-丂ｲひり3刀ｲ.'s discussion *** الوداع اردو ***
8 hours ago
8 hours ago
8 hours ago
8 hours ago
Saba Shahzadi, waqar, Hammad Syed and 12 more joined Virtual University of Pakistan
8 hours ago
8 hours ago