|
[ Handout in HTML Format | Handout in PDF Format | Handout in Word 2000 Format ] [ References | Quiz ] | ||||||
|
6.1 Processor Configuration
The processor is the “brains” of any computer, and is often referred to as the central processing unit, or CPU for short. The CPUs of modern systems are usually comprised with the following general components: the Arithmetic and Logic Unit (ALU), Floating-Point Unit (FPU), and Control Unit (CU). ALU: The part of the central processing unit which performs operations such as addition, subtraction and multiplication of integers and bit-wise AND, OR, NOT, XOR and other Boolean operations. FPU: Not all processors have this component. This is sometimes referred to as the “math co-processor”, and performs similar functions as the ALU but deals exclusively with floating point numbers. CU: The part of a CPU responsible for performing the machine cycle - fetch, decode, execute, store. (This machine cycle will be explained later on in the handout). The processor can be broken down even further to include three components common to virtually all processors: the Accumulator, Instruction Register, and Program Counter. Accumulator: In a central processing unit, a register in which intermediate results are stored. Without an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory and read them back. Access to main memory is slower than access to the accumulator which usually has direct paths to and from the ALU and FPU. An example is summing a list of numbers. The accumulator is set to zero initially, each number in turn is added to the value in the accumulator and only when all numbers have been added is the result written to main memory. Modern CPUs usually have many registers, all or many of which can be used as accumulators. Because of this, use of this term has declined in recent years. Instruction Register: A special memory location used to hold the instruction that the computer is currently processing. It is located in the control unit of the central processing unit. Program Counter: A register in the CPU that contains the address of the next instruction to be executed. The counter is automatically incremented after each instruction is fetched to point to the next instruction. At any time, the CPU may need to temporarily halt what it is currently doing in order to work on something of a higher priority. When this happens, it is called an interrupt. In general the computer responds to an interrupt by storing the information about the current state of the running program in an interrupt register. The information stored also contains the source of the interrupt. For example, while printing a long document, most operating systems allow the user to carry on with other work. When the printer is ready for more data, it sends an interrupt signal that causes the computer to halt work on the user's program and transmit more data to the printer, and allows the user to continue working on their document afterwards. The CPU is connected to the RAM (Random Access Memory),
ROM (Read Only Memory), and sometimes cache via a bus. A bus can be defined as one of the sets of conductors (wires, PCB tracks or
connections in an integrated circuit) that connects computer components. There are three types of CPU busses: control
bus, address bus, and data bus, all of which are explained in Topic 2 (see
Andrew Wong and Ankur Khurana’s handout on Topic 2). The data bus, address bus and control bus, despite their names,
really constitute a single bus since each is useless without the others. Bus speed is determined
by two factors: the width of the bus, and the frequency of the bus. The width of the bus is much like that of a
freeway: the wider it is, the more it can fit at a time. The frequency is comparable to a speed limit
on the freeway. The wider the bus is,
and the higher the frequency, the faster the performance. A bus provides a path for data to flow
between the CPU, the system memory (RAM), and the ROM memory (most commonly
used to store system BIOS information).
The RAM is connected via
the front-side bus (FSB). This
bus is the “hub” of the computer, because it connects the PCI slots, ISA slots,
RAM, ROM, and CPU itself. The Pentium
III has a 133MHz FSB, Pentium IV has a 100MHz FSB (this is “quad-pumped”, and
is effectively 400MHz), Athlon has a 133MHz FSB (this is “double-pumped”,
effectively 266MHz), and the G4+ has a 133MHz FSB. There are three types of cache commonly
employed: L1 (Level 1), L2, and sometimes L3.
All three levels store data required for the CPU. The CPU first tries the L1 cache for the
information, followed by L2, L3 (if present), and finally into the RAM
itself. AMD’s Athlon has 128KB of L1
cache, 256KB of L2, and 0KB of L3; Intel’s Pentium III has 32KB of L1 cache,
256KB of L2, and 0KB of L3. It should
be noted that the Pentium III’s L2 cache is connected via a 256-bit bus, while
the Athlon’s L2 cache is on a 64-bit bus, which allows the Pentium III to skimp
on the L1 cache size. On most modern computer systems, cache is
physically located on the CPU itself (called on-die cache). CPUs such as AMD’s Athlon, Intel’s Pentium III
and Pentium 4 all use on-die cache to improve performance, all of which operate
at the same frequency as the processor itself.
Motorola’s G4 and G4+ use backside cache, which is physically
located away from the CPU, but on a bus operating at half-speed of the
processor on a 128-bit bus (eg, a 500MHz G4 has 250MHz off-die cache). 6.2 The
Machine Instruction Cycle There is a cycle that all instructions given to the CPU must follow. In order, this cycle is:
Fetch: Quite simply, this fetches the instruction to be processed. At the beginning of each cycle the CPU presents the value of the program counter on the address bus. The CPU then fetches the instruction from main memory (possibly via a cache and/or a pipeline) via the data bus into the instruction register. Decode: Each instruction must be “decoded” so the specific CPU can understand it and execute the instruction. Execute: This stage actually performs the task desired. For example, if the instruction was to add 2 and 4, the processor would do that here. Store: This places the result into memory so the program can access the value. The instruction cycle could be made into an analogy by comparing it to working as a short-order cook: 1. Fetch: Orders for food are placed on the wall, so you must go and get the order (instruction). 2. Decode: You must then break down the order. For example, if the order is for a “#3 Combo”, you must recognize that this is “1 cheeseburger, 1 medium fries, 1 medium drink”. 3. Execute: Now you actually make the cheeseburger, fries, and the drink. 4. Store: Once you’re doing making the order, you bag it up and place it back so it may be picked up. 6.3 Disk
Storage Typically, long-term storage is accomplished with hard drives (also known as hard disks). Hard drives are ideal for this because, unlike RAM, they do not “forget” the data they store once power is terminated. IB requires we know the following definitions: Block: A group of records treated as a complete unit for transfer to or from the hard disk. For example, most disk drives transfer data in 512-byte blocks. Sector: A formatted segment of a disk so data can be stored on it. The disk is first divided into circular tracks and then each circular track is divided into a number of sectors. Cylinder: Combination of the tracks on all of a hard drive or fixed disk that can be accessed without moving the read/write heads. That is, the collection of disk tracks which are the same distance from the spindle about which the disks rotate. Each such group forms the shape of a cylinder. Placing data that are likely to be accessed together in cylinders reduces the access significantly as head movement (seeking) is slow compared to disk rotation and switching between heads. Head: The physical device on a hard drive that reads or writes data to the disk. Rotational Delay: The time for the start of the required sector on a disk to appear underneath the read/write head. The worst case is where it has just passed the head when the request is received. Seek Time: The time it takes for a disk drive to move its heads from one track to another. The seek time depends on the power of the drive, the mass of the heads, the number of tracks traversed and the time taken to position the heads over the target track accurately enough to start data transfer. Transfer Time: The time it takes for the data transfer to complete. Access Time: The sum of the rotational delay, seek time, and transfer time. 6.4 Operating Systems and Utilities The low-level software which handles the interface to peripheral hardware, schedules tasks, allocates storage, and presents a default interface to the user when no application program is running. is referred to as the operating system. The OS may be split into a kernel which is always present and various system programs which use facilities provided by the kernel to perform higher-level house-keeping tasks, often acting as servers in a client-server relationship. Some include a graphical user interface and window system as part of the OS, others do not. The operating system loader, BIOS, or other firmware required at boot time or when installing the operating system would generally not be considered part of the operating system. The OS is essentially a collection of programs that accomplish the following tasks: · input/output (I/O) control · file maintenance · software/hardware interface · memory management · user interface · software execution control · security Communicating with peripherals is an essential part of the operating system. Printing, using a mouse, and using a digital camera are an example of using peripherals. The operating system may allow concurrent processing of jobs. The idea behind this is that the OS has to control an array of programs running at the same time. For example, a user may be downloading a file from the internet, printing, and writing a document simultaneously. This is also known as multi-tasking. Memory management is a function all operating systems must have, and allows programs to grab memory and use memory in the system, without using memory allocated to other programs already. Resource monitoring built into the operating system ensures that resources are not being used to the point of making the system unstable. The OS must also contain a file system to store and access files and programs. Most operating systems use a system similar to that of a filing cabinet, with folders and ‘files’ with data and programs. A linker is a computer program which accepts the object code files of one or more separately compiled program modules, and links them together into a complete executable program, resolving references from one module to another. A loader loads a program into memory. A library manager is a program that manages library files (files that contain functions that may be used in many programs). 6.5 Computer/Peripheral Communication
Port: Talking over the Internet, computers connect to certain ports on another computer. Each program on the “Host” computer has a unique port number associated with it. Some protocols, for example telnet and HTTP (which is actually a special form of telnet) have default ports (23 and 80) but may use other ports as well. Handshaking: In order to verify that the computers have a stable connection before transferring data, handshaking is used. A handshake is for instance, when one computer says to the other "I received your last message and I am ready for you to send me another one." If the data was however corrupted during communication, and the Host computer requests a handshake, the client computer would reply "I did not receive your last message correctly, please resend it." Memory Mapped I/O: There are two basic forms of input and output that a typical computer system will use: I/O-mapped I/O and memory mapped I/O. I/O-mapped input/output uses special instructions to transfer data between the computer system and the outside world; memory mapped I/O uses special memory locations in the normal address space of the CPU to communicate with real-world devices. To the programmer, the difference between I/O-mapped and memory mapped input/output operations is the instruction to use. For memory mapped I/O, any instruction that accesses memory can access a memory mapped I/O port. For example, accessing a specified location in memory could access a pixel in a video ram. Controller: In order to utilize its peripherals, a computer accesses a controller. A controller is a part within a computer, typically a separate circuit board. A disk controller is used to connect hard disks and floppy disks; a network controller is used for Ethernet. Other controllers are: keyboard controller, interrupt controller and graphics controller. DMA: Direct Memory Access (DMA) is a method of data transfer in
which the central processing unit (CPU) in the computer does not have to
execute instructions to move the data. For example, when a computer is using
DMA to acquire some input, the processor can be executing a word processor
application 'at the same time'. DMA accomplishes this feat by using dead time
on the bus to perform the transfers. In this way, when the processor is not
accessing an expansion card (which it is not, most of the time), the bus can be
transferring data directly to the computer's memory. Buffer: An area of memory used for storing messages. Typically, a buffer will have other attributes such as an input pointer (where new data will be written into the buffer), and output pointer (where the next item will be read from) and/or a count of the space used or free. Buffers are used primarily to temporarily store data, sometimes a copy of existing data, to allow for the location to be both read from and wrote to at the same time. There are many different algorithms for using buffers, e.g. first-in first-out (FIFO, or queue), last-in first-out (LIFO, or stack), double buffering (allowing one buffer to be read while the other is being written), cyclic buffer (reading or writing past the end wraps around to the beginning). Interrupt: Interrupts are inputs that signal a response from a processor to execute a predefined subprogram. This would mean that a peripheral like a printer would get a message from a computer telling it to stop its current process and do something else, then resume its process. Basically these can be thought of an URGENT file in a print cue, IF the file were printed as soon as you told it to print. Polling: To check the status of an input
line, sensor, or memory location to see if a particular external event has been
registered. Common Situations
When modems transfers data to the hard drive it uses a DMA buffer to send data from the serial port of the modem across the bus and to the hard drive. Print jobs are polling system based. The printer checks the poll every so often and if a job exists it goes ahead with it. The jobs stay in the poll for a certain, predefined, amount of time (or until they have been received by the printer). A handshake occurs when you connect to your ISP. The ISP will do a handshake with your machine through the modem to make sure you are allowed to access it, and that the connection has been made successfully. In other words, DMA would be data transfer without CPU time, Interrupts would be executions that stop all other CPU time to complete the task, and polling systems would be a mixture of both of these. Serial DevicesConsidered to be one of the most basic external connections to a computer, the serial port has been an integral part of most computers for more than 20 years. Although many of the newer systems have done away with the serial port completely in favor of USB connections, most modems still use the serial port, as do some printers, PDAs and digital cameras. The name "serial" comes from the fact that a serial port "serializes" data. That is, it takes a byte of data and transmits the 8 bits in the byte one at a time. The advantage is that a serial port needs only one wire to transmit the 8 bits (while a parallel port needs 8). The disadvantage is that it takes 8 times longer to transmit the data than it would if there were 8 wires. Serial ports lower cable costs and make cables smaller. Serial ports, also called communication (COM) ports, are bi-directional. Bi-directional communication allows each device to receive data as well as transmit it. Serial devices use different pins to receive and transmit data -- using the same pins would limit communication to half-duplex, meaning that information could only travel in one direction at a time. Using different pins allows for full-duplex communication, in which information can travel in both directions at once. Parallel DevicesIf you have a printer connected to your computer, there is a very good chance that it uses the parallel port. While USB is becoming increasingly popular, the parallel port is still the most used interface for printers. Parallel ports are used to connect a host of popular computer peripherals: * Printers * Scanners * CD-writers * External hard drives * Iomega Zip removable drives * Network adapters * Tape backup drives When a PC sends data to a printer or other device using a parallel port, it sends eight bits of data (one byte) at a time. These eight bits are transmitted parallel to (beside) each other; as opposed to the same eight bits being transmitted serially (all in a single row) through a serial port. The standard parallel port is capable of sending 50 to 100 kilobytes of data per second. Connection Bandwidth Many devices can connect at different speeds, the speeds they connect at depend on the quality of the hardware, compression, and the connection it is run over. Common Modem Speeds 1960-2001: Serial Modems: 300 bit per second 1200 bit per second 2400 bit per second 9600 bit per second 14.4K bit per second 19.2K bit per second 28.8K bit per second 33.6K bit per second 56K bit per second Ethernet Modems: ADSL, at something approaching 10Mbps vDSL, approaching 60Mbps Cable, up to about 30Mbps As you can see, the connection speed differs greatly by the connection. Ethernet is far faster than the standard serial port. Even though DSL modems run through phone lines as serial modems do, they are far faster because of how they are connected to the computer. DSL modems use digital signals, rather than analog, which are far easier for a computer to handle, and may also include far more data in the same signal. The difference between serial and parallel ports can be seen when you look at the statistics on how much data they can transfer per second. The standard parallel port is capable of sending 50 to 100 kilobytes of data per second. A serial port is 1/8th as fast, and therefore will send approximately 7 to 13 kilobytes of data per second. A connection that is now included in most modern computers is USB, these can transfer data to 127 devices at 6 megabits per second, thus it is quite apparent as to why these are becoming the modern standard. |
©Copyright 2001 by Dave Milford and Tom Vogel. All rights reserved.