Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS401- ComputerArchitecture and Assembly Language Programming Assignment # 1 Fal

ID: 3614256 • Letter: C

Question

CS401- ComputerArchitecture and Assembly Language Programming

Assignment # 1

Fall 2009

                                                          Total Marks: 20

Due Date

Your assignment must be uploaded before or on17th Oct 2009.

Upload Instructions

Please view the document related to assignment submissionprocess provided to you by the Virtual University to upload theassignment.

Rules for Marking

Kindly note that your assignment will NOT be graded if:

§         It issubmitted after due date

§         The fileyou uploaded does not open

§         The fileyou uploaded is copied from someone else

§         It is inthe format other than .doc

Objective

This assignment has been designed to enable you:

§        To understand how effective address iscalculated

§        To understand how physical memory address iscalculated

Assignment

Question_1:                                                                                                                   [marks: 6]

What is the effective address generated by each of the followinginstruction?

Initially BX=0x0100,label=0x0234, [label]=0x0010, andSI=0x00E1

(Offsets in part a, b and f are in decimal)

Question_2:                                                                                                                   [marks: 14]

Calculate the physical memory address generated by the followingsegment:offset pairs (both are hexadecimal values).

Explanation / Answer

Effective Address Ans1    mov ax, [bx+20] Effective Address = bx+20 Since Offset in a is Decimal so Decimal (20) = Hexadecimal (14) As Bx = 0100           =0100+0014           =0114 mov ax, [label+bx] Similarly Effective Add = [label+bx] Given the Label = 0234 and Bx= 0100           = 0234+0100            =0334 Similarly Effective Add = [label+bx] Given the Label = 0234 and Bx= 0100           = 0234+0100            =0334 mov ax, [bx + si] Effective Add = [bx + si] Since Bx = 0100 and Si    = 00E1               =0100+00E1               =01E1 It can easily be done just follow the ins ntry to solve rest of the parts.. Ans2. Physical memory address 0000:0100 1st we are going to convert 16 bit Segment and 16 bitOffset address 0000:0100 respectively into 20 bit Address. 1st we are going to convert 16 bit Segment and 16 bitOffset address 0000:0100 respectively into 20 bit Address. i.e 20 bit Segment Address = 00000      20 bit Offset Address = 00100 Now calculating the physical Address    20 bit physical address in decimal is = 0000 00000001 0000 0000    20 bit physical address in hexadecimal = 00000 +00100 = 00100 0010:0000 Applying the same step of converting 16 bit into 20 bitaddresses we have 20 bit Segment Address = 00010 20 bit Offset Address = 00000   Calculating physical address by adding the both 20 bit physical address in hexadecimal is =00010+00000=00010 20 bit physical address in Decimal = 0000 0000 0000 00010000 DAD1:2345 16 bit Segment Address= (Converting from Hexadecimal to 16 bit binary form)DAD1 =1101 1010 1101 0001 Similarly 16 bit Offset Address = (Converting from Decimal to16 bit binary form)2345 = 0010 0011 0100 0101 Now converting Segment address from 16 to 20 bit form = 0DAD1=01101 1010 1101 001 Converting Offset Address from 16 to 29 bit form = 02345= 00010 0011 0100 0101 20 bit physical address in hexadecimal = 0DAD1+02345 =1ED04 20 bit physical address in decimal = 01101 1111 11010111 Try to solve rest of the parts n follow theinstructions.