Fundamentals. Main Hardware Components Central Processing Unit (CPU) Main Memory (random access...

Post on 31-Dec-2015

228 views 2 download

Transcript of Fundamentals. Main Hardware Components Central Processing Unit (CPU) Main Memory (random access...

Fundamentals

Main Hardware Components Central Processing Unit (CPU) Main Memory (random access

memory or RAM) Auxiliary Storage Input Devices Output Devices

CPU Performs arithmetic and

comparisons

The real “brain” of the computer

RAM Temporarily stores any program

being executed on the computer, as well as the data on which the program operates

Auxiliary Storage Provides a place where data can

be permanently stored and then transferred to and from main memory.

Examples: floppy disk, hard disk, CD-ROM, Zip drives, tape backup

Input Devices Accept data from an external

source and convert it to electrical signals, which are sent to the CPU.

Examples: keyboard, mouse, joystick, scanner, microphone

Technically, auxiliary storage is also considered an input device

Output Devices Accept electrical signals from the

CPU and convert them to a form suitable for output.

Examples: monitor, printer, speakers

Technically, auxiliary storage is also considered an output device.

Bits and Bytes: How Data is Represented in the Computer

All computer calculations are done using binary arithmetic, which uses only 0’s and 1’s. Each binary digit (0 or 1) is called a bit.

This is convenient for the computer hardware because in any circuit, 0 might be represented by a low voltage signal and 1 might be represented by a higher voltage signal. I.e., it’s easy for the electronics to distinguish between just two possible values.

But much of the data we use on the computer isn’t really numerical.

How does the computer represent things like alphabetic data, or pictures, for example?

Answer: It still uses bits.

Bytes Computer storage is arranged into

bytes, where each byte is just a group of 8 bits.

A byte is considered the smallest addressable unit of memory, and measurements of memory size or disk capacity are always expressed in terms of bytes.

Bytes are also convenient for representing alphabetic data.

An 8-bit byte can contain any of 28 = 256 different combinations of 0’s and 1’s, like 00000000, or 01101001, or 11111111, for example.

Alphabetic characters are represented in the computer, one byte per character, using ASCII codes.

ASCII Codes

A 01000001B 01000010C 01000011D 01000100Etc.

The codes for the lower-case letters are different, and there are distinct codes for all the other standard characters appearing on the keyboard, including punctuation marks, the space, the carriage return, and the 10 digits. But each of these fits into a single byte.

Everything is stored as bytes Other kinds of data are also

ultimately stored as bytes, using some kind of coded representation.

For example, a single digital image can be represented by specifying what appears (color, intensity, etc.) in each separate pixel (picture element) of the image.

Because there are potentially a very large number of pixels in a high-quality image, it may take many bytes to represent this image.

And, of course, if this is a changing video image, the number of bytes to represent it will be much larger still.

Data Compression One thing that helps reduce the

number of bytes required is the use of data compression.

An example of a data compression program is WinZip.

Another type of data compression is used in .jpg images.

How does data compression work?

To give a simple-minded example, suppose that we wanted to store (or transmit) a sequence of 100 bytes, all of which were identical (say ASCII for the character A).

Instead of using 100 bytes for this, we could use 2 bytes, one representing the number 100 (which is 01100100 in binary) and the other representing the ASCII code for A.

Thus in this case we’ve compressed 100 bytes down to 2.

The general idea behind data compression is to be able to find patterns in the original data which can be encoded in a shorter way.

Uncompressing the data then just requires regenerating the original data from this shorter pattern description.

Programs are in bytes too

Also represented as bytes in the computer are the instructions that make up the executable programs that the CPU runs.

Thus everything in the computer, programs or data, is ultimately just bytes (or bits), as far as the internal workings go at the lowest levels of the electronics.

Fortunately for us, though, as computer users, or even as computer programmers, we don’t have to interact with the computer at this level.

CPU The standard personal computer

(PC) has a single-chip CPU, also called a microprocessor.

Examples of microprocessors found in standard PCs are Intel’s Pentium, Pentium II, Pentium III, and Celeron.

Other manufacturers making Intel-compatible microprocessors are AMD and Cyrix.

Microprocessor speed is typically expressed in terms of the number of “clock cycles” per second, a rough measure of the number of program instructions that can be carried out in each second.

One clock cycle per second would be 1 hertz (Hz).

Actual speeds of current top-end PC microprocessors range from roughly 250-500 megahertz (MHz), which means 250 million to 500 million clock cycles per second.

The higher this number, the faster the processor.

Standard Prefixes Used to Express Various Computer-Related Quantities

Kilo means 103 or 1,000 Mega means 106 or 1,000,000 Giga means 109 or 1,000,000,000 Tera means 1012 or 1,000,000,000,000 Milli means 10-3 or 0.001 Micro means 10-6 or 0.000001 Nano means 10-9 or 0.000000001

Main Memory (RAM) Called random access because any

particular memory location in it is as fast to retrieve data from or store data in as any other.

Furthermore the time it takes is very short, less than 1 millisecond, so accessing data in main memory is very fast.

But the data stored in it only lasts as long as there is power being supplied to the computer.

Typical PCs have 32 or 64 megabytes (MB) of RAM. The more RAM, the faster the computer will seem to run because there is less time spent storing or retrieving the data on disk, which is much slower.

Hard Disk Stores data on spinning magnetic

platters in a sealed enclosure. Typical capacity of a hard disk on a

PC is 1 or more gigabytes (GB). Typical access time for a hard disk

is on the order of 10 milliseconds, on average, which is much slower than the access time for main memory.

Floppy Disk Made of flexible plastic coated with

magnetic material, and enclosed in a hard plastic case.

Its capacity is 1.44 MB, and its average access time is around 175 milliseconds.

Other Auxiliary Storage Devices CD-ROM (Compact Disk, Read-Only

Memory) DVD (Digital Versatile Disk, or

originally Digital Video Disk) Zip Drive Tape Backup Unit

Input Devices Keyboard Mouse Microphone Scanner Digital Camera Joystick

Output Devices Monitor

CRT (cathode ray tube) LCD (liquid crystal display)

Printer Inkjet Laser

Speaker

Software System Software (Operating

System) Application Software

System Software Main function is to maintain the file

system and also to allow application programs to have access to computer input (from the keyboard or mouse, for example) and to create computer output (to the monitor, for example).

Provides an interface between application programs and the hardware itself.

Files and Folders A file is a collection of bytes on the

disk that represents a program or data for use by a program.

Files are organized hierarchically, in a tree structure. Files that contain other files are called folders in Windows 95/98 and directories in older operating systems like DOS and Unix.

Application Programs Application programs represent all

other software that can be run on the computer, to allow the user to do such varied tasks as word processing, playing games, sending email, and browsing the World Wide Web, for example.

These programs are typically obtained from vendors but application programs can also be created by sophisticated users.

Specific application programs we will use in this course are:

Internet Explorer (for web browsing) Word (for word processing) Excel (for spreadsheet manipulation) Access (for database manipulation) PowerPoint (for creating and showing

presentations)