Pages

Sponsored Links

Wednesday 13 November 2013

CS401- Computer Architecture and Assembly Language Programming Solution of Assignment no.1 November 2013


Computer Architecture and Assembly Language Programming Assignment#1(NonGraded) 


Total marks = 20
Deadline Date  November 20, 2013





Q 1: Calculate physical address for the following segment-offset pairs:

a.      0FF1:1234
b.      1568:A23A
Marks [5+5]

Q 2: Write an assembly language code to calculate arithmetic mean of the following Array elements and store result in DX.

Array = 1, 2, 3, 4, 5, 4, 3, 2, 1

Also attach snapshot of AFD window showing the arithmetic mean in DX register.

In order to calculate the physical address of some location in the memory, we must have segment:offset pair.  Now suppose that segment:offset pair is 1234:5678. It means we have a Segment base address CS=0×1234 and an Offset Address say IP=0×5678. In order to generate 20-bits address of the two CS and IP registers, the following technique is used:
1. We put a zero to the right of CS i.e. CS=0×12340. To put a 0 to the right, we multiply the segment value with hexadecimal value 0×10.
2. We put a zero to the left of IP i.e. IP =0×05678.
3. We Add the two new values which is 0×12340+0×05678 = 0x179B8 (a 20-bit value) which is the physical address for given segment:offset pair

Calculate physical address for the following segment-offset pairs
a. 0FF1:1234
segment : offset pair = 0FF1 : 1234
Segment = 0FF1
offset = 1234
physical Address = segment * 0×10 + offset
= 0FF1 * 0×10 + 1234
= 0FF10 + 1234
= 11144

segment : offset pair = 1568 : A23A
Segment = 1568
offset = A23A
physical Address = segment * 0×10 + offset
= 1568 * 0×10 + A23A
= 15680 + A23A
physical address = 1F8bA













Best of luck!

No comments:

Post a Comment