Download Chapter 1 Exercise Solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Chapter 1 Exercise Solutions
E1.1 The processor is one of the major parts in a computer system. A processor consists
of a register file, an arithmetic logic unit, and the control unit.
E1.2 The processor in a large computer may consist of one or several printed circuit
boards. However, the microprocessor is a processor fabricated in a single integrated
circuit.
E1.3 The microcontroller has everything contained in a microprocessor and also one or
more of the following components that makes building a product much easier:
- memory,
- timer,
- analog-to-digital converter,
- digital-to-analog converter,
- direct memory access controller,
- parallel I/O interface (often called parallel port),
- serial I/O interface, and
- memory components controller.
E1.4 8 bits
E1.5 64KBytes or 65536 bytes.
E1.6 A computer needs startup software to perform power-up initialization so that the
computer can operate properly. The startup software must be stored in non-volatile
memory so that it can become ready for execution when the power is first turned on.
E1.7 MROM is a ROM memory technology that is programmed when it is manufactured.
MROM is the densest and has the lowest per bit price among all ROM technologies.
However, it requires masks during the fabrication process that are quite expensive.
MROM is best for those designs of which the application software does not need to be
changed in the future and will be manufactured in a large quantity.
PROM is a type of ROM technology that can be programmed by the end user by using a
PROM programmer. PROM can only be programmed once. Since it can only be
programmed once, PROM will be most suitable for those applications that have been
fully debugged and will not be manufactured in a large quantity.
EPROM is a type of ROM technology that allows the erasure and reprogramming of its
contents. EPROM can be programmed electrically and erased optically by exposing to
the ultraviolet light. EPROM is the densest and least expensive erasable ROM
technology. It is most suitable for those applications that require future upgrade or
products that are still in prototyping stage.
EEPROM is a type of ROM technology that can be programmed and erased electrically.
End users can selectively program a location, a row, or even the whole in one operation.
Like EPROM, it is also suitable for holding software that is still in debugging stage or
requires future upgrade. Like EPROM, it is also suitable for holding software that is still
in debugging stage or requires future upgrade.
Flash memory is a type of memory technology that can be programmed and erased
electrically. It has the low-cost advantage of EPROM and also the convenience of using
1
electrical voltage for programming. It is suitable for any application that is suitable for
EPROM and EEPROM. Flash memory can only be erased in bulk.
E1.8 Programs written in an assembly language or a high-level language are called
source code. The output of the assembly or compiling process is object code.
E1.9 The program counter (PC) keeps track of the address of the next instruction to be
executed.
E1.10
5K = 5  1024 = 512010
13K = 13  1024 = 1331210
24K = 24  1024 = 2457610
E1.11 Use memory location $00 as a swap buffer:
STAA $00
TBA
LDAB $00
E1.12 The subtraction must be done in one of the accumulator.
LDAA $00
SUBA #4
STAA $00
LDAA $01
SUBA #4
STAA $01
LDAA $02
SUBA #4
STAA $02
E1.13
LDAA $10
ADDA $11
ADDA $12
STAA $15
E1.14
LDAA $11
LDAB $12
STAA $12
STAB $11
E1.15
LDAA #33
STAA $11
STAA $12
STAA $13
E.16
LDAA #10
STAA $01
; I  10
LDAA #20
STAA $04
; J  20
SUBA $01
;kJ-I
STAA $10
;
“
2
E1.17
assembly
machine code
instruction
-----------------------------------------------LDAA #$20
86 20
ADDA $10
9B 10
LDAB #$90
C6 90
STD $00
DD 00
E1.18
assembly
instruction
machine code
LDAA #00
86 00
LDAB $01
D6 01
STD $60
DD 60
LDAB $03
D6 03
STD $62
DD 62
---------------------------------------------E1.19 The given machine code sequence is broken down into individual instructions as
follows:
machine code
assembly instruction
96 40
LDAA $40
8B F8
ADDA #$F8
97 40
STAA $40
96 41
LDAB #$41
8B FA
ADDA #$FA
97 41
STAA $41
E1.20 The given machine code sequence is broken down into individual instructions as
follows:
machine code
assembly instruction
DC 00
LDD $00
8B FE
ADDA #$FE
CB FD
ADDB #$FD
DD 00
STD $00
E1.21
(a) 3 read cycles: all during instruction fetch
(b) 3 read cycles: all during instruction fetch
(c) 4 read cycles: 3 cycles during instruction fetch and 1 cycle during operand fetch
(d) 5 read cycles: 3 cycles during instruction fetch and 2 cycles during operand fetch
E1.22
(a) LDAA $00: 2 read cycles during instruction fetch and 1 during instruction
execution
(b) LDAB $01: same as (a)
3
(c) STAB $00: 2 read cycles during instruction fetch and 1 write cycle during
instruction execution
(d) LDAB $02: same as (a)
(e) STAB $01: same as (c)
(f) STAA $02: same as (c)
E1.23 The memory contents after the execution of the instruction sequence are as
follows:
memory location
contents
-------------------------------------------$00
72 (or $48)
$01
55 (or $37)
$02
33 (or $21)
-------------------------------------------E1.24 The execution times of the specified instructions are as follows:
(a) 2 E cycles
(b) 4 E cycles
(c) 5 E cycles
(d) 4 E cycles
(e) 5 E cycles
E1.25
(a) the period of the E clock is 0.0000005 seconds
(b) 20 E clock cycles or 10 µs.
(c) 100,000 times
4
Related documents