Homework 2 Information, ECS50 Fall 2000
- Written homework due by 4:45 PM on Thursday, October 19th
- Programming assignment due by 11:59 PM on Thursday, October 19th
- Do all problems.
- You will begin working in groups of 2 on this assignment.
Assignment:
(1) Suppose that a computer system uses a 40-bit wordsize and a 28-bit address
space.
a. How many bytes of memory are there?
b. What is the hexadecimal value of the highest address?
(2) Why do the address registers use unsigned arithmetic while the accumulator
uses signed two's complement arithmetic?
(3) Why is the Instruction register a different size than the PC in CUSP?
(4) Explain in detail the Fetch Decode Execute cycle, and the roles of the
IR and the PC in this.
(5) How does the CPU tell whether a given memory location contains an
instruction or a data word?
(6) The instruction $042045 causes the contents of the ACC to be stored in
memory location $045.
a. Describe this using the register transfer language shorthand.
b. If location $045 contains the value $FF0AB0 and the ACC contains
$71A7EF, what are the contents of the ACC and location $045 after the
execution of the instruction?
(7) Registers are simply additional memory cells. Why are they used in a CPU?
(8) The user can access the ACC - why can't the user access the IR?
(9) Outline briefly what is meant by the following terms:
a. Opcode
b. Addressing mode
c. Unconditional Jump
d. Set a flag
(10) How do the following concepts differ?
a. direct and immediate addressing
b. arithmetic and logical instructions
(11) Explain the effects of the following instruction sequences on the
registers, flags, and memory locations that are indicated. Assume that all
programs start at memory location $000. If a value cannot be determined
from the information in the instruction fragment, then indicate so by
using ???
1) LDA $001
STA $004
ADA# $003
HLT
ACC =
Memory[$004] =
LT =
PC =
2) LDA# $035 ACC
CMA $003
JLT $005
ADA# $302
JMP $006
HLT
HLT
$000023
ACC =
LT =
PC =
(12) Problem 3.4 (b,d)
(13) Problem 3.7 (program)
(14) Problem 3.8 (program)