• Tidak ada hasil yang ditemukan

CPU Memory

N/A
N/A
Protected

Academic year: 2024

Membagikan "CPU Memory"

Copied!
4
0
0

Teks penuh

(1)

عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -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

(2)

عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -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)

عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -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

(4)

عيمجتلا ةغلب ةجمربلاو تابساحلا ميظنت -3

1401214 2nd Semester 1432/1433 Midterm Dr Adnan Gutub Wednesday 4April2012 ـه1433لوادامج12

Page 4-

 Determine the (hexadecimal) content of AX, BX, CX, DX after executing the program:

MOV AX, 1234h ;AX = 1234h

MOV CX, 11h ;CX = 0011h

MOV BX, 5 ;BX = 0005h

DEC CX ;CX = 0010h

INC BX ;BX = 0006h

ADD AX, CX ;AX = AX+CX = 1234h+0010h = 1244h

MOV DL, 99h ;DX= ??99h

ADD CX, BX ;CX=CX+BX=0010h+0006h=0016h

MOV DH, DL ;DH=DL = 99h  DX=9999h

DEC CX ; CX = 0015h

MOV CL, 00h ; CL = 00h  CX = 0000h ---

AX = 1244h BX= 0006h CX= 0000h

DX= 9999h

---

 Assume AL is a variable, determine the function implemented on AL by the following code:

MOV BL, AL ;BL=AL

ADD BL, AL ;BL=BL+AL=AL+AL=2AL

MOV AL, BL ;AL=BL=2AL

ADD AL, BL ;AL=AL+BL=4AL

---

AL= 4AL

---

 What is the content of register AX after executing the following code instructions:

MOV BX, 3 ;BX = 0003h MOV CX, 10 ;CX=10 = 000Ah

ADD CX, BX ;CX = CX+BX = 0003h+000Ah = 000Dh MOV BX, 99h ;BX=0099h

MOV AX, CX ;AX=CX=000Dh

MOV AL, 11 ;AL=0Bh AX=000Bh

MOV CX, AX ;CX=AX = 000Bh

MOV AH, AL ;AH=AL=0Bh  AX=0B0Bh

---

AX= 0B0Bh

Referensi

Dokumen terkait