Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Example questions for COMP 273 Final Exam, April 2016

See solutions on last page.  If you are unsure on certain questions, then I suggest you ask friends or post questions on discussion board. Help each other out, please.

1.  How many bits are in a byte ?

(a) 0

(b)  1

(c) 2

(d) 8

(e)  32

2. which of the following is correct?

(a)  unsigned integers in MIPS use 8 bits

(b)  signed integers in MIPS use 32 bits

(c)  single precision loats use 16 bits

(d)  double precision loats use 32 bits

(e)  none of the above is correct

3. what is the signiicand in the IEEE single precision loat representation of -424.875 ?

(a)  01010111000111111111111

(b)  10101000111000000000000

(c)  01010111001000000000000

(d)  11100000000000000000000

(e)  none of the above

4. what is the coding of the exponent (see previous question) ?

(a)  00000111

(b)  10001000

(c)  10000111

(d)  010000001100

(e)  00000000000000000000111

5. write the following as a sum of products, where 台 is XOR.

(A + B) . (A C)

(a) A . B . C

(b) A . B . C + A . B . C + A . B . C

(c) A . B . C + A . B . C

(d) A . B . C + A . B . C

(e)  none of the above

6.  Convert the pseudoinstruction

not     $so,  $s1

into a real MIPS instruction.

(a) and    $so,  $s1,  oxffff

(b) xor    $so,  $s1,  $o

(c) or    $so,  $s1,  $1

(d) nor    $so,  $s1,  $o

(e)  none of the above

7.  Do loating point arithmetic instructions have immediate versions (I format) ?

(a) yes, for example add.s.i.

(b)  No, because MIPS has only a small number of instructions and the designers decided it wasn,t useful to have such an instruction (RISC).

(c)  No, because immediate values in MIPS are 16 bit integers, not loats.

(d) yes, but the loats must be represented with 16 bits only.

(e)  None of the above.

consider a computer with a MIPS processor, a page size of 29  bytes, a TLB with 210  entries, a main memory (RAM) with 230  bytes, and an instruction cache with 215  blocks having 4 words each.

8.  How many bits are used for each virtual page number?

(a) 4

(b)  10

(c)  22

(d)  23

(e)  32

9. which bits (from 0 to 31) of the virtual address are used for the TLB index ?

(a)  bits 10 to 21

(b)  bits 0 to 11

(c)  bits 9 to 18

(d)  bits 10 to 15

(e)  bits 25 to 31

10.  How many bits are used for each physical page number (for a page in RAM)?

(a) 9

(b)  19

(c)  20

(d)  21

(e)  30

11.  How many bits are in the tag ield of each line of the cache?

(a)  11

(b)  12

(c)  15

(d)  32

(e)  none of the above

12. which of the following is not an R format instruction ?

(a)  Sub

(b) Sll

(c) addiu

(d) add. S

(e) Slt

13. which of these pipeline stages uses combinational circuits onlY ?

(a) ID

(b) ALU

(c) MEM

(d) wB

(e)  none of the above

14. [choice (c) modiied April 25, namely the underlined part was added.] consider the following MIPS code.

mov. S         $f4,    $fo

cvt.W. S     $f4,    $f4

mfc1           $to,    $f4

which of the following statements is correct, after the instructions have been executed?

(a)  Registers $fo and $to represent the same numerical value (as interpreted bY an instruction that might follows them).

(b)  BY  examining  register  $to, but without looking at the MIPS code above,  one can infer which number is represented.

(c)  BY  examining  register  $fo, but without looking at the MIPS code above,  one can infer which number is represented.

(d) The value stored in $to is a single precision loat.

(e)  None of the above.

15. which of the following statements is correct?

(a) To deine a function in MIpS, one can use either j越l or j.

(b) Every function call must terminate with a jr instruction.

(c)  If a function is both a parent and child, then it should store its save registers on the stack before calling one of its children.

(d)  Every function needs to use the stack.

(e)  None of the above are correct.

16. which of the following is not correct?

(a)  A ‘write through, cache ensures that any (valid) entries in the data cache are equal to their corresponding in main memory.

(b)  A ,write through, cache does not need a dirty bit.

(c)  The main advantage of a‘write back, cache is that it delays updating values in main memory until it is necessary.

(d)  A‘process id, ield is necessary for both data and instruction caches.

(e)  All of the above are correct.

17. which of the following is not correct?

(a)  Cpu,s always uses polling to handle keyboard inputs.

(b) A keyboard can use interrupts without signiicantly hurting  Cpu performance because keystrokes are typed relatively slowly.

(c)  DMA is inappropriate for keyboards because there is no need to put entered keys directly into RAM.

(d)  printers are output devices and hence do not need to write from their local memory to the computer,s main memory.

(e)  Graphics cards are specialized processors for converting commands such as drawing a shape into pixel images.

18.  which of the items in the following sequence is out of order, when the kernel handles an interrupt? Note there may be steps missing.

(a) Disable all interrupts.

(b)  save all registers into the kernel data region.

(c)  check the interrupt enable bit(s) of the status register.

(d) Enable all higher priority interrupts.

(e)  service the interrupt.

19.  which one of the following is out of order in an asynchronous handshaking scheme?

Hints: Determine whether it is receiver or sender initiated. Again, steps may be missing.

(a)  sender writes on data lines.

(b)  sender sets the data ready control to 1.

(c)  Receiver writes on address and control lines.

(d)  Receiver reads the data lines.

(e)  sender sets the data ready control to 0.

20. which, if any, of the statements (a)-(d) about serial buses is not correct?

(a)  start  and  stop  bits  are  used  to time the  sending  and  receiving of data  according to  a handshaking protocol.

(b) when a UsB device is plugged into a computer for theirst time, the UsB controller requests information from the device and passes that information to the kernel which then looks up the driver on the hard disk.

(c) An UART is used to convert serial signals to parallel signals or vice-versa.

(d) A parity bit is used to indicate that an error in a transmitted value has occured. (e)  All of the above statements are correct.

Answers

1.  d

2. b

3. b

4. c

5.  a

6. d

7. c

8. d

9. c

10.  d

11. a

12.  c

13.  b

14.  e

(b is incorrect because we don,t know if the number is signed or unsigned.  c is incorrect with the new wording because we don,t know just by looking at $f0 whether it represents a single precision number, or whether it is one of two registers, $f0 and $f1, that together represent a double precision. )

15.  b

16.  d

17. a

18.  c (which should come before a)

19.  c (which should come before a)

20.  a