Computer Architecture and Organization Assignment II
Computer Architecture and Organization Assignment II
Computer Architecture and Organization Assignment II
1. Consider a hypothetical 32-bit microprocessor having 32-bit instructions composed of two fields: the first byte contains the opcode and the
remainder the immediate operand or an operand address.
A. What is the maximum directly addressable memory capacity (in bytes)?
B. Discuss the impact on the system speed if the microprocessor bus has
a. a 32-bit local address bus and a 16-bit local data bus, or
b. a 16-bit local address bus and a 16-bit local data bus.
C. How many bits are needed for the program counter and the instruction register?
2. Consider a hypothetical microprocessor generating a 16-bit address (for example, assume that the program counter and the address registers
are 16 bits wide) and having a 16-bit data bus.
A. What is the maximum memory address space that the processor can access directly if it is connected to a “16-bit memory”?
B. What is the maximum memory address space that the processor can access directly if it is connected to an “8-bit memory”?
C. What architectural features will allow this microprocessor to access a separate “I/O space”?
D. If an input and an output instruction can specify an 8-bit I/O port number, how many 8-bit I/O ports can the microprocessor support?
How many 16-bit I/Oports? Explain.
3. Consider a 32-bit microprocessor, with a 16-bit external data bus, driven by an 8-MHz input clock. Assume that this microprocessor has a
bus cycle whose minimum duration equals four input clock cycles. What is the maximum data transfer rate across the bus that this
microprocessor can sustain, in bytes/s? To increase its performance, would it be better to make its external data bus 32 bits or to double the
external clock frequency supplied to the microprocessor? State any other assumptions you make, and explain. Hint: Determine the number
of bytes that can be transferred per bus cycle.
4. Consider a computer system that contains an I/O module controlling a simple keyboard/ printer teletype. The following registers are
contained in the processor and connected directly to the system bus:
INPR: Input Register, 8 bits
OUTR: Output Register, 8 bits
FGI: Input Flag, 1 bit
FGO: Output Flag, 1 bit
IEN: Interrupt Enable, 1 bit
Keystroke input from the teletype and printer output to the teletype are controlled by the I/O module. The teletype is able to encode an
alphanumeric symbol to an 8-bit word and decode an 8-bit word into an alphanumeric symbol.
A. Describe how the processor, using the first four registers listed in this problem, can achieve I/O with the teletype.
B. Describe how the function can be performed more efficiently by also employing IEN.
5. A microprocessor has an increment memory direct instruction, which adds 1 to the value in a memory location. The instruction has five
stages: fetch opcode (four bus clock cycles), fetch operand address (three cycles), fetch operand (three cycles), add 1 to operand (three
cycles), and store operand (three cycles).
A. By what amount (in percent) will the duration of the instruction increase if we have to insert two bus wait states in each memory
read and memory write operation?
B. Repeat assuming that the increment operation takes 13 cycles instead of 3 cycles
6. The Intel 8086 is a 16-bit processor similar in many ways to the 8-bit 8088. The 8086 uses a 16-bit bus that can transfer 2 bytes at a time,
provided that the lower-order byte has an even address. However, the 8086 allows both even- and odd-aligned word operands. If an odd-
aligned word is referenced, two memory cycles, each consisting of four bus cycles, are required to transfer the word. Consider an
instruction on the 8086 that involves two 16-bit operands. How long does it take to fetch the operands? Give the range of possible answers.
Assume a clocking rate of 4 MHz and no wait states.
7. Consider a 32-bit microprocessor whose bus cycle is the same duration as that of a 16- bit microprocessor. Assume that, on average, 20%
of the operands and instructions are 32 bits long, 40% are 16 bits long, and 40% are only 8 bits long. Calculate the improvement achieved
when fetching instructions and operands with the 32-bit microprocessor.
8. Consider a 32-bit microprocessor that has an on-chip 16-KByte four-way set-associative cache. Assume that the cache has a line size of
four 32-bit words. Draw a block diagram of this cache showing its organization and how the different address fields are used to determine a
cache hit/miss.Where in the cache is the word from memory location ABCDE8F8 mapped?
9. Given the following specifications for an external cache memory: four-way set associative;line size of two 16-bit words; able to
accommodate a total of 4K 32-bit words from main memory; used with a 16-bit processor that issues 24-bit addresses. Design the cache
structure with all pertinent information and show how it interprets the processor’s addresses.
10. Consider a machine with a byte addressable main memory of 2 16 bytes and block size of 8 bytes. Assume that a direct mapped cache
consisting of 32 lines is used with this machine.
A. How is a 16-bit memory address divided into tag, line number, and byte number?
B. Into what line would bytes with each of the following addresses be stored?
a. 0001 0001 0001 1011
b. 1100 0011 0011 0100
c. 1101 0000 0001 1101
d. 1010 1010 1010 1010
C. Suppose the byte with address 0001 1010 0001 1010 is stored in the cache. What are the addresses of the other bytes stored along
with it?
D. How many total bytes of memory can be stored in the cache?
E. Why is the tag also stored in the cache?
11. Consider a memory system that uses a 32-bit address to address at the byte level, plus a cache that uses a 64-byte line size.
A.Assume a direct mapped cache with a tag field in the address of 20 bits. Show the address format and determine the following
parameters: number of addressable units, number of blocks in main memory, number of lines in cache, size of tag.
B. Assume an associative cache. Show the address format and determine the following parameters: number of addressable units, number
of blocks in main memory, number of lines in cache, size of tag.
C. Assume a four-way set-associative cache with a tag field in the address of 9 bits. Show the address format and determine the following
parameters: number of addressable units, number of blocks in main memory, number of lines in set, number of sets in cache, number
of lines in cache, size of tag.
12. Consider a memory system with the following parameters: