1. Computer Hardware

1.1 Basic Components

• A computer has the basic properties,

stores data

processing data

Inputs and outputs data

The components of a computer are,

The Central Processing Unit (CPU),

Control Unit: processes machine language instructions

Arithmetic Logic Unit: performs mathematical operations faster by using specialized hardware

Cache: most new computers incorporate a local block of memory which is faster than remote memory. A copy of remote memory is stored here so that the CPU may work faster

Memory,

Random Access Memory (RAM): memory used for temporary storage of programs and data while the computer is on.

Read Only Memory (ROM): permanent software and data is stored in ROM, so that the CPU may always access this. A common use for this is a ‘start-up’ routine, which allows a computer to load the operating system off of a disk.

ROM (traditional): a chip which is made to store the program, this may not be changed.

PROM: a chip which the program may be ‘burned’ into once.

EPROM: memory is ‘burned’ in, but may be erased using ultraviolet light, and rewritten.

EEPROM: similar to EPROM, but may be electrically erased.

Input/Output (I/O),

Load and Store programs and data,

optical and magnetic disk drives

magnetic tapes

etc.

Communicate with users

CRT driver

keyboard

mouse

printer

Communicate with process

RS-232 data lines

1.1.1 Some I/O Devices

• Teleprinters or Teletypes

this technology is becoming obsolete very fast, but may be useful when permanent records of sessions

inexpensive but slow

can be operated at a distance by telephone

allows user input by keyboard, and output on printed paper

• Cathode Ray Tube (CRT)

the preferred display device

very flexible and user friendly

Inexpensive and fast

Available in color, and varying sizes

used for graphical and text output

can be used with features such as touch screen input for harsh factory floor environments

• Card Readers and Card Punches

outdated technology which allowed permanent recording of user entry on punched cards

• Printers

Very popular method of permanent output

Inexpensive and fast

Can produce varying qualities of print

color printers available

letter size paper output most common

• Magnetic and Optical Disks and Tapes

Inexpensive methods for transferring and storing data and programs

storage capacity ranges from Kilobytes to Gigabytes, and capacities are increasing quickly

Some are read and write only

costs are very low per Megabyte, and are still dropping

Storage media is still somewhat fragile, and requires certain level of protection

Older tapes and systems are oriented towards backup, but newer methods allow random access.

• mouse/button boxes/dial boxes/tablets/etc

Various input peripherals make input easier

very inexpensive

most allow continuous input more suited to user

allows more complex programs for user interaction

the mouse has become the most popular input device

most of these devices are not suited for the factory floor

• keyboard

the time honored standard for input

now very inexpensive, used by almost all computers

can be used by all people, and is universally understood

• Special Application Boards

becoming very inexpensive, and common

A/D and D/A boards allow interfacing to applications which are monitored and/or controlled by analog signals (these are very inexpensive). These are the main source of interface to Sensors

Video processing: allows video camera inputs to be read into memory, and the still pictures may then be used for vision processing.

1.2 A Microcomputer in Manufacturing Example

• PLC’s are an example of a microcomputer used for industrial control

• The basic components in a PLC are,

CPU

RAM to store working variables, statuses, etc.

ROM to store the operating system, and programs for interpreting ladder logic, programming, etc.

A/D, D/A: To input and output analog signals from the PLC, these I/O devices are used

PIA (Parallel Interface Adapter): used to drive parallel data lines for digital I/O. These lines are used for detecting switch closures, driving relays for outputs, turning indicator lights on and off, etc.

ACIA (Asynchronous Communications Interface Adaptor): used to drive RS-232 ports (or other serial ports) for interface.

1.3 Commercial Computers

1.3.1 Mainframes

Uses a large, and custom designed CPU, in big cabinets

Large, expensive, and require special housing

Require specialized personnel to run and program

Ideal for systems which support many user sharing data and services, such as an accounting system, or database

Software may be expensive and hard to maintain

Graphical user interfaces are limited

Approximate cost > $100,000

Common example are VAX mainframes

1.3.2 Super Computers

Completely customized hardware, optimized for numerical (primarily vectored and floating point) calculations

Suited to huge numerical problems

Often requires a front-end computer for job queueing, post-processing, and pre-processing

Tremendous cost > $1,000,000

One example is the CRAY line of computers

Often uses parallel and distributed processors, along with nitrogen (or similar) cooling systems

Very limited spectrum of users

1.3.3 Workstations

Computers based on leading edge of microprocessor technology, using Enhanced graphical display capabilities.

These have displaced minicomputers, and created a market for users who have small budgets but need reasonable computer power.

Run faster than PC’s, had better price/performance ratio

suited to networking, shared disks, and virtual memory

Perform multiprocessing, thus suited to multiple users.

Approximate cost $10,000 to $500,000

Example are SUN, HP, and Silicon Graphics Workstations

Can often find software intended for mainframes, and for Personal Computers which has been modified to run on Workstations.

Has the widest collection of public domain software available.

1.3.4 Personal Computers

Smaller, single user machines based on microprocessors, with some graphics capabilities.

Very inexpensive from $500 to $10,000

Some models are Apple Macintosh, IBM PC, etc

Have very inexpensive software

Style range such as desk-top, lap-top, factory hardened.

Have the widest range of commercial software and hardware available.

Excellent for real time control, and simple user interfaces.

1.3.5 Dedicated Computers

A number of computers have been built into machines.

These computers are dedicated to one operation, such as an NC controller, a PLC, A Plastic Injection Machine Controller, computer printer, etc.

Very well debugged, and easy to use

Requires some specialized user training.

Cost is included in cost of equipment, and has effect of lowering costs over relay controlled systems.

May have simple interfaces for connections to other computers.

1.3.6 Single Board Computers

A computer with little or no user interface hardware (often only 1 RS-232 port) is provided.

The previous standard for control.

Very inexpensive, from $50 to $1000

Requires Assembly Language Programming

May come with I/O for digital, analog, serial, or other communication task.

Hard to implement and debug

1.4 Architecture and Buses

• All of the components are tied together by computer buses.

• There are a number of separate buses in a computer,

Address Bus,

carries locations from the CPU, so that the proper RAM, ROM, and I/O locations may be addressed
This is often 16 bits, but newer computers have moved to 32 an 64 bits.
The size of this bus limits immediately available memory.

Data Bus,

Carries data to and from the CPU and RAM, ROM, and I/O devices.
The size of this bus makes the difference when specifying whether the CPU is 8 bit, 16 bit, 32 bit, or 64 bit.
A wider data bus allows the CPU to run faster, but the hardware is more complex

Control Bus,

Runs between all devices, and is used to direct reads, writes, data ready, address ready, interrupts, and a number of other signals.

• The bus structure of a computer may be as below,

1.4.1 Clock Speed and the Buses

• Clock speed determined how often the CPU will process instructions

• Each instruction will use a variable number of clock cycles. For example a get from memory will take longer than a binary or operation.

• Different CPU’s may use anywhere from 5 to a fraction of a clock cycle to process an instruction

• The bus speeds are limited by

the physical layout of the board,

memory speed

CPU speed (which is related to clock speed)

• Each instruction for the CPU is made up of a variable number of bytes. These are loaded from memory during execution. In an 8 bit bus these are loaded 1 at a time. To speed this up wider buses are used. For example a 64 bit bus could probably load up to 8 instructions at one. This allows instructions to be stored and processed faster, and overcome the bus speed limitations of computers.

• Other Computers use a trick called caching to speed the computer. This uses a shorter bus to local memory which may be run at higher speeds, thus reducing the slower access to distant memory.

1.5 Software

• The software drives the computer to perform some useful function

• Two main types of programs,

Interpreted,

Program is stored as text (or equivalent), and each instruction is read, and interpreted as the program is running.
Can be very slow
Easier to write operating systems
Suited to simple programming languages
BASIC is a popular interpreted language.

Compiled,

Programs are converted, and stored in machine language before execution.
Runs very fast
Can allow very advanced debugging tools
Programming can be complex
Easier to protect copyrights
FORTRAN and C are good examples of compiled languages.

• Programs may be divided into a number of various categories,

Operating Systems

Software which provides fundamental services for the computer, such as running printers, user accounting, etc.
Can be very large
Required for any computer to operate
Acts as a go between for the programs and the hardware
Popular Operating systems are UNIX, MS-DOS, VMS, NOS.

Micro-code

This is a program which the engineers write to control the CPU when it is initially designed.
This is not seen by a user.
Tells CPU how to deal with instructions

Machine Language

Written in the lowest level of language available to the user
These programs are very fast and efficient.
These programs are difficult to write.

Graphical User Interface,

A program which makes extensive use of graphical abilities to interact with the user.

- Requires a powerful computer

Can be slow, and use up to 90% of CPU time
Makes programs very easy to use by novices
Requires greatly increased development time for software
Good examples of these programs are Lotus 1-2-3, Autocad, Microsoft Windows, WordPerfect, SDRC Ideas, etc.

Utility (for want of a better word),

Simple programs for individual tasks such as file format conversion.
small in size, and easy to use

Scientific, Mathematical, etc.

Use large amounts of CPU time for mathematical calculations
Very problem specific
Requires specialized knowledge
Very expensive
Requires powerful computer

Scripts, Batch Files, etc.

Often interpreted files which instruct the operating system in task such as installing software, running nightly backups, etc.
Written in ASCII with simple English like commands
Example of these are ‘autoexec.bat’ files in MS-DOS, and ‘.login’ files in UNIX.

etc.