Final Exam Solutions - Computer Organization I | ECE 267, Exams of Computer Architecture and Organization

Material Type: Exam; Class: Computer Organization I; Subject: Electrical and Computer Engr; University: University of Illinois - Chicago; Term: Spring 2002;

Typology: Exams

2011/2012

Uploaded on 05/18/2012

koofers-user-90c
koofers-user-90c ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
๏ฃฉ2002 University of Illinois at Chicago ECE 267 V. Goncharoff .
ECE
U
UI
IC
C
D
De
ep
pa
ar
rt
tm
me
en
nt
t
o
of
f
E
El
le
ec
ct
tr
ri
ic
ca
al
l
a
an
nd
d
C
Co
om
mp
pu
ut
te
er
r
E
En
ng
gi
in
ne
ee
er
ri
in
ng
g
ECE 267 โˆ’ Computer Organization and Programming
Spring 2002 Semester
Final Examination Solutions
Instructor: V. Goncharoff
Note: Intel 16-bit addressing mode was assumed throughout; "Intel 8086" refers to the
older architecture when 32-bit registers were not yet present.
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Final Exam Solutions - Computer Organization I | ECE 267 and more Exams Computer Architecture and Organization in PDF only on Docsity!

๏ฃฉ2002 University of Illinois at Chicago ECE 267 V. Goncharoff.

ECE

UIUICC

De Deppaarrttmmeenntt ooff ElEleeccttrriiccaall aanndd CCoommppuutteerr EnEnggiinneeeerriinngg

ECE 267 โˆ’ Computer Organization and Programming

Spring 2002 Semester

Final Examination Solutions

Instructor: V. Goncharoff

Note: Intel 16-bit addressing mode was assumed throughout; "Intel 8086" refers to the older architecture when 32-bit registers were not yet present.

Each question was designed to have only one correct answer, so choose only one answer per question! If you choose more than one answer the problem will receive zero credit.

  1. What is (5.3125) 10 converted into radix 2?

a) (101.1101) (^2) b) (101.1010) (^2) c) (101.0101) (^2) d) (101.1011) (^2) e) none of the above

  1. What is (A2.5) 16 converted into radix 10?

a) (162.3125) (^10) b) (102. 5) (^10) c) (102.3125) (^10) d) (162.5) (^10) e) none of the above

  1. What is (โˆ’13) 10 written in 2's complement 8-bit binary code? Give the answer in hex notation.

a) 0Dh b) F3h c) F2h d) 8Dh e) none of the above

  1. What is ( 255 ) 10 written in 2's complement 16-bit binary code? Give the answer in hex notation.

a) 80FFh b) FFFFh c) FF01h d) 00FFh e) none of the above

  1. What is (34) 10 written in unsigned 8-bit binary code? Give the answer in hex notation.

a) 34h b) 22h c) DEh d) 24h e) none of the above

  1. What do the following Intel 8086 assembly language instructions accomplish? Assume BL originally contains an ASCII character code.

cmp bl,โ€™aโ€™ jb exit cmp bl,โ€™zโ€™ ja exit sub bl,โ€™aโ€™ add bl,โ€™Aโ€™ exit:

a) BL โ† BL โˆ’ 32 b) if the character is uppercase, then it is made lowercase c) if the character is lowercase, then it is capitalized d) BL โ† BL โˆ’ 64 e) none of the above

  1. What do the following Intel 8086 assembly language instructions accomplish? Assume BL originally contains an ASCII character code.

cmp bl, jb skip cmp bl, ja skip and bl,0Fh skip:

a) BL โ† BL โˆ’ 64 b) if the character is not alphabetic (not 'a'-'z' or 'A'-'Z'), then BL โ† BL โˆ’ '0' c) BL โ† BL โˆ’ 240 d) if the character is in the range '0'-'9', then BL โ† BL โˆ’ 48

  1. Which Intel 8086 16-bit registers may be used to store the offset part of the address in indirect memory addressing?

a) AX, BX, CX b) BX, DS, ES c) BX, SI, DI d) SI, DI, DS

  1. Which of the four Intel 8086 general-purpose registers must be used as source and/or destination operands during 16-bit integer multiplication and division?

a) AX, BX b) AX, DX c) AX, BX, DX d) AX, BX, CX

  1. Which of the four Intel 8086 general-purpose registers serves as a loop counter?

