You are here: Home » Content » Hardware and Software

Hardware and Software

Module by: Dr. Duong Tuan Anh

A computer is a device capable of performing computations and making logical decisions at speeds millions and even billions of times faster than human beings can. For example, many of today’s personal computers can perform hundreds of millions of additions per second.
Computers process data under the control of sets of instructions called computer programs. These computer programs guide the computer through orderly sets of actions specified by people called computer programmers.
A computer is comprised of various devices (such as the keyboard, screen, “mouse”, disks, memory, CD-ROM and processing units) that are referred to as hardware. The computer programs that run on a computer are referred to as software.

Computer Hardware

Almost every computer may be seen as being divided into six logical units. Figure 1 illustrates the main computer components.

Input Unit

This unit obtains information from various input devices and places this information at the disposal of the other units so that the information may be processed. The information is entered into computers today through keyboards and mouse devices.

Output Unit

This unit takes information that has been processed by the computer and places it on various output devices to make information available for use outside the computer. Most output from computer today is displayed on screens, printed on paper, or used to control other devices.

Memory Unit

The memory unit stores information. Each computer contains memory of two main types: RAM and ROM.
RAM (random access memory) is volatile. Your program and data are stored in RAM when you are using the computer.
Figure 1: Basic hardware units of a computer.
ROM (read only memory) contains fundamental instructions that cannot be lost or changed by the user. ROM is non-volatile.

Arithmetic and Logic Unit (ALU)

The ALU performs all the arithmetic and logic operations. Ex: addition, subtraction, comparison, etc.

Central Processing Unit (CPU)

The unit supervises the overall operation of the computer. The CPU tells the input unit when information should be read into the memory unit, tell the ALU when information from the memory should be used in calculations and tells the output unit when to send information from the memory unit to certain output devices.

Secondary Storage

Secondary storage devices are used to be permanent storage area for programs and data.
Virtually all secondary storage is now done on magnetic tapes, magnetic disks and CD-ROMs.
A magnetic hard disk consists of either a single rigid platter or several platters that spin together on a common spindle. A movable access arm positions the read and write mechanisms over, but not quite touching, the recordable surfaces. Such a configuration is shown in Figure 2.
Figure 2: The internal structure of a magnetic hard disk drive.

Computer Software

A computer program is a set of instructions used to operate a computer to produce a specific result.
Another term for a program or a set of programs is software, and we use both terms interchangeably throughout the text.
Writing computer programs is called computer programming.
The languages used to create computer programs are called programming languages.
To understand C++ programming, it is helpful to know a little background about how current programming languages evolved.

Machine and Assembly Languages

Machine languages are the lowest level of computer languages. Programs written in machine language consist of entirely of 1s and 0s.
Programs in machine language can control directly to the computer’s hardware.
00101010 000000000001 000000000010
10011001 000000000010 000000000011
A machine language instruction consists of two parts: an instruction part and an address part.
The instruction part (opcode) is the leftmost group of bits in the instruction and tells the computer the operation to be performed.
The address part specifies the memory address of the data to be used in the instruction.
Assembly languages perform the same tasks as machine languages, but use symbolic names for opcodes and operands instead of 1s and 0s.
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
Since computers can only execute machine language programs, an assembly language program must be translated into a machine language program before it can be executed on a computer.
Figure 3: Assembly language program must be translated.
Machine languages and assembly languages are called low-level languages since they are closest to computer hardware.

High-level Programming Languages

High-level programming languages create computer programs using instructions that much easier to understand than machine or assembly language instructions.
Programs written in a high-level language must be translated into a low level language using a program called a compiler.
A compiler translates programming code into a low-level format.
High-level languages allow programmers to write instructions that look like every English sentences and commonly used mathematical notations.
Each line in a high-level language program is called a statement.
Ex: Result = (First + Second)*Third.
Once a program is written in a high-level language, it must also be translated into the machine language of the computer on which it will be run. This translation can be accomplished in two ways.
When each statement in a high-level source program is translated individually and executed immediately upon translation, the programming language used is called an interpreted language, and the program doing the translation is called an interpreter.
When all of the statements in a high-level source program are translated as a complete unit before any one statement is executed, the programming language used is called is called a compiled language. In this case, the program doing the translation is called a compiler.

Application and System Software

Two types of computer programs are: application software and system software.
Application software consists of those programs written to perform particular tasks required by the users.
System software is the collection of programs that must be available to any computer system for it to operate.
The most important system software is the operating system. Examples of some well-known operating systems include MS-DOS, UNIX, and MS WINDOWS. Many operating systems allow user to run multiple programs. Such operating systems are called multitasking systems.
Beside operating systems, language translators are also system softwares.

Comments, questions, feedback, criticisms?

Send feedback