0% found this document useful (0 votes)
164 views

Exercise1: Suppose The Memory Cells at Addresses 00 Through 05 in The Machine

This document contains solutions to 8 exercises involving a machine described in Appendix C. The exercises test understanding of instruction execution order, register and memory cell contents, and translating machine code instructions. For each exercise, the solutions list the program counter, register, and/or memory cell contents at specific points in instruction execution or when the machine halts.

Uploaded by

Ali Nassar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views

Exercise1: Suppose The Memory Cells at Addresses 00 Through 05 in The Machine

This document contains solutions to 8 exercises involving a machine described in Appendix C. The exercises test understanding of instruction execution order, register and memory cell contents, and translating machine code instructions. For each exercise, the solutions list the program counter, register, and/or memory cell contents at specific points in instruction execution or when the machine halts.

Uploaded by

Ali Nassar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CSCI205 Chapter Review Problems - Solution Fall 2020 – 2021

Exercise1: Suppose the memory cells at addresses 00 through 05 in the machine


described in Appendix C contain the following bit patterns:

Assuming that the program counter initially contained 00, record the contents of the
program counter, instruction register, and memory cell at address 02 at the end of each
fetch phase of the machine cycle until the machine halts.

- Program counter: 06
- Instructions: 2211 – 3202 – COOO
- Memory cell at address 02: 11

Exercise2: Suppose the memory cells from addresses 00 to 05 in the machine described
in Appendix C contain the (hexadecimal) bit patterns given in the following table:
Address Content
00 14
01 02
02 34
03 17
04 C0
05 00

If we start the machine with its program counter containing 00, what bit pattern is in the
memory cell whose address is hexadecimal 17 when the machine halts?

- Memory cell at address 17: 34

Exercise3: Suppose the memory cells at addresses 00 through 03 in the machine


described in Appendix C contain the following bit patterns:
CSCI205 Chapter Review Problems - Solution Fall 2020 – 2021

a. Translate the first instruction into English.


 2655: Load in register 6 the bit pattern 55

b. If the machine is started with its program counter containing 00, what bit pattern is in
register 6 when the machine halts?
 Register 6: 55

Exercise4: Suppose the memory cells at addresses 00 through 02 in the machine


described in Appendix C contain the following bit patterns:

a. What would be the first instruction executed if we started the machine with its program
counter containing 00?
 1221

b. What would be the first instruction executed if we started the machine with its program
counter containing 01?
 2134

Exercise5: Suppose the memory cells at addresses 00 through 05 in the machine


described in Appendix C contain the following bit patterns:
CSCI205 Chapter Review Problems - Solution Fall 2020 – 2021

When answering the following questions, assume that the machine starts with its program
counter equal to 00.
a. Translate the instructions that are executed into English.
Instructions: (write the complete sentence from appendix C)
 1202: Load
 3242: Store
 C000: Halt

b. What bit pattern is in the memory cell at address 42 when the machine halts?
- Memory cell at address 42: 32

c. What bit pattern is in the program counter when the machine halts?
- Program counter: 06

Exercise6: Suppose the memory cells at addresses 00 through 07 in the machine


described in Appendix C contain the following bit patterns:

a. List the addresses of the memory cells that contain the program that will be
executed if we start the machine with its program counter containing 00.
The memory cells containing the program are: 00, 01, 02, 03, 04, 05
At C000 the program halt, no meaning for the other cells

b. List the addresses of the memory cells that are used to hold data.
The cell memory used to hold data is 06 from instruction 3B06
CSCI205 Chapter Review Problems - Solution Fall 2020 – 2021

Exercise7: Suppose the memory cells at addresses 00 through 05 in the machine


described in Appendix C contain the following (hexadecimal) bit patterns:

If we start the machine with its program counter containing 00, when does the machine
halt?
- The machine halt at cell memory 06
Instructions: 25B0 – 3504 – C000

Exercise8: Suppose the memory cells at addresses A4 to B1 in the machine described in


Appendix C contain the (hexadecimal) bit patterns given in the following table:

Scratch: Address Content


A4 2013 A6 R0: 13 A4 20
11A7 A8 R1: A7 A5 13
7201 AA R2: B7 A6 11
32FF AC A7 A7
C000 AE A8 72
A9 01
R0 or R1 => 13 or A7 AA 32
00010011 or AB FF
10100111 AC C0
-------------
AD 00
10110111 = B7

When answering the following questions, assume that the machine is started with its
program counter containing A4.
a. What is the bit pattern in register 0 : 13
b. What is the bit pattern in register 1: A7
c. What is the bit pattern in register 2: B7
d. What is the bit pattern in the cell memory FF: B7
CSCI205 Chapter Review Problems - Solution Fall 2020 – 2021

e. What is the last value of the program counter: AE

Exercise8: Suppose the memory cells at addresses 00 through 09 in the machine described in
Appendix C contain the following bit patterns:

00 1C03 02 Reg C: 03
2B03 04 Reg B: 03
5ABC 06 Reg A: 03
3A00 08
C000 0A
Reg C AND Reg B => 03 AND 03
00000011 AND
00000011
-------------
00000011 = 03

Assume that the machine starts with its program counter containing 00.
a. What will be in the memory cell at address 00 when the machine halts? 03
b. What bit pattern will be in the program counter when the machine halts? 0A

You might also like