عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -3
1401214 2nd Semester 1432/1433 Midterm Dr Adnan Gutub Wednesday 4April2012 ـه1433لوادامج12
Name: ID#
Page 1-
- Choose one correct answer from the list below:
The CPU is made of a controller and a data path, the data path contains: 2
Functionally, the computer consists of three parts: 1
These can be used to store or hold data bits or information out of the CPU to be used or processed: 6
These can be used to store or hold data content whenever the machine is reset: 7
These can be used to store data whenever the machine is running, but data is lost whenever machine is off: 8 1. The central processing unit, the memory, and the I/O devices.
2. The ALU and Registers.
3. The CPU, the memory, and the CD-ROM.
4. The CPU, the ALU, and the I/O devices.
5. The memory, CPU, and instructions.
6. The RAM, ROM, Cache.
7. The ROM, Hard-disk, Floppy-disk, CD-ROM 8. The RAM, Cache, Registers
Determine the maximum size of main memory that can be accessed by a processor for a computer containing a 24-bit address bus, and a 22-bit data bus. Give your answer in Kbytes or Mbytes or Gbytes (as needed)?
Max Address =224 = ( 24 )( 220 ) = 16 MBytes
Determine in the figure below the main signals needed for CPU-memory interface showing clearly the bus directions.
24 Address Bus 22 Data Bus
Control
Which of the following names are legal in 8086 assembly language?
(if any name is illegal, then indicate the reason clearly)
WRONG NAME
Illegal: No space allowed within the name
ITS.NOT.CORRECT
Illegal: "." (Dot) is allowed at the beginning only
ILLEGAL$NAME Legal
2error
Illegal: Numbers cannot begin names
CPU Memory
عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -3
1401214 2nd Semester 1432/1433 Midterm Dr Adnan Gutub Wednesday 4April2012 ـه1433لوادامج12
Page 2-
Circle below, whether the following statements are true or false
Instructions using registers for operands' storage execute faster than main memory. True False
Newer programs written for IA32 processors won't run properly on older x86 processors due to their different register sizes. True False
Each logical address maps to a several physical address locations. True False
Memory segments are implemented such that they do not overlap to avoid mixing the different program segments. True False
The physical address 0001Fh can be located in: one segment only two segments four segments
The high and low bytes of the segment registers can be accessed separately. True False
The registers CS and PC(IP) are used to access instructions in the code segment. True False
A memory byte with an offset 0123h from segment number 01EEh has the same physical address as a memory byte with an offset 1333h from the segment number 00FEh. True False
High-level language programs when compiled occupy more memory but execute faster compared to assembly language programs. True False
The purpose of the FLAG register is to hold the next instruction to be executed. True False
Consider a memory location that has the physical address 22F10h.
(a) Compute the offset of this memory location if the segment number is 133Fh.
Offset = 22F10h – 133F0h = FB20h
(b) Compute the segment number of this memory location if the offset is 4440h.
Segment Number = (22F10h – 4440h)/10h = 1EADh
== 22F1h-444h = 1EADh
(c) Determine if this memory location is within the segment 2111h (Hint: The maximum size of any segment is 64KB).
Yes it is within this segment
Because segment 2111h starts at 21110h and ends at 21110h+FFFFh=3110Fh 3110Fh (End of segment 2111h) is more than our physical address 22F10h
Phisical address 22F10h can be within segment 2111h
عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -3
1401214 2nd Semester 1432/1433 Midterm Dr Adnan Gutub Wednesday 4April2012 ـه1433لوادامج12
Page 3-
Suppose the following data are loaded starting from the offset 0000 of the segment:
S DD -5
K DB ‘BC’, 55h, -1, 2 DUP (‘6’, 7)
J EQU 25
L DW 12h, 1234h
Fill the table below in Hexadecimal, showing the variable, and the content of the allocated memory (ASCII code of ‘A’ = 41h, ‘a’ = 61h, ‘0’=30h):
Variable Offset Content Variable Offset Content
0009 07 0013
0008 36 0012
0007 FF 0011
0006 55 0010
0005 43 000F 12
K 0004 42 000E 34
0003 FF 000D 00
0002 FF L 000C 12
0001 FF 000B 07
S 0000 FB 000A 36
Based on the above data labels, the following instructions are not correct , give the reason?
(a) MOV J, 2
Destination cannot be immediate (Cannot write into "J" because it is a constant) (b) MOV AX, K
Different Size Operands (c) MOV L, K
Both Operands cannot be memory and/or Different Size Operands (d) XCHG K, K+1
Both Operands cannot be memory (e) DEC 2
Distention Operand for DEC cannot be constant
عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -3
1401214 2nd Semester 1432/1433 Midterm Dr Adnan Gutub Wednesday 4April2012 ـه1433لوادامج12
Page 4-