Chapter 0

advertisement
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Chapter 0 Objectives
Chapter 0
Introduction to
Computers
and
Programming
Languages
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
Chapter 0 - 1
• After you have read and studied this chapter, you
should be able to
– State briefly a history of computers.
– Name and describe five major components of the
computer.
– Convert binary numbers to decimal numbers and vice
versa.
– State the difference between the low-level and highlevel programming languages.
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
A History of Computers
Computer Architecture
• Charles Babbage is credited as the father of computer.
Although never actually built, he proposed the computing
machines called Difference Engine and Analytical Engine
that possessed the core characteristics of today’s
computers.
• Ada Lovelace, who wrote demonstration programs for
Analytical Engine, is credited as the first programmer.
• The first modern computer was built by Atanasoff of Iowa
State University in the late 1930s.
• An electromechanical computer MARK I was built by
Howard Aiken of Harvard.
• The first completely electronic computer ENIAC I was built
by Mauchly and Eckert of the University of Pennsylvania.
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
© The McGraw-Hill Companies, Inc.
Chapter 0 - 2
Chapter 0 - 3
Output
Output
Devices
Devices
CommuCommunication
nication
Devices
Devices
Input
Input
Devices
Devices
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
RAM
RAM
CPU
CPU
Storage
Storage
Devices
Devices
Chapter 0 - 4
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Decimal Number Representation
Progress of CPU Speed
decimal
point
How
Howthe
thedecimal
decimal
number
numberisisrepresented.
represented.
104
103
102
101
10− 1 10− 2
100
10−3
Position Values
Example:
2
4
102
101
= 2×
For more information on Intel CPUs, click
Intel Museum
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
Chapter 0 - 5
binary
point
22
21
8×
100 +
7 × 10− 1
= 2 × 100 + 4 × 10 + 8 × 1
+ 7 × 1/10
= 200
+ 7 /10 = 248.7
+ 40
+ 8
Chapter 0 - 6
• Three levels of programming languages:
2−1
20
10−1
100
101+
Programming Languages
How
Howthe
thebinary
binarynumber
number
isisrepresented.
represented.
23
+ 4×
7
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
Binary Number Representation
24
102
8
2− 2
2−3
Position Values
– Machine Languages
– Machine language instructions are binary coded and very low level.
Example:
1
0
1
1
2
1
0
2− 1
2
2
2
– Assembly Languages
– Assembly language allows symbolic programming. Requires an
assembler to translate assembly programs into machine programs.
– High-level Languages
= 1 × 22 + 0 × 21 + 1 × 20 + 1 × 2− 1
– High-level language provides a very high conceptual model of
computing. Requires a compiler to translate high-level programs into
assembly programs.
= 1 × 4 + 0 × 2 + 1 × 1 + 1 × 1/2
= 4
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
© The McGraw-Hill Companies, Inc.
+0
+ 1
+ 1/2
=
5.5
Chapter 0 - 7
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
Chapter 0 - 8
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Java
• Java is a high-level object-oriented language
developed by Sun Microsystems.
• Java’s clean design and wide availability make it
an ideal language for teaching the fundamentals of
computer programming.
©The McGraw-Hill Companies, Inc. Permission
required for reproduction or display.
© The McGraw-Hill Companies, Inc.
Chapter 0 - 9
Download