Documente Academic
Documente Profesional
Documente Cultură
1.1 Introduction
A program is a set of instructions that a
computer follows to perform a task.
Tony Gaddis
Copyright 2010 Pearson Addison-Wesley
1.1 Introduction
1-2
1.2 Hardware
Concept:
1-3
1-4
1.2 Hardware
1.2 Hardware
hardware.
1.2 Hardware
1-6
1.2 Hardware
Figure 1-2 The ENIAC computer
(courtesy of U.S. Army Historic Computer Images)
ENIAC
Worlds first programmable
computer
Built in 1945
Designed to calculate artillery
ballistic tables for the U.S. Army
CPU was 8 feet tall, 100 feet
long, and weighed 30 tons
Microprocessor
Much smaller
Much more powerful
1-7
Figure 1-3
A lab technician holds a
modern microprocessor
(photo courtesy of Intel Corporation)
1-8
1.2 Hardware
1.2 Hardware
Main Memory
Type of memory that can hold data for long periods of time.
Programs and important data are stored in secondary storage
1-9
1.2 Hardware
1.2 Hardware
USB drives are small devices that plug into the computers
1-10
1-11
1-12
1.2 Hardware
1.2 Hardware
Input Devices
Output Devices
Any data the computer produces for people or for
other devices is called output.
The hardware component that formats and
presents the data is called an output device.
Common output devices are:
Keyboard
Mouse
Scanner
Microphone
Digital camera
Monitor
Printer
1-13
1-14
Concept:
All data that is stored in a computer is
converted to sequences of 0s and 1s.
1-15
1-16
Storing Numbers
Storing Numbers
For example:
Figure 1-9 Determining the
value of 10011101
1-17
Storing Numbers
Storing Characters
1-18
1-19
1-20
Storing Characters
Negative Integers
Real Numbers
Binary numbering system can be used to represent only
integer numbers, without a fractional part.
Real numbers are encoded using floating-point notation
1-21
1-22
1-23
1-24
1-25
1-26
1-27
1-28
High-Level Languages
An Example
Machine Language
Equivalent Assembly
1000000100100101
1000000101000110
1010000100000110
1000001000000111
1111111111111111
LOAD R1 5
LOAD R2 6
ADD R0 R1 R2
SAVE R0 7
HALT
Z = X + Y;
C++:
1-30
1-31
1-32
1-33
1-34
Concept:
C++ is a high-level programming
language, and the Dark GDK is a
library of prewritten code that can be
used in C++ to write games and
graphical programs.
1-35
1-36
1-37
1-39
1-38
1-40
1-41
Homework Assignment
Read Chapter 1
Find answers to checkpoints
1-43
1-42