Hardware Reference
In-Depth Information
PROBLEMS
1. A word on a little-endian computer with 32-bit words has the numerical value of 3. If
it is transmitted to a big-endian computer byte by byte and stored there, with byte 0 in
byte 0, byte 1 in byte 1, and so forth, what is its numerical value on the big endian ma-
chine if read as a 32-bit integer?
2. Various computers and operating systems in the past have used separate instruction and
data spaces, allowing up to 2 k program addresses and also 2 k data addresses using a k -
bit address. For example, for k
32, a program could access 4 GB of instructions and
also 4 GB of data, for a total address space of 8 GB. Since it is impossible for a pro-
gram to overwrite itself when this scheme is in use, how could the operating system
load programs into memory?
3. Design an expanding opcode to allow all the following to be encoded in a 32-bit in-
struction:
=
15 instructions with two 12-bit addresses and one 4-bit register number
650 instructions with one 12-bit address and one 4-bit register number
80 instructions with no addresses or registers
4. A certain machine has 16-bit instructions and 6-bit addresses. Some instructions have
one address and others have two. If there are n two-address instructions, what is the
maximum number of one-address instructions?
5. Is it possible to design an expanding opcode to allow the following to be encoded in a
12-bit instruction? A register is 3 bits.
4 instructions with three registers
255 instructions with one register
16 instructions with zero registers
6. Given the memory values below and a one-address machine with an accumulator, what
values do the following instructions load into the accumulator?
word 20 contains 40
word 30 contains 50
word 40 contains 60
word 50 contains 70
a. LOAD IMMEDIATE 20
b. LOAD DIRECT 20
c. LOAD INDIRECT 20
d. LOAD IMMEDIATE 30
e. LOAD DIRECT 30
f. LOAD INDIRECT 30
7. Compare 0-, 1-, 2-, and 3-address machines by writing programs to compute
X=(A+B
F)
for each of the four machines. The instructions available for use are as follows:
×
C)/(D−E
×
Search WWH ::




Custom Search