Replying to: java programing first lesson by MJimene25
Re: java programing first lesson
Asynchronous Events: Polling Loops and Interrupts
The CPU spends almost all of its time fetching instructions from memory and executing them. However, the CPU and main memory are only two out of many components in a real computer system. A complete system contains other devices such as:
* A hard disk for storing programs and data files. (Note that main memory holds only a comparatively small amount of information, and holds it only as long as the power is turned on. A hard disk is used for permanent storage of larger amounts of information, but programs have to be loaded from disk into main memory before they can actually be executed.)
* A keyboard and mouse for user input.
* A monitor and printer which can be used to display the computer's output.
* An audio output device that allows the computer to play sounds.
* A network interface that allows the computer to communicate with other computers that are connected to it on a network, either wirelessly or by wire.
* A scanner that converts images into coded binary numbers that can be stored and manipulated on the computer.
The list of devices is entirely open ended, and computer systems are built so that they can easily be expanded by adding new devices. Somehow the CPU has to communicate with and control all these devices. The CPU can only do this by executing machine language instructions (which is all it can do, period). The way this works is that for each device in a system, there is a device driver, which consists of software that the CPU executes when it has to deal with the device. Installing a new device on a system generally has two steps: plugging the device physically into the computer, and installing the device driver software. Without the device driver, the actual physical device would be useless, since the CPU would not be able to communicate with it.
A computer system consisting of many devices is typically organized by connecting those devices to one or more busses. A bus is a set of wires that carry various sorts of information between the devices connected to those wires. The wires carry data, addresses, and control signals. An address directs the data to a particular device and perhaps to a particular register or location within that device. Control signals can be used, for example, by one device to alert another that data is available for it on the data bus. A fairly simple computer system might be organized like this:
No replies to this message