php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1



CS501 Advance Computer Architecture Assignment 1 solution Fall 3rd November 2012





Q1. Write an SRC assembly language program to evaluate the following expression:

f = 4(k+32) + 16(g-h)

Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction

Part b: 5 marks

Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.

.ORG 300 ; start the next line at address 300

k: .DW 1 ;

g: .DW 1 ;

h: .DW 1 ;

f: .DW 1 ;

;

.ORG 400 ; start the code at address 400

The code starts at address 400 and each instruction takes 16-bits in the memory.

Solution:

Write an SRC assembly language program to evaluate the following expression:

f = 4(k+32) + 16(g-h)

Note that your code should not change the source operands and also keep in mind that the SRC does not have a multiply instruction

Solution

ld R1,g

ld R3,h

sub R5,R3,R1

shl R4,R5,4

addi R7,R6,32

shl R8,R7,2

add R9,R8,R4

st R9,f

Part b: 5 marks

Draw memory map table for the above program using the following scenario and assume that SRC uses 16-bit memory in this case.



.ORG 300 ; start the next line at address 300

k: .DW 1 ;

g: .DW 1 ;

h: .DW 1 ;

f: .DW 1 ;

;



.ORG 400 ; start the code at address 400

The code starts at address 400 and each instruction takes 16-bits in the memory.



Solution

Memory Map

Memory Address
Memory Contents

300
unknown

304
unknown

308
unknown

312
unknown

…..


400
ld R1,g

402
ld R3,h

404
sub R4,R3,R1

406
shl R4,R5,4

408
addi R7,R6,32

410
shl R8,R7,2

412
add R9,R8,R4

414
st R9f




Attached Files
.doc   Fall2012_CS501_1.doc (Size: 29 KB / Downloads: 89)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VU Fall 2026 Assignments: How to Write Solutions That Get Full Marks (Complete Guide) admin 0 29 11-03-2026, 05:22 PM
Last Post: admin
  SEO in Simple Words: How a VU Student Can Write a Clearer Assignment or Blog Post admin 0 68 11-01-2026, 05:11 AM
Last Post: admin
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,321 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,159 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,693 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,359 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,947 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,173 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,977 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,625 05-20-2015, 01:34 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support