Next: About this document ...
Practice Midterm Examination 1
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.
- How do we call an architecture that has a zero location for
data memory and another zero location for I/O locations?
- Von Newmann architecture
- Harvard architecture
- Memory mapped I/O
- I/O mapped I/O
- None of the other options
- 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.
ldi r0,210
lds r0,210
mov r0,210
ldi r16,210
mov r0,r16
st r0,210
- Which instruction may not execute the following instruction after
its own completion?
- ldi
- lds
- ld
- st
- all of the other options execute the following instruction after
its own completion
- 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.
sbi PORTB,5
cbi PORTB,5
sbi DDRB,5
cbi DDRB,5
sbi PINB,5
- Which of the following is true about reading memory?
- the ``WRITE enable'' signal is not needed
- the data bus is not needed
- the address bus is not needed
- the chip select is not needed
- all other choices are needed to read memory
- Given a binary number,
, what is the two's complement of the
two's complement of this number? That is, what is
?
-
- none of the other options is the answer
- Which of the following instructions modifies the value of a register?
sbi
cbi
sbic
sbis
- none of the other options modifiies the value of a register
- 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
- the value of memory location here, 0xfe
- the value of memory location here+1, 0x01
- 0x00
- 0x01fe
- the value of memory location 0x01fe
- Which of the following hexadecimal (base-16) numbers have zeros
for the least significant four digits when represented in binary?
0xfe
0x14
0x02
0x00
0x88
- 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
0xff 0xee 0xff 0xee
0xff 0xff 0xee 0xee
0xee 0xff 0xee 0xff
0xee 0xee 0xff 0xff
0xef 0xef 0xfe 0xfe
- 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
- pin 2 of port B measures high (1)
- pin 2 of port B measures low (0)
- this loop never exits
- this loop exits, but we cannot confirm the state of pin 2 of
port B
- X, Y and Z are operands (first or
second) of which of the
following instructions?
- ldi
- ld
- mov
- lds
- sts
Next: About this document ...
Tak Auyeung
2003-09-23