Page 46 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 46

PROBLEMS                                                             23


                                      PROBLEMS

        1. Is a Hewlett-Packard handheld calculator, model 21 (or any programmable calculator
        that you may select), a (von Neumann) computer, and why?
        2 . What do the following terms mean: memory, controller, data operator,
        input/output?
        3 . What are a microcomputer, a microprocessor, and a single-chip microcontroller?
        4 . Describe the terms clock, data bus, address bus, and read/write line. Discuss the
        operation of reading a word from memory using these terms.
        5 . How many memory read cycles are needed for the following instructions, using the
        CPU 12 reference manual? How many are fetch operations, and how many are recall
        operations? How many memorize cycles are used?

             (a)LDAA #19
             (b)LDAB #18
             (c)ADDA $3FB2
             (d)ADDA 23            (Use 16-bit direct addressing)
             (e) STAA 199          (Use 16-bit direct addressing)
        6.   While executing a particular program, (PC) = 2088, (A) = 7, and (B) = 213 before
        the following sequence is executed:
             LDAA #10                                 Location   Contents
             ADDA 2142                                2139       8
             STAA 2139                                2140       7
                                                      2141       16
                                                      2142       251
                                                      2143       19
        If the contents of memory locations 2139 through 2143 are as shown on the right before
        the sequence is executed, what will be the contents of A, B, and PC after the sequence is
        executed? (Location is the memory location, or address, and Contents is the memory
        contents. All numbers given are in decimal.) What will the C bit be equal to after the
        sequence is executed?
        7 . Write a program to add two 3-byte numbers in the same manner as the last program
        segment of this chapter.
        8 .  Select goals for good programs in the following applications, and give a reason for
        the goals. The goals should be: static or dynamic efficiency or clarity.

             (a) A 75,000-instruction program
             (b) A program for guidance of a space satellite
             (c) A controller for a drill press
             (d) An automobile engine controller
             (e) Programs for sale to a large number of users (like a Basic interpreter)
   41   42   43   44   45   46   47   48   49   50   51