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.

Spring%202013_CS501_1.doc

Question:

Dear Student, you are given typical view of selected Memory and Processor registers in Figure 1. In memory, you can see three instruction codes in upper area, while two data values are given in lower part. These instruction codes represent an addition operation.

Addition Operation:  You are required to perform an addition operation in which you have to add the contents of memory word at address 781 to the contents of memory word at 782. After performing this addition, result should be stored at 782. Your task is to perform step-by-step execution of these three instructions and show registers configuration at each step.

For your understanding, Step-1 of this sequence of execution is shown in Figure 1.  In this Figure, you can see PC=200 which indicate that instruction stored at address 200 is in execution and the same instruction (1781) is loaded in IR register.

 

Memory

 

CPU register

200

1 7 8 1

200

PC

201

5 7 8 2

 

AC

202

2 7 8 2

1 7 8 1

IR

203

 

 

 

:

 

7 8 1

0 0 0 4

 

7 8 2

0 0 0 2

(STEP 1)

 

 

 

 

 

 

Figure-1

Where,

AC is Accumulator Register.

PC is Program Counter.

IR is Instruction Register.

 

Submission:

You need to complete execution of the three given instructions and provide step wise registers and memory configuration. Please submit your solution in MS Word format by completing/filling the provided steps on page-4.

 

Hint Regarding Three Instructions: 

  • First instruction 1781 means Load value stored at address 781 into accumulator register.
  • Second instruction 5782 means perform addition of value stored at address 781 with value in accumulator register and store the result in accumulator register.
  • Third instruction 2782 means store value of accumulator register at address 782.

Views: 6692

Replies to This Discussion

Mj to kch smj ni aa ri is ki

plz mj koi question smjhaooo k Nasm mein in k ansrs nikal kr likhny hn?

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

 

Assignment No. 01

Q1.

Part A: 15 marks

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

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

Solution:

ld R1, k

addi R2, R1, 32

shl R3, R2, 2 

ld R5, g         

ld R6, h

sub R7, R5,R6          

shl R4, R7, 4 

add R8, R4,R3                      

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

Address 


Memory

Contents

300 
unknown

302 
unknown

304 
unknown

306 
unknown


-

400 
ld R1, g

402 
ld R2, h

404 
sub R3, R1,R2

406 
shl R4, R3, 4

408 
ld R5, k

410 
addi R6, R5, 32

412 
shl R7, R6, 2

414 
add R8, R4,R7

416 
st R9, f  

yaaar Admin bhai pakar k old  assignment mat load kia  karo current concept  k bary ma koi idea do.please.

Spring 2013 ma  jo advance asm ki assignment ha us k last waly hisay ma koi  help kar do .. jaha result ko store kar na ha...

jis location py store kar na ha us location py already kuch data mujoood ha..so kesy......?

den Adnan bro kb tk ap upload kr rahay hain??

Any one plz share idea???????

Instructor's reply to a MDB question
Addition Operation:  You are required to perform an addition operation in which you have to add the contents of memory word at address 781 to the contents of memory word at 782. After performing this addition, result should be stored at 782.
In HINT:::::Second instruction 5782 means perform addition of value stored at address 781 with value in accumulator register and store the result in accumulator register.
     Sir please remove the confusion b/w two Sentences which is true according to the Assignment solution. 


Instructor's Reply:
Dear student,
you are required to add contents of memory words of 781 and 782. The instruction 5782 means perform addition of value stored at address 781 with value in accumulator register and store the result in 782 memory address.
For Example 3 + 2 = 5.
5 should be store in 782 memory address.

Assignment No. 01
Semester: Spring 2013

CS501: Advanced Computer Architecture

 

 

Total Marks: 20

Due Date:  24-04-13

 

Instructions

Please read the following instructions carefully before assignment submission.

It should be clear that your assignment will not get any credit if:

 

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • The assignment is found to be copied from Internet.
  • The assignment is found to be copied from other student.
  • The assignment submitted is not according to required file format (.doc).

Objective

The objective of this assignment is:

  • To assess your overall understanding of Computer Architecture and Organization
  • To assess your overall understanding of Computer Instructions
  • To assess your overall understanding of Fetch, Decode and Execute Cycle

