HistoryThe first electronic computers were created in the 1930's. They were built by connecting components with wires. Each computer could only do a specific job - there was no software, no programs. Some computers could be rewired to change their function, but most were hard-wired (unchangeable). Many of these early computers were analog machines, using analog sensors for input and controlling analog motors as output devices. |
Lots of Wires |
Stored-Program MachinesIn the 1940's the first digital computers were built. They used vacuum tubes and mechanical switches (relays) to represent bits and perform boolean operations. The operations were still wired, but the use of tubes and switches to represent bits and store data provided a bit more flexibility. In 1945 John von Neumann proposed a machine where programs and data would both be stored in the memory, with a central processor reading commands from the program, executing the commands, and changing the data. This led to the first stored-program machines, making the first use of programs written in code. |
Vacuum Tubes and Wires |
General Purpose ComputersA general-purpose computer can run a variety of programs and perform many various operations. These von Neumann machines contain a CPU (central processing unit) and Memory (RAM = Random Access Memory). The CPU is divided into an ALU (Arithmetic Logic Unit) and a CU (Control Unit). A typical PC contains an Intel Pentium CPU, but other computers use other microprocessors. The ALU can do arithmetic (add, subtract, multiply, divide) and perform logic (Boolean) operations like: and, or, not, as well as comparisons (less than, equal, greater than). Using these basic operations and clever programs, the computer can do more complicated calculations like square-roots, exponents, sines and cosines, logarithms, as well as evaluating complex Boolean expressions (if (a > b) and (sqrt(b) < 10) then....) The CU controls the movement of data to and from the memory. Modern PCs have lots of other peripheral components (disk drives, keyboard, printers, etc) requiring lots of data transfer. The CU also sends control signals to devices, for example turning lights on and off, starting or stopping a disk-drive motor, starting data transfer across the network, etc. So the CPU is involved in virtually all the operations of a PC - both control and calculation. |
Machine Instruction CycleThe memory contains both programs and data. The program commands are stored as binary codes that represent useful commands. To "run" (execute) the program, the CPU must fetch a command out of the memory, decode it by reading the bit pattern in the command, execute the command to produce some result, and store the result in the memory in the data area. Then it must execute another command, then another, so it performs the fetch-decode-execute-store cycle over and over again. In a 4 GigaHertz machine, the "clock" chip is running at 4 billion cycles per second, like a metronome ticking that fast. The computer can do one thing at each clock tick, so it would normally take 4 steps (4 clock cycles) to fetch-decode-execute-store. In reality, each of these stage requires several clock cycles. But clever engineers use clever techniques to speed this up by processing many instruction simultaneously. Fast computers can use multiple processors (like dual cores) to process several instructions simultaneously. |
Fetch-Decode-Execute-Store Instruction Cycle with Animation
|
ROM and Registers and Word-sizeIn some cases, the programs are stored in ROM (Read Only Memory) instead of RAM. This is convenient in a small, dedicated device like a traffic-light controller. Since the program is small and simple and will never change, it doesn't need to be stored in RAM. But even a tiny controller is likely to store some type of data, however small. A traffic-light controller must count the number of seconds the red light has been on so it can turn it off after a minute or so. If it only stores a few numbers, the numbers can be stored directly inside the CPU. These small storage locations in the CPU are called registers. Each register stores a few bytes, perhaps 1, 2 or 4 bytes. The amount of data that fits in a register is called a word. Many modern computers are called 32-bit machines, meaning that the registers are 32-bits wide (4 bytes). If you buy a new 64-bit machine, that means it's word-size is 64 bits. Word-size measures the maximum amount of data that can be processed by the machine in a single step. In an ideal machine, the word-size would be the size of the registers and also the size of the data-bus, so that one word of data could be transferred (from RAM to CPU or back) in every machine cycle. That would produce a data transfer rate of 64 bits x 4 billion per sec = 256 Gigabits per second. That much speed is usually unnecessary, so it's common to use 64-bit registers together with a 32-bit data-bus. Then calculations in the CPU are performed 64-bits at a time, but it takes 2 steps to transfer the 64 bits to the memory across the 32-bit bus - sending 32 bits and then sending another 32 bits. The address bus carries a memory address from the CPU to the RAM. The RAM responds by sending the data from that memory location back through the Data Bus. So the width of the address bus determines the maximum number of Bytes in RAM. With a 32 bit address bus, the largest address is 2^32 = 4 billion, so it supports 4 GigaBytes in RAM. |
Back to the Good Old DaysIn the early days of "personal computing", Apple led the PC revolution with home-computers using an 8-bit word-size. The microprocessors ran a lot slower. The original IBM PC ran at 4.77 MegaHertz. That's about 1000 times slower than modern PCs. Those old PC's also had a lot less memory - 32 KiloBytes was a typical size, 64 KiloBytes was a great luxury. The original PC contained an 8 inch floppy disk drive that held about 160 KiloBytes per disk. Moore's Law Gordon Moore, one of the founders of Intel (the chip manufacturer) predicted in 1965 that "the density of transistors on a microprocessor will double every 18-24 months." This rate of improvement has actually held pretty constant for over 40 years. Squeezing more transistors into a microprocessor means it can do more work in the same time. Also, as the transistors and circuits become smaller, they require less electricity and generate less heat, so they can run faster (more Hertz) without overheating. So the CPU's and RAM chips improve at an exponential rate. And by squeezing more functions onto each chip, the number of chips required in the machine is reduced. Now we have MP3 players where a single chip decodes and plays music - functions that would have required many chips 10 years ago and would have been virtually impossible 20 years ago. Since all the functionality is squeezed into a single chip, an MP3 player containing a microprocessor and a Ram chip can be sold for under 20 Euros. We get accelerating improvements in performance at ever cheaper prices. |
Hard Disk in 1956 - 5 Megabytes (hey look, it's PORTABLE) |
Exponential Growth According to Moore's Law Consider a 1 MegaByte memory card in a 1988 PC, compared to a 1 GigaByte
memory card in a 2008 PC. |
1988 |
1990 |
1992 |
1994 |
1996 |
1998 |
2000 |
2002 |
2004 |
2006 |
2008 |
1 MB |
2 MB |
4 MB |
8 MB |
16 MB |
32 MB |
64 MB |
128 MB |
256 MB |
512 MB |
1024 MB = 1 GB |
Primary MemoryCalculations require input data and results to be stored somewhere - usually in RAM. This is called primary memory, as it is the first place where data is stored. But the RAM is volatile, meaning it loses all the data when the power is switched off. For permanent storage we need non-volatile memory that retains the data when the power is switched off. People use pencils and paper to store information permanently. But digital computers need to use digital devices for storage. So we've developed a variety of non-volatile storage devices to be used for permanent secondary storage. After data has been stored in RAM, it can be transferred to a permanent storage device. |
|
Storage Technologies for Secondary MemoryThree common storage technologies are: optical (CD, DVD), magnetic (diskettes, hard-disks, tapes), and electrical (flash memory like USB sticks, SD memory cards, etc). Optical disks use a laser beam to read tiny pits (dents) in a reflective surface. Recordable CD's and DVD's contain a layer of dye that can be heated and then changed to a reflecting or non-reflecting state. The same laser that can read the bits can also heat the dye and write bits. Magnetic disks and tapes use an electro-magnet to magnetize bit-size areas on a magnetic surface. Another magnetic sensor can then read the magnetized states of these bits. Electrical flash memory stores bits by trapping electrons in a small space. It uses an electrical charge to relase the electrons to read the state of a bit. These trapped electrons remain trapped even when power is turned off, but some power is needed for the reading and writing operations. USB sticks get their power directly from the USB port |
|
Accessing DataAfter storing data in secondary memory, the CPU must be able to read the data and copy it back into primary memory, or maybe just transfer it to another computer. Two major data access algorithms are: random access and sequential access. Tape uses sequential access. To get data from a tape, the computer starts reading at the beginning and continues sequentially until it has the data it needs. There is no other good way to use a tape. Fast-forward is also sequential, just faster. Disk drives can use random access. The data is stored in sectors. Each sector has a position on the disk and is identified by a number. The disk drive can quickly access any sector by moving the read-head across the tracks and waiting for the disk to turn to reach the desired sector. The latency (waiting time) required to access any sector is roughly the same, so it doesn't really matter where the data is physically stored on the disk. This is not true for tape, where the data at the end of the tape takes a very long time to access. Flash memory is also random-access. New solid-state disks are built from lots of flash-memory chips. They are roughly as large as a small hard-disk, but there are no moving parts - no motors, no read-write head, and no spinning disks. Data access is done electrically and this is very fast (that is not the case for USB sticks, which are relatively slow). These solid-state are more expensive than hard-disks, but more reliable. |
Old fashion Tape Drive |
How Much Memory is Enough?Floppy diskettes hold 1.4 MegaBytes of data. These are no longer popular because 1.4 MB is not very much storage - maybe enough for a single photo. It might hold a few essays, but not if they contain lots of graphics. CD-ROM disks hold 700 MegaBytes of data - that's a bit less than 1 GigaByte. That's usually enough for distributing software, but probably not enough for a multi-media encyclopedia. The latest Windows OS will not fit on a CD. USB sticks hold 1,2, or 4 GigaBytes or more (up to 64 GB). The same applies to SD memory cards. That's enough to hold hundreds (maybe thousands) of MP3 songs or hundreds of photos. But it's not quite enough for a movie. DVD's hold 4 or 8 GigaBytes. That's enough for a movie, plus lots of extra scenes and interviews. It's enough for virtually any piece of software, like Windows or Linux Operating Systems. Hard-disks hold anywhere from 100 GigaBytes to 1 TeraByte (1000 GB). Hard-disks are used to collect and store lots of software and/or media, documents, data, etc. Tape Drives can hold various quantities of data, depending on the length of the tape. Commonly digital tape drives are designed to store a roughly the same amount of data as a hard-disk, as tapes are generally used to back-up hard-disks. |
Backup Devices |
Embedded Processors (for dedicated devices)PC's are only one example of computers. Many every day devices are dedicated devices that only perform one task. Microprocessors (CPUs) are found in many "every day" devices - washing machines, TV's, automobiles, remote controls, clocks and many others. Why embed microprocessors in so many devices? Mechanical (physical) control is difficult and costly to build. Microprocessors can be programmed to do very complex tasks, and then produced and installed very cheaply. We use the term "smart device" to describe the clever, complex operation possible by using a microprocessor. A microprocessor controlled washing machine can use sensors to check water temperature and then activate a motor to open a valve to let hot water in at exactly the right time. In an automobile engine, a microprocessor can control fuel and air flow to the engine, optimizing fuel usage. The basic concept of microprocessor control is: input sensors ==> microprocessor control ==> output actuators (motors) With purely mechanical controls, the "smart control" in the middle is missing, so devices behave very simply rather than cleverly. |
Embedded Processors |
Input / Output DevicesThe keyboard and mouse are not the only input devices used with computer. Even PCs allow a microphone to be connected. Various other input devices are useful in specific situations, including: Scanners take a picture of a paper page. The result could be an image file. That image can be translated into a text document by an OCR program (Optical Character Recognition) - the document is a digital copy and can be stored and edited like as a word-processing document. OCR tries to recognize printed characters in the page, translate those into ASCII codes, and save all the text in a document. This is useful for capturing data from old printed documents. Even good OCR software only recognizes about 99% of the text correctly. Touch screens respond to pressure, allowing users to use their finger or a stylus to perform operations that are normally done with a mouse. This is especially useful for drawing smooth lines (curves). The screen functions simultaneously as an input and an output device. Touch screens are especially useful in public areas, like airports, where a keyboard or mouse might get dirty or damaged. They are also popular in pocket computers, where a keyboard is not available. MICR (Magnetic Ink Character Recognition) is commonly seen at the bottom of bank cheques, as digits written with big fat blobs of ink. The ink contains magnetic particles that can be read by a magnetic sensor. This technology is quite old, first used in the 1960's. It has the advantage that it is readable by both humans and computers. Bar-Codes appear on many retail items, especially on grocery items and books. The fat and thin black stripes use a system similar to binary to represent numbers. The codes are read with a laser scanner. This system is very efficient allowing very quick input, so it is used to track cargo packages in planes, ships and trucking systems. Speakers are used to output sounds, including warnings and alerts (beeps), as well as music or synthetic speech. Robots are usually controlled by a computer, so they function as an output device. The computer controls motors that move the robots parts. Other common digital input/output devices include: mouse, keyboard, touch screen, optical character recognition (OCR), magnetic ink recognition (MICR), scanners (page, mark sense and barcode), LCD panels, speech recognition, sensors, digital cameras, graphics tablets, printers, plotters, monitors, sound. Most of these devices are attached to the computer via cables - we refer to these as peripheral devices. |
|
Processor and Storage ImprovementsImprovements to computer technology continue following Moore's law. With circuit size reducing by half every 2 years, engineers can pack more and more functions into each chip. This also reduces power consumption and thus reduces heat production, allowing chips to run faster and faster without overheating. Reduced size isn't the only technological improvement. Clever engineering ideas can improve performance without substantially changing the hardware: CPU Architecture
Primary Memory
Secondary Memory
|
~~ Pipelining Instructions ~~
~~ Primary Memory Speed ~~ ~~ Solid State Disk ~~ |
Operating SystemAn operating system is a management system, consisting of a large collection of programs with numerous key functions:
Examples include Windows, Linux, Mac OS, and various Network Operating Systems (that manage servers). Application software rarely coummincates directly with hardware devices. Instead, applications use the API (Application Program Interface) to give commands to the OS, and the OS communicates with the hardware. |
Types of ComputersA computer is any electronic device that has at least 4 capabilities: A PC is only one example of a computer system. There are many other examples. We can identify 4 groups of basically different types:
|
Personal Computer PDA Super Computer 2008 = $200 Million |
Platforms and ArchitectureA platform is defined by the hardware and the operating system. For example a PC uses different chips than a MacIntosh, as well as using a different OS. In this case, the difference is not significant. On the other hand, a pocket-PC uses totally different hardware and a totally different OS than a super-computer that calculates weather simulations.
|
Processing Methods Examples |
Batch Processing Batches of paper (or other input) are collected and then processed all together in a central office. Thousands of students take an exam, marking multiple choice answers on a mark-sense page. Batches or answer sheets are sent to a central location. All the sheets are fed into a scanner, using a sheet feeder that processes several sheets per second. Results are calculated and stored, and paper print-outs are mailed back to each school. Another common example is a retail store that collects papers all day, then sends them to a central computer at the end of the day for batch-processing. |
Online Processing A server interacts with a single client across a network, responding quickly to input.
Another example is online banking. This allows interactive processing, where the server can tell the user what their current balance is, accept transactions, and check that the users' wishes have been input correctly. |
Real-Time Processing Use this when it is essential that processing and responses occur quickly, "in real time", so that the computer keeps pace with the real world. A scientist uses a computer with joysticks to control robot arms that pour chemicals inside a protective glass case. This allows the chemist to work with dangerous, poisonous chemicals without being exposed to dangerous fumes. The scientist moves the joysticks and the computer transmits signals to the motors controlling the robot arms. The computer could use artificial intelligence to prevent accidental movements that might break the glassware or spill chemicals. Another common example is an air-traffic-control system at an airport. A computer uses radar to track airplanes, displaying their position on the a screen. |
Applications that use each of the processing methods in 3.3.5:
|