1.
Give two reasons why caches are useful.
(1)There are only important information in the caches.
(2)It is faster than other memory systems.
What problems do they solve?
Caches can improve performance where a large disparity in access time
or transfer rate exists between two components.
What problems do they cause?
Caches are temporary.
When the computer is restarted,information in the caches will be delete;
and then caches must need some times to retrieve the information again.
If a cache can be made as large as the device for which it is caching
(for instance, a cache as large as a disk), why not make it that large and eliminate the device?
Because caches are too expensive.
The faster memory system they work,the more expensive they are.
2.
What Is the purpose of interrupts?
An interrupt is a hardware-generated change of flow within the system.
What are the differences between a trap and an interrupt?
An interrupt handler is called to deal with the cause of the interrupt;control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt.
Can traps be generated intentionally by a user program?
An interrupt can be used to signal the completion of an I/O to obviate the need for device polling.
If so, for what purpose?
A trap can be generated intentionally by a user program. It can be used to call operating system routines or to catch arithmetic errors.
3.
Please tell the functional differences between CPU and device controller.
(a). The differences between CPU and device controller is that CPU is the device,which controls all the operations, but device controller translates software input into something a hardware device understands.CPU and device controllers all use a common bus for communication
Is there any similarity between them?
(b). A device controller is a part of a computer system that makes sense of the signals going to, and coming from the CPU.
4.
Please discuss, in your own words, the cycle of the handling of an interrupt.
First, the device driver will load the appropriate registers within the device controller. Then, the device controller examines the contents of these registers to determine what action to take. The device controller starts to transfer data form the device to its local buffer. When the transfer is complete, the device controller will send interrupt to device driver. The device driver then returns control to the operating system.