Note:

 

  • The assignment should be in .doc format.
  • Assignment .01 covers lectures from 1 to 5. You are required to watch first five cs501 video lectures as well as study them from handouts to attempt this assignment.  You can also consult reference books for help.
  • Students are advised to submit their assignment as early as possible in order to avoid any sort of inconvenience like Load shedding etc.

 

Assignment

 

 

Question:

Dear Student, you are given typical view of selected Memory and Processor registers in Figure 1. In memory, you can see three instruction codes in upper area, while two data values are given in lower part. These instruction codes represent an addition operation.

Addition Operation:  You are required to perform an addition operation in which you have to add the contents of memory word at address 781 to the contents of memory word at 782. After performing this addition, result should be stored at 782. Your task is to perform step-by-step execution of these three instructions and show registers configuration at each step.

For your understanding, Step-1 of this sequence of execution is shown in Figure 1.  In this Figure, you can see PC=200 which indicate that instruction stored at address 200 is in execution and the same instruction (1781) is loaded in IR register.

 

Memory

 

CPU register

200

1 7 8 1

200

PC

201

5 7 8 2

 

AC

202

2 7 8 2

1 7 8 1

IR

203

 

 

 

:

 

7 8 1

0 0 0 4

 

7 8 2

0 0 0 2

(STEP 1)

 

 

 

 

 

 

Figure-1

Where,

AC is Accumulator Register.

PC is Program Counter.

IR is Instruction Register.

 

Submission:

You need to complete execution of the three given instructions and provide step wise registers and memory configuration. Please submit your solution in MS Word format by completing/filling the provided steps on page-4.

 

Hint Regarding Three Instructions: 

  • First instruction 1781 means Load value stored at address 781 into accumulator register.
  • Second instruction 5782 means perform addition of value stored at address 781 with value in accumulator register and store the result in accumulator register.
  • Third instruction 2782 means store value of accumulator register at address 782.

 

Answer:

 

Memory

 

CPU register

Memory

 

CPU register

200

1 7 8 1

PC

200

1 7 8 1

 

PC

201

5 7 8 2

 

AC

201

5 7 8 2

 

AC

202

2 7 8 2

IR

202

2 7 8 2

 

IR

203

 

 

203

 

 

 

:

 

 

:

 

7 8 1

0 0 0 4

 

7 8 1

0 0 0 4

 

7 8 2

0 0 0 2

(STEP 2)

 

7 8 2

0 0 0 2

(STEP 3)

 

 

 

 

 

 

 

 

 

 

 

 

Memory

 

CPU register

Memory

 

CPU register

200

1 7 8 1

 

PC

200

1 7 8 1

 

PC

201

5 7 8 2

 

AC

201

5 7 8 2

 

AC

202

2 7 8 2

 

IR

202

2 7 8 2

 

IR

203

 

 

203

 

 

 

:

 

 

:

 

7 8 1

0 0 0 4

 

7 8 1

0 0 0 4

 

7 8 2

0 0 0 2

(STEP 4)

 

7 8 2

0 0 0 2

(STEP 5)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory

 

CPU register

200

1 7 8 1

PC

201

5 7 8 2

 

AC

202

2 7 8 2

IR

203

 

 

 

:

 

7 8 1

0 0 0 4

 

7 8 2

0 0 0 2

(STEP 6)

 

ok aap bta do..k jb  addition ho jae gi then  result position 782 position py store karna ha. OK

ab position 782 py tu pehly sy data mojood ha .Now tell k data store kesy ho ga.

then pori assignment step bu step bta sako ga....

 RANA USMAN  782 py jo hy us ko result k sath up date krna hy and result will be 0006 as 0002 + 0004  

 Or (0000 0000 0000 0010  + 0000 0000 0000 0100) = (0000 0000 0000 0110)

Sister u r right . but there is a problem that ""Second instruction 5782 means perform addition of value stored at address 781 with value in accumulator register and store the result in accumulator register" this statment is wring because 5782 maeans 5 is not the code for addition will we consider this as it is or to change with original thats is different one please if some one can clarify.


RSS

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

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