next up previous
Next: About this document ...

Practice Midterm Examination 1

Prof. Tak Auyeung

Instructions: You may bring any material that is handwritten or printed prior to the examination to help you. You can also bring a calculator if you think it may help you. However, you can only use the calculator for numerical computations only. You cannot let your calculator compile a program, or to communicate with others.

You, as an individual, are expected to do your own work. This means you cannot seek, receive or otherwise acquire any assistance except clarifications from the professor during an examination. Any communication involving the contents of the subject matter or the examination is considered cheating. Do not initiate or accept such communication, or the result of your examination is automatically voided.

New rules, read this! As of 2003.09.22, I no longer deduct points for wrong answers. Each correct answer is worth one point, each wrong answer is worth zero point, and each unanswered question is also worth zero point. This means you should guess and leave no question unanswered.

As a result, I also need to adjust the letter grade assignment break points. For your individual examinuation, ``A'' means at least 90%, ``B'' means at least 70%, ``C'' means at least 50%, ``D'' means at least 30% and ``F'' means below 30%. The break points for the final grade are now 24.16%, 45.83%, 67.50% and 89.16% as minimums for ``D'', ``C'', ``B'' nad ``A'', respectively.

Please note that this change does not affect your letter grade at all, it is just a number game to make some people feel better about guessing.

Make sure you write down you name on the upper right corner first, otherwise I cannot give points to anonymous students!

The baseline is XX, there are YY questions.

  1. How do we call an architecture that has a zero location for data memory and another zero location for I/O locations?
    1. Von Newmann architecture
    2. Harvard architecture
    3. Memory mapped I/O
    4. I/O mapped I/O
    5. None of the other options
  2. Which of the following instruction sequences loads the constant value 210 into r0? The instruction sequence you select must assemble and runs correctly. Some of these sequences do not assemble.
    1. ldi r0,210
    2. lds r0,210
    3. mov r0,210
    4. ldi r16,210
      mov r0,r16
      
    5. st r0,210
  3. Which instruction may not execute the following instruction after its own completion?
    1. ldi
    2. lds
    3. ld
    4. st
    5. all of the other options execute the following instruction after its own completion
  4. Which of the following instructions configures bit 5 of port B to have an internal pull-up resistor? Assume bit 5 port B is already configured as an input pin.
    1. sbi PORTB,5
    2. cbi PORTB,5
    3. sbi DDRB,5
    4. cbi DDRB,5
    5. sbi PINB,5
  5. Which of the following is true about reading memory?
    1. the ``WRITE enable'' signal is not needed
    2. the data bus is not needed
    3. the address bus is not needed
    4. the chip select is not needed
    5. all other choices are needed to read memory
  6. Given a binary number, $X$, what is the two's complement of the two's complement of this number? That is, what is $\mathrm{C}_2(\mathrm{C}_2(X))$?
    1. $X$
    2. $\mathrm{C}_2(X)$
    3. $X+1$
    4. $X-1$
    5. none of the other options is the answer
  7. Which of the following instructions modifies the value of a register?
    1. sbi
    2. cbi
    3. sbic
    4. sbis
    5. none of the other options modifiies the value of a register
  8. Assume memory location here has a value of 0xfe, memory location here+1 has a value of 0x01. What is the value of register r0 after the following instructions execute?
    ldi  r16,0x00
    mov  r0,r16
    lds  r0,here
    lds  r0,here+1
    
    1. the value of memory location here, 0xfe
    2. the value of memory location here+1, 0x01
    3. 0x00
    4. 0x01fe
    5. the value of memory location 0x01fe
  9. Which of the following hexadecimal (base-16) numbers have zeros for the least significant four digits when represented in binary?
    1. 0xfe
    2. 0x14
    3. 0x02
    4. 0x00
    5. 0x88
  10. What does the following program do? What are the values of the four consecutive bytes starting from location this?
    .dseg
    this:
        .byte 2
    that:
        .byte 2
    .cseg
        ldi  r16,0xff
        ldi  r17,0xee
        sts  this,r16
        sts  this+2,r16
        sts  that,r17
        sts  that+2,r17
    
    1. 0xff 0xee 0xff 0xee
    2. 0xff 0xff 0xee 0xee
    3. 0xee 0xff 0xee 0xff
    4. 0xee 0xee 0xff 0xff
    5. 0xef 0xef 0xfe 0xfe
  11. When the following code exits (at the nop instruction), what do we know about pin 2 of port B? Assume the true state of pin 2 of port B does not change in three instructions after the sbis instruction.
    l1:
       sbis  PINB,2
       rjmp  l1
       nop
    
    1. pin 2 of port B measures high (1)
    2. pin 2 of port B measures low (0)
    3. this loop never exits
    4. this loop exits, but we cannot confirm the state of pin 2 of port B
  12. X, Y and Z are operands (first or second) of which of the following instructions?
    1. ldi
    2. ld
    3. mov
    4. lds
    5. sts



next up previous
Next: About this document ...
Tak Auyeung 2003-09-23