|
ECEN 3213 Fall 2004 Exam 1 7 October 2004 |
Name______Solution_______ |
The questions in this exam refer to the 68HC11A8 single chip, unless otherwise noted in the question. This is an OPEN Book Open notes exam. You may use a calculator, but not a PDA, a cell phone, or a laptop computer. Read the instructions carefully before completing the exam. All answers must be shown on these pages – no attached pages will be graded.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2b Bus name: ___Data__________ has #bits = __8____
2c Bus name: ____Control_________ has #bits = ___Varies____
3a Bus name: ___Address_________ has # bits =___10____
3b Bus name: ____Data_________ has #bits = ____32___
3c Bus name: __Control_____ has #bits = ____Varies___
- Initialize Register A to $00 and Register B to $97
- Input a Byte on PORT E
- Output the low order 6 bits of the Byte on PORT B with 0s in the high order bits.
- Continue reading and processing until the input is $F0.
- Stop when the input is $F011
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5 (3pts) A flow chart, a memory Map, and a block diagram are three types of software documentation diagrams. Describe how a state diagram helps when writing assembly programs with IO handshaking, and draw an example state diagram for two types of I/O handshaking.
A State diagram shows what needs to be remembered (the
state) and the input contions for making decisions.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
The following True / False questions are worth 2 points each. Circle T for True or F for False for your answer.
T 6 There is an assembly code instruction for every machine code instruction.
F 7. There is a machine code instruction for each assembly level instruction.
T 8. Memory Maps and Block Diagrams are to be kept even after the program is running correctly.
T 9. There is a memory address for the start of every machine code instruction.
T 10. Extended addressing requires memory for correct operation.
T 11. Indexed Addressing can use the X or Y registers for the index.
T 12. Every Assembly instruction, except comments, can have a label field.
F 13. No Assembly code instruction requires a label filed.
T 14. An entire Assembly program could be written without using any comments.
F 15. Inherent addressing always uses RAM as an operand.
T 16. Inherent addressing can use the B register as an operand.
T 17. Some 6811 machine code instructions require 3 bytes of memory.
F 18. Machine code for the 6811 always has three bytes per instruction.
F 19. Assembly code comments are bad because they slow down execution of the machine code.
T 20 A problem well stated is a problem half solved.
21. (4 pts) fill in the missing unsigned values (including all zeros) for the following table (0.25 pt each):
|
Decimal |
Hexadecimal |
Binary |
||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
$ 0 |
0 |
7 |
F |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
$ 0 |
0 |
8 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1026 |
$ 0 |
4 |
0 |
2 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
$ 0 |
0 |
A |
A |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
$ 0 |
0 |
F |
F |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4096 |
$1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65535 |
$ F |
F |
F |
F |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
$0 |
0 |
6 |
3 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
$0 |
0 |
9 |
9 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
22. (5 pts) List the five types of instructions discussed in this class (one example type is data manipulation) and describe each type.
Data Manipulation
(ALU) – operates on the data,
such as add, subtract, AND, OR, or compare.
Memory Access – load or store data between memory and
CPU.
Flow Control – determine which instruction to execute
next.
I/O – input and output; Data from digital processor to
external world.
Other /Software – instructions to the assembler (such as
ORG) or to humans (such as comments).
The following multiple-choice questions will be scored as 2 pts for each correct
answer, -1 for an incorrect answer and 0 for unanswered questions.
23. For a Block diagram, what shape is used to represent a decision? ___D__
a. Diamond b. rectangle c. trapezoid d. None of these choices
24. For a Block diagram, what shape is used to represent a stopping point? __D___
a. Diamond b. rectangle c. trapezoid d. None of these choices
25. What does PC stand for in the PC register? __F____
a. Politically Correct
b. Personal Computer
c. Program Code
d. Stack Pointer
e. Progress Counter
f.
None of these choices
26. The type of I/O we have studied and used the most in this class is: B
a. Fixed Time b. Busy Waiting c. Interrupt d. DMA e. None of these
27. Also characteristic of the type of I/O we have studied and used the most in this class: A
a. Memory Mapped b. Buffered c. Serial d. None of these e. All three of a, b, & c
28. How many output ports does the 68HC11A8 have? __C____
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
29. What does it mean when the PC register has the value 60735? __E___
a. The next instruction to be fetched is in memory location 60735.
b. The value of the operand of the next instruction is 60735.
c. The current instruction being fetched is at memory location 60735.
d. The last instruction fetched was from memory location 60735.
e.
It could be any of a, c, or d (but not b) depending
upon what phase of the instruction is occurring (fetch, decode, execute,
load/store).
f. This is a trick question because a 16-bit PC register cannot hold a value of 60735.
30. How much RAM does the 68HC11a8 have? __A____
a.
Less than 257 bytes
b. More than 1000 bytes
c. 2 bits
d. None of the above.
31. How many LEDs (Light Emitting Diodes) does the 68HC11A8 have? ____
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
32. How many LCDs (Liquid Crystal Displays) does the 68HC11A8 have? ____
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
33. The logical AND of $F0 with Register A (containing $CA) is? ___E__
a. $F0 b. $C1 c. $02 d. $C5 e. $C0 f. None of these choices
34. The logical AND of $79 with Register A (containing $85) is? __B___
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
35. How many bytes of memory are required to store the contents of Registers A, B, D, and Y? ____E__
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
36. How does the 68HC11A8 determine whether a binary value is numerical data, ASCII character data, a memory address, or a machine code instruction? __D__
37. Register B contains $AB. A logical OR is performed with Register B and the value $12. What is the result in Register B? __G___
a. 0 b. 1 c. 2 d. 3 e. 4 f. 8 g. None of these choices
38. What addressing mode does the instruction ldaa $ABCF use? __E___
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
39. What addressing mode does the instruction ldaa $FA,y use? _C__
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
40. What addressing mode does the instruction aba use? __A___
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
41. What addressing mode does the instruction staa $0F use? _B___
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
42. What addressing mode does the instruction ldaa #$FA10 use? _D____
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
43. What addressing mode does the instruction andb $F0 use? __B___
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
44. What addressing mode does the instruction anda #$F0 use? ___D__
a. Inherent b. Direct c. Indexed d. Immediate e. Extended
45. For a Block diagram, what shape is used to represent a process? ___D__
a. Diamond b. rectangle c. trapezoid d. none of these choices