a) AX b) BX c) CX d) DX

  1. What do the following Intel 8087 floating-point coprocessor instructions accomplish?

finit fld float fld float fld float fmul fdiv fstp float

a) float3 โ† float b) float3 โ† (float1) 2 รท float c) float3 โ† float d) float3 โ† float2 รท (float1) 2

  1. What are the contents of register AX after the following instructions execute? Give the answer in hex notation.

mov ax, 2123h or ax, 0C344h

a) E367h b) C556h c) 2D37h d) E467h e) none of the above

  1. What are the contents of register BX after the following 80386 instructions execute? Give the answer in hex notation.

mov bx, 1234h ror bx, 4

a) 2341h b) 4123h c) 1234h d) 3412h e) none of the above

  1. What are the contents of register BX after the following instructions execute? Give the answer in hex notation.

mov bx, 00FFh sar bx, 8

a) 8800h b) FF00h c) 00FFh d) 0000h e) none of the above

  1. Assume that register EAX stores X , a single-precision floating point number in IEEE format. The following instructions are then executed:

xor eax, 80000000h and eax, 80000000h

What result is now in EAX (in IEEE format)?

a) X b) X c) โˆ’ X d) โˆ’ X e) none of the above (result = 0)

  1. Assuming that no overflow occurs, what arithmetic operation is performed by these five 80386 instructions?

; assume ax stores some integer

add ax,ax mov cx,ax add ax,cx shl ax, add ax,cx

; now what does ax store in terms ; of its original value?

a) AX โ† AX ร— 7 b) AX โ† AX ร— 13 c) AX โ† AX ร— 18 d) AX โ† AX ร— 10 e) none of the above

  1. What does the instruction int 21h (DOS software interrupt) below accomplish?

.data A1 db 10d A2 db? A3 db 64000 dup(?) A4 db 'vg.dat', .code

mov ah,0Ah mov dx,offset A int 21h

a) reads 64000 bytes from file 'vg.dat' into memory b) reads a string of 10 characters (including Enter key code) into memory c) displays the string 'vg.dat' d) displays the character whose ASCII code is 10d

  1. What is the largest possible data array size in the small memory model?

a) 2 8 bytes b) 2^20 bytes c) 2 32 bytes d) 2^16 bytes e) none of the above

  1. For the 8086 processor in "real" addressing mode, how many different memory addresses are there?

a) 2 8 b) 2^16 c) 2 32 d) 2^20 e) none of the above

  1. For the 8086 processor in "real" addressing mode, which of the following addresses refers to the same byte in memory as does address E000:1234?

a) F000: b) 1234:E c) E111: d) F234: e) none of the above

  1. Given: register EAX initially stores an IEEE 32-bit code for a floating point number. Which of the following 80386 instructions moves the E field into register AH?

a) and eax,7F800000h b) rcl eax, c) shr eax, d) ror eax, e) none of the above

  1. What does the instruction rep movsb below accomplish? Assume image_buffer has already been initialized to store 64000 bytes of image data (200 rows (^) ร— 320 columns) in row-wise format.

mov ax,seg image_buffer mov ds,ax mov es,ax

mov di,offset image_buffer mov si,offset image_buffer+

cld mov cx,63680 ;63680 = 199 * 320 rep movsb

a) copies the contents of row0 to every other row in the image b) adds the value 320 to each pixel in rows 0- c) shifts the image down by one row (row0 โ† row1, etc.); row199 doesn't change d) the value 320 is copied into the first 63680 bytes of the image

  1. Which of the following instructions is bad programming practice?

a) cmp dl,'0' b) mov ds,ax c) mov al,[bx+1] d) cmp [bx],

  1. Which of the following instructions simultaneously changes both ds and bx register contents?

a) (^) mov bx,[ds:bx] b) (^) mov bx,offset string c) (^) inc word ptr [ds:bx] d) lds bx,string2_address

  1. When using procedures, it is permitted but bad programming practice to:

a) label instructions in the procedure using labels not declared as "local" b) have more than one ret statement in the body of a procedure c) use the jmp instruction to exit a procedure d) push or pop registers within a procedure

  1. When using macros, it is permitted but bad programming practice to:

a) label instructions in the macro using labels not declared as "local" b) have more than one ret statement in the body of a macro c) use the jmp instruction to exit a macro d) push or pop registers within a macro