Professional Documents
Culture Documents
------------------------------------------------------------------------------------------------------------------------------------------
Question No 1
Solution:
Secondary
Program Data
Storage
Storage Storage
Memory
Memory Memory
Input Output
Unit MPU Unit
Part (b) Solution:
The total memory is of 1 Mbyte. Starting address of the memory is 00000H, and the ending
address is FFFFFH.
Part (c) Solution:
The microprocessor will make the physical address of the memory by the combination of CS
with IP or DS with SI. The address will be formed by the addition of segment with pointer:
CS=1000(0) and IP=100. so the memory value would be 10100.
Question No 2
Consider 1Mbyte Memory:
a) Specify the No of Address Bits to address this memory.
b) Specify the address range of memory in terms of Hex digits. i.e. example (00 H to XX H).
c) Segment the Memory of 1M Kbyte into 128 Kbyte. Indicate the total number of segments. Specify
the address range of 1st segment and the last segment in Hex.
Solution:
Part (a) solution
1Mbyte=1K*1K=210*210=220 (which means 20 number of bits).
Part (b) Solution
As indicated in Q1 range of memory would be from 00000H to FFFFFH.
Part (c) Solution
1Mbyte/128Kbyte=1K*1K/128*1K=210/27=23=8 segments.
The first memory address would be 00000H to 1FFFFH. The last memory address would be
E0000H to FFFFFH.
Quiz 2
Faculty of Engineering
Semester Spring 2017 Mid-Term Examination
Question No 1
What is memory direct addressing mode and based indexed addressing mode. Explain it with example.
Solution:
The memory direct addressing is similar to immediate addressing as the information is encoded
directly to the instruction, for Example:
MOV AX, [1234H]
While combining the base addressing and indexed addressing, we get a powerful mode, based-
indexed addressing mode. We use base and index registers to access element of array, for
example:
MOV AH, [BX] [SI] + 1234H
Question No 2
Consider AL=7FH and BL=22H. Execute the command SUB AL,BL. Compute the result and update the
status of CF,AF,SF,ZF and PF.
Solution:
AL=0111 1111
BL=0010 0010
After Subtraction AL=0101 1101
AF=0
CF=0
SF=0
ZF=0
PF also equals to 0.