Understanding Computer Systems
Understanding Computer Systems
A computer system is a combination of all the components required to process and store data
using a computer. Every computer system is composed of multiple pieces of hardware and
software.
• Hardware is the equipment, or the physical devices, associated with a computer. For example,
keyboards, mice, speakers, and printers are all hardware.
Software is computer instructions that tell the hardware what to do. Software is programs:
instructions written by programmers. This course we focus on the programming process.
Software can be classified as application software or system software. Application software
comprises all the programs you apply to a task—word-processing programs, spreadsheets,
payroll and inventory programs, and even games. System software comprises the programs that
you use to manage your computer, including operating systems such as Windows, Linux, or
UNIX. This book focuses on the logic used to write application software programs, although
many of the concepts apply to both types of software.
You write computer instructions in a computer programming language, such as Visual Basic,
C#, C++, or Java. Just as some people speak English and others speak Japanese, programmers
also write programs in different languages.
Every programming language has rules governing its word usage and punctuation. Th ese rules
are called the language’s syntax.
Unless the syntax is perfect, the computer cannot interpret the programming language instruction
at all. When you write a program, you usually type its instructions using a keyboard. When you
type program instructions, they are stored in computer memory.
After a computer program is stored in memory, it must be translated from your programming
language statements to machine language that represents the millions of on/off circuits within
the computer. Each programming language uses a piece of software, called a compiler or an
interpreter, to translate your program
code into machine language. Machine language is also called binary language, and is
represented as a series of 0s and 1s. The compiler or interpreter that translates your code tells you
if any programming language component has been used incorrectly.
Syntax errors are relatively easy to locate and correct because the compiler or interpreter you use
highlights every syntax error.
Although there are differences in how compilers and interpreters work, their basic function is the
same—to translate your programming statements into code the computer can use. When you use
a compiler, an entire program is translated before it can execute; when you use an interpreter,
each instruction is translated just prior to execution. Usually, you do not choose which type of
translation to use—it depends on the programming language. However, there are some languages
for which both compilers and interpreters are available. Only after program instructions are
successfully translated to machine code can the computer carry out the program instructions.
When instructions are carried out, a program runs, or executes. In a typical program, some input
will be accepted, some processing will occur, and results will be output
Even though you have used the English language syntax correctly, the cake-baking instructions
are out of sequence, some instructions are missing, and some instructions belong to procedures
other than baking a cake.
If you misspell a programming language word, you commit a syntax error, but if you use an
otherwise correct word that does not make sense in the current context, programmers say you
have committed a semantic error. Either way, the program will not execute.
Understanding the Program
Development Cycle
A programmer’s job involves writing instructions (such as those in the doubling program in the
preceding section), but a professional programmer usually does not just sit down at a computer
keyboard and start typing. Figure 1-1 illustrates the program development cycle, which can be
broken down into at least seven steps:
1. Understand the problem.
2. Plan the logic.
3. Code the program.
4. Use software (a compiler or interpreter) to translate the
program into machine language.
5. Test the program.
6. Put the program into production.
7. Maintain the program.