Quiz 1A

Q1

(a)

Determine the Starting Address (S.A.) of the Data Segment (DS).

Data Segment (DS) = 0023H

Convert DS into binary:

0000 0000 0010 0 | 0 | 11

Selector = 4

TI = 0 => GDT

RPL = 3

From Descriptor 4 of GDT, we know that Starting Address (S.A.) of DS is 122000H.

**(b) **

Determine the ending address (E.A.) of the data segment.

Ending Address = S.A. + Limit = 122000H + 3FFFH = 125FFFH

©

Determine the size of the data segment in terms of number of bytes.

size of DS = Limit + 1 = 3FFFH + 1H = 4000H bytes

(d)

Determine the size of the data segment in terms of number of words.

1 word = 2 bytes

Therefore number of words = 4000H / 2 = 2000H words

(e)

Determine the ending address of descriptor 11H of GDT.

Given the base address field of GDTR is 220000H.

Note: S.A. of the nthn^{th} GDT descriptor = S.A. of GDT + 8n

220000H + 11H ×\times 8 + 7H = 220088H + 7H = 22008FH

(f)

Determine the total number of descriptors available in the LDT.

Note: Total number of descriptors in the LDT is determined by LDTR.

LDTR content = 0013H (Given)

Change LDTR into 16 bit:

0000 0000 0001 0 | 0 | 11

Selector = 2

TI = 0 => GDT

RPL = 3

Look at the Descriptor 2 In GDT.

LDT size = Limit + 1 = 5FFFH + 1 = 6000H

Note: Each Descriptor size is 8.

Total number of descriptors available:

6000H/8 = 24576/8 = 3072 = C00H descriptors

Q2)

Convert the following single-precision floating point numbers into decimal numbers.

0 10000010 11001000000000000000000 B

Sign Bit (S.) = 0 => Positive

Exponent bits (E.) = 10000010 = 130

Note: The Exp.bias = 127

e = Exponent bits - Exp.bias = 3

Fraction bits = 11001000000000000000000

Mantissa (m) = 21+22+252^{-1} + 2^{-2} + 2^{-5} = 0.78125

Ans:

(1)S×(1+m)×2e=1×1.78125×23=14.25(-1)^S \times (1 + m) \times 2^e = 1 \times 1.78125 \times 2^3 = 14.25

Quiz 1B

(a)

Determine the starting address (S.A.) of the code segment.

Code Segment (CS) = 001DH

Convert CS into binary:

0000 0000 0001 1 | 1 | 01

Selector = 3

TI = 1 => LDT

RPL = 1

From Descriptor 3 of LDT, we know that Starting Address (S.A.) of CS is 444000H.

(b)

Determine the ending address (E.A.) of the code segment.

Ending Address = S.A + Limit = 444000H + 02FFH = 4442FFH

©

Determine the size of the code segment in terms of number of bytes.

Size of CS = S.A. + Limit + 1 = 02FFH + 1H = 300H bytes

(d)

Determine the size of the code segment in terms of number of doublewords.

1 Doubleword = 2 words = 4 bytes

Therefore number of doublewords = 300H/4 = 768/4 = 192 = C0H doublewords

(e)

Determine the ending address of descriptor 12H of GDT.

Given the base address field of GDTR is 200000H.

Note: S.A. of the nthn^{th} GDT descriptor = S.A. of GDT + 8n

200000H + 12H ×\times 8 + 7H = 220060H + 7H = 220067H

(f)

Determine the total number of descriptors available in the LDT.

Note: Total number of descriptors in the LDT is determined by LDTR.

LDTR content = 0008H (Given)

Change LDTR into 16 bit:

0000 0000 0000 1 | 0 | 00

Selector = 1

TI = 0 => GDT

RPL = 0

Look at the Descriptor 1 In GDT.

LDT size = Limit + 1 = 1FFFH + 1 = 2000H

Note: Each Descriptor size is 8.

Total number of descriptors available:

2000H/8 = 8192/8 = 1024 = 400H descriptors

Q2.

Convert the following single-precision floating point numbers into decimal numbers.

1 01111101 10110000000000000000000 B

Sign Bit (S.) = 1 => Negative

Exponent bits (E.) = 01111101 = 125

Note: The Exp.bias = 127

e = Exponent bits - Exp.bias = -2

Fraction bits = 10110000000000000000000

Mantissa (m) = 21+23+242^{-1} + 2^{-3} + 2^{-4} = 0.6875

Ans:

(1)S×(1+m)×2e=1×1.6875×22=0.421875(-1)^S \times (1 + m) \times 2^e = -1 \times 1.6875 \times 2^{-2} = -0.421875