?Brooks/Cole,
2001
C语言40学时Chapter 0
Introduction
To
Computers
Brooks/Cole,
2001
C语言40学时Figure 1-1
Brooks/Cole,
2001
C语言40学时Hardware
The hardware is the physical equipment,It
consists of five parts,(Figure 1-2)
– input devices – keyboard
– central processing unit (CPU)
– primary storage or main memory
– output devices – monitor or printer
– auxiliary or secondary storage devices – used for
both input and output
Brooks/Cole,
2001
C语言40学时Figure 1-2
Brooks/Cole,
2001
C语言40学时
CPU
CPU contains
– arithmetic logic unit,+,-,*,/,and,Or
– control unit,
fetches instructions and data from memory;
executes instructions
puts data back in memory
(when we talk about a 600 MHz( mega-
hertz) Pentium III,we are talking about
how fast the CPU can do these things.)
Brooks/Cole,
2001
C语言40学时
Primary Storage (Main Memory)
The place where data and program are
stored during execution.
It always contains the operating system
Not permanent,Data goes away when
power is off.
Brooks/Cole,
2001
C语言40学时
Auxiliary (Secondary) Storage
It may be permanent,erasable,slower
access than main memory
We will have more study in later
Brooks/Cole,
2001
C语言40学时Figure 1-3
Brooks/Cole,
2001
C语言40学时
Software
The software is the collection of programs
(instructions) that allow the hardware to do
its job,It includes two categories,(Figure
1-3)
– system software,manages the computer
resources and provides the interface between
the hardware and the users.
– application software helps users to solve
their problems directly,
Brooks/Cole,
2001
C语言40学时
System Software
It consists of programs,These
programs are divided into three classes,
– operating system
– system support(provides system utilities
and other operating services)
– system development(the language
translators,debugging tools,computer
assisted software engineering (CASE))
Brooks/Cole,
2001
C语言40学时Figure 1-4
Brooks/Cole,
2001
C语言40学时Figure 1-5
Brooks/Cole,
2001
C语言40学时
High-Level Languages…
it must be converted to machine language,
This process is called compilation.
The examples of high-level languages:
– FORTRAN (1957,John Backus & IBM team)
– COBOL (again by Grade Hopper,business
language)
– BASIC
– Pascal
– Ada
– C,C++,JAVA…
Brooks/Cole,
2001
C语言40学时Figure 1-8
Symbolic(assembly) languages
Brooks/Cole,
2001
C语言40学时Writing,Editing,Compiling,
and Linking Programs
It is the job of the programmer to write the
program and then to turn it into an
executable (machine file),This process
includes three steps:
– 1,Writing and editing the program
– 2,Compiling the program
– 3,Linking the program with the required
library modules
Brooks/Cole,
2001
C语言40学时
Text Editor & Source File
The software used to write programs is
known as a text editor,
After you complete a program,you save
your file to disk,This file will be input to the
compiler; it is known as a source file.
Brooks/Cole,
2001
C语言40学时
Compiler
A program called compiler translates the
information in a source file to machine
language.
Brooks/Cole,
2001
C语言40学时
Linker
The Linker assembles all of these
functions,yours and the system's,into
your final executable program.