SlideShare a Scribd company logo
Starting out with Programming Logic and
Design
Sixth Edition
Chapter 1
Introduction to Computers
and Programming
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.1 Introduction (1 of 4)
• People use computers at…
– School for writing papers, research, email, online
classes, etc.
– Work for analyzing data, make presentations,
business transactions, communicating, control
machines, etc.
– Home for paying bills, shopping online,
communicating, playing computer games, etc.
What are some of the ways you use computers?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.1 Introduction (2 of 4)
• Devices that are computers…
– SmartPhones
– MP3 Players
– Tablets
– Car navigation system (GPS)
Can you think of some other devices that are
computers?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.1 Introduction (3 of 4)
• Computers are designed to do any job that their
programs tell them to do.
• A program is a set of instructions that a computer follows
to perform a task.
For example: Microsoft Word and PowerPoint
• Programs are commonly referred to as software.
What software have you used?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.1 Introduction (4 of 4)
• Programmers or Software Developers are the
individuals that create computer software.
• They have the training and skill to design, create, and
test computer programs.
What are some of the fields in which computer
programs are used?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (1 of 18)
Concept:
The physical devices that a computer is made of are
referred to as the computer’s hardware. The programs that
run on a computer are referred to as software.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (2 of 18)
Hardware
• The physical devices that a computer is made of are
referred to as the computer’s hardware.
• A computer is a system of devices that work together.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (3 of 18)
Hardware
A Computer System
consists of:
• Central Processing Unit
(CPU)
• Main memory
• Secondary storage
• Input devices
• Output devices
Figure 1-2 Typical components
of a computer system
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (4 of 18)
Hardware
Central Processing Unit (CPU)
• The CPU is the part of a computer that runs the
programs.
• Often referred to as the processor.
• Without a CPU, a computer cannot run software.
Running or executing a program is the term used when
the computer performs the tasks that the program tells it to
do.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (5 of 18)
Hardware
ENIAC
• World’s 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
Figure 1-3 The ENIAC
computer (courtesy of U.S.
Army Historic Computer
Images)
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (6 of 18)
Microprocessor
• Much smaller
• Much more powerful
Figure 1-4 A lab technician holds a
modern microprocessor (photo
courtesy of Intel Corporation)
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (7 of 18)
Main Memory
• Considered the computer’s work area
• Computer stores the program that is running as well as the
data
• Commonly known as the random-access memory (RAM)
• Data is quickly accessed
• RAM is a volatile type of memory
• Used for temporary storage
• RAM is erased when computer is turned off
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (8 of 18)
• Read-Only Memory (ROM)
– A computer can read the contents of ROM, but it
cannot change its contents, or store additional data
there.
– ROM is nonvolatile. It does not lose its contents,
even when the computer’s power is turned off.
– ROM is typically used to store programs that are
important for the system’s operation. For example, the
computer’s startup program, which is executed each
time the computer is started.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (9 of 18)
Secondary Storage Devices
• Type of memory that can hold data for long periods of time.
• Programs and important data are stored in secondary storage
• Disk drive is a common type of secondary storage
– Data is stored by magnetically encoding it onto a
circular disk
– Most computers have an internal disk drive
– Some have external disk drives; they are used to create
backup copies
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (10 of 18)
• Solid-State drives are becoming increasingly popular
– Does not contain a disk. Instead, it stores data in
solid-state memory
– No moving parts
– Operates faster than a traditional disk drive
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (11 of 18)
• USB drives are small devices that plug into the
computer’s universal serial bus (USB) port
– It does not contain a disk
– The data is stored on flash memory
– Also known as memory sticks and flash drives
– Inexpensive, reliable, and small
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (12 of 18)
• Optical devices (CD or DVD)
– Data is encoded as a series of pits on the disc’s
surface
– Uses laser to encode the data
– Holds large amounts of data
– Good medium for creating backups
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (13 of 18)
• Cloud Storage
– When you store data in the cloud, you are storing it
on a remote server via the internet, or via a
company’s private network.
– You can access it from many different devices, and
from any location where you have a network
connection.
– Can also be used to backup important data that is
stored on a computer’s disk.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (14 of 18)
Input Devices
• Any data the computer collects from people and from other devices is called
input.
• The hardware component that collects the data is called an input device.
• Common input devices are:
– Keyboard
– Mouse
– Touch screen
– Scanner
– Microphone
– Digital camera
Can you think of any other input devices?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (15 of 18)
Ouput 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:
– monitor
– printer
Can you think of any other output devices?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (16 of 18)
Software
• Everything a computer does is controlled by software.
• Two categories of software:
– System software
– Application software
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (17 of 18)
System Software
• Programs that control and manage the basic operations of a
computer are referred to as system software.
• Includes the following types:
– Operating System controls the internal operations of the
computer’s hardware and manages all of the devices
connected to the computer.
– Utility Programs perform a specialized task that
enhances the computer’s operation or safeguards data.
– Software Developments Tools are programs that are
used to create, modify, and test software.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.2 Hardware and Software (18 of 18)
Application Software
• Programs that people normally spend most of their time
running on their computers performing everyday tasks are
referred to as application software.
• For example:
– Word processing
– Spreadsheet
– Database
– Presentation
Can you think of any other application software?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (1 of 9)
Concept:
All data that is stored in a computer is converted to
sequences of 0s and 1s.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (2 of 9)
• A computer’s memory is divided into tiny storage locations known as bytes
• One byte represents one number
• A byte is divided into eight smaller storage locations known as bits (binary
digits)
• Bits are tiny electrical components that can hold either a positive or a
negative charge.
• A positive charge is similar to a switch in the on position
• A negative charge is similar to a switch in the off position
Figure 1-6 Think of a byte as eight
switches
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (3 of 9)
Storing Numbers
• The positive charge or the on position is represented by the digit 1
• The negative charge or the off position is represented by the digit 0
• This corresponds to the binary numbering system where all numeric
values are written as a sequence of 0s and 1s
• Each digit in a binary number has a value assigned to it
Figure 1-8 The values of binary digits as
powers of 2
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (4 of 9)
For example:
Figure 1-10 Determining the
value of 10011101
Figure 1-11 The bit pattern for
157
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (5 of 9)
• The largest value that can be stored in a byte with eight
bits is 255
• Two bytes are used for larger numbers; maximum value
is 65535
Figure 1-12 Two bytes used for a large number
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (6 of 9)
Storing Characters
• Characters are stored in the computer’s memory as
binary number
• ASCII (American Standard Code for Information
Interchange) is a coding scheme
Figure 1-13 The letter A is stored in memory as the number 65
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (7 of 9)
• ASCII is a set of 128 numeric codes
• ASCII is limited
• Unicode is an extensive encoding scheme
– It is compatible with ASCII
– It represents characters for many languages in the
world
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (8 of 9)
Advanced Number Storage
• Binary numbering system can be used to represent only
integer numbers
• Negative numbers are encoded using two’s
complement
• Real numbers are encoded using floating-point
notation
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.3 How Computers Store Data (9 of 9)
Other Types of Data
• Digital data is data that is stored in binary
• A digital device is any device that works with binary data
• Digital images are composed of tiny dots of color known
as pixels (picture elements)
• Digital sound is broken into small pieces known as
samples
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (1 of 12)
Concept:
A computer’s CPU can only understand instructions that
are written in machine language. Because people find it
very difficult to write entire programs in machine language,
other programming languages have been invented.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (2 of 12)
• CPU is the most important component in a computer
• CPU is not a brain
• CPU is not smart
• CPU is an electronic device that is designed to do
specific things.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (3 of 12)
CPU is designed to perform the following operations:
• Read a piece of data from main memory
• Adding two numbers
• Subtracting one number from another number
• Multiplying two numbers
• Dividing one number by another number
• Moving a piece of data from one memory location to another
• Determining whether one value is equal to another value
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (4 of 12)
• CPU only understands instructions written in machine
language
• Machine language instructions are written in 1s and 0s
• The entire set of instructions that a CPU can execute is
known as the CPU’s instruction set
• Each brand of microprocessors (Intel, AMD, and
Motorola) has a unique instruction set
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (5 of 12)
• Fetch-decode-execute
cycle is the term used
when the CPU executes
the instructions in a
program.
• The cycle consist of
three steps:
– Fetch
– Decode
– Execute
Figure 1-16 The fetch-decode-
execute cycle
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (6 of 12)
From Machine Language to Assembly Language
• Computers only understand machine language
• Machine language is difficult to write
• Assembly language uses short words that are known as
mnemonics
• Assembler is used to translate an assembly language
program to machine language
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (7 of 12)
Figure 1-17 An assembler translates an assembly language program
to a machine language program
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (8 of 12)
High-Level Languages
• Assembly language is referred to as a low-level
language High-level languages allow you to create
powerful and complex programs without knowing how the
CPU works, using words that are easy to understand.
For example:
Java, C++, Python, Visual Basic, C# , Ada, Fortran
Do you know of any other high-level computer
programming languages?
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (9 of 12)
Key Words, Operators, and Syntax: an Overview
• Key words or reserved words have specific meaning
and purpose in the programming language
• Operators perform various operations on data
• Syntax is a set of rules that must be strictly followed
when writing a program
• Statements are individual instructions written in a
programming language
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (10 of 12)
Compilers and Interpreters
• The statements written in a high-level language are
called source code or simply code
• Source code is translated to machine language using a
compiler or an interpreter
• Syntax error is a mistake such as a:
– Misspelled word
– Missing punctuation character
– Incorrect use of an operator
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (11 of 12)
• Compiler is a program that translates a high-level
language program into a separate machine language
program
Figure 1-18 Compiling a high-level program and executing it
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.4 How a Program Works (12 of 12)
• An interpreter is a program that both translates and
executes the instructions in a high-level language
program
Figure 1-19 Executing a high-level program with an interpreter
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
1.5 Types of Software
Programs generally fit into one of two categories
• System software
– The set of programs that control or enhance the
operation of a computer such as an Operating
System, Utility Programs, or Software Development
Tools.
• Application software
– Programs that make a computer useful for every day
tasks such as Microsoft Word, email programs, and
Web browsers.
Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
Copyright

More Related Content

PPTX
Welcome to Basics
PDF
THIS IS AN ICT NOTES MEANT TO EDUCATE,AND ADVANCE READ
PPTX
lesson_1_Introduction_to_computers_pptx.pptx
PPTX
lesson_1_Introduction_to_computers_pptx.pptx
PPTX
lesson_1_Introduction_to_computers_pptx.pptx
PDF
Computer and its application
PPTX
baisc of Computer System part 1 doe clas
PPTX
Lesson 1 introduction to computers
Welcome to Basics
THIS IS AN ICT NOTES MEANT TO EDUCATE,AND ADVANCE READ
lesson_1_Introduction_to_computers_pptx.pptx
lesson_1_Introduction_to_computers_pptx.pptx
lesson_1_Introduction_to_computers_pptx.pptx
Computer and its application
baisc of Computer System part 1 doe clas
Lesson 1 introduction to computers

Similar to ch01_Intro to Computer & Programming.pdf (20)

PPTX
lesson_1_Introduction_to_computers_pptx.pptx
PPT
Wk 2 - computers
PPTX
Computer Basics Tutorial By Stud Mentor
PPTX
Basics of computer
PPT
What is computer Introduction to Computing
PPT
whatiscomputer-By Arun kumar
PPT
Introduction what is computer
PPTX
Lecture 1.pptx
PDF
Basic Computer organisation class 11th presentation for any program
PPT
Computer application
PPT
Discovering Computers, Living with digital world.ppt
PPT
Introduction to Computer MBA SEM I - Copy (4).ppt
PPTX
Chapter 01.pptx
PPTX
Introduction to problem solving c language university btech first semester.pptx
PDF
2. GE Elect 1 BSHM - Hardware Module.pdf
PPTX
Lec#1 (1)
PPTX
Computer application in business
PPTX
computer funda.pptx
PPTX
CHAPTER 1 INTRODUCTION TO COMPUTERS GRADE 8 and 9.pptx
lesson_1_Introduction_to_computers_pptx.pptx
Wk 2 - computers
Computer Basics Tutorial By Stud Mentor
Basics of computer
What is computer Introduction to Computing
whatiscomputer-By Arun kumar
Introduction what is computer
Lecture 1.pptx
Basic Computer organisation class 11th presentation for any program
Computer application
Discovering Computers, Living with digital world.ppt
Introduction to Computer MBA SEM I - Copy (4).ppt
Chapter 01.pptx
Introduction to problem solving c language university btech first semester.pptx
2. GE Elect 1 BSHM - Hardware Module.pdf
Lec#1 (1)
Computer application in business
computer funda.pptx
CHAPTER 1 INTRODUCTION TO COMPUTERS GRADE 8 and 9.pptx
Ad

Recently uploaded (20)

PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Types and Its function , kingdom of life
PDF
Computing-Curriculum for Schools in Ghana
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
1_English_Language_Set_2.pdf probationary
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PPTX
Lesson notes of climatology university.
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
IGGE1 Understanding the Self1234567891011
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
Complications of Minimal Access Surgery at WLH
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Types and Its function , kingdom of life
Computing-Curriculum for Schools in Ghana
A powerpoint presentation on the Revised K-10 Science Shaping Paper
1_English_Language_Set_2.pdf probationary
Chinmaya Tiranga quiz Grand Finale.pdf
Unit 4 Skeletal System.ppt.pptxopresentatiom
Lesson notes of climatology university.
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
History, Philosophy and sociology of education (1).pptx
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
IGGE1 Understanding the Self1234567891011
Indian roads congress 037 - 2012 Flexible pavement
Complications of Minimal Access Surgery at WLH
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Ad

ch01_Intro to Computer & Programming.pdf

  • 1. Starting out with Programming Logic and Design Sixth Edition Chapter 1 Introduction to Computers and Programming Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved
  • 2. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.1 Introduction (1 of 4) • People use computers at… – School for writing papers, research, email, online classes, etc. – Work for analyzing data, make presentations, business transactions, communicating, control machines, etc. – Home for paying bills, shopping online, communicating, playing computer games, etc. What are some of the ways you use computers?
  • 3. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.1 Introduction (2 of 4) • Devices that are computers… – SmartPhones – MP3 Players – Tablets – Car navigation system (GPS) Can you think of some other devices that are computers?
  • 4. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.1 Introduction (3 of 4) • Computers are designed to do any job that their programs tell them to do. • A program is a set of instructions that a computer follows to perform a task. For example: Microsoft Word and PowerPoint • Programs are commonly referred to as software. What software have you used?
  • 5. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.1 Introduction (4 of 4) • Programmers or Software Developers are the individuals that create computer software. • They have the training and skill to design, create, and test computer programs. What are some of the fields in which computer programs are used?
  • 6. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (1 of 18) Concept: The physical devices that a computer is made of are referred to as the computer’s hardware. The programs that run on a computer are referred to as software.
  • 7. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (2 of 18) Hardware • The physical devices that a computer is made of are referred to as the computer’s hardware. • A computer is a system of devices that work together.
  • 8. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (3 of 18) Hardware A Computer System consists of: • Central Processing Unit (CPU) • Main memory • Secondary storage • Input devices • Output devices Figure 1-2 Typical components of a computer system
  • 9. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (4 of 18) Hardware Central Processing Unit (CPU) • The CPU is the part of a computer that runs the programs. • Often referred to as the processor. • Without a CPU, a computer cannot run software. Running or executing a program is the term used when the computer performs the tasks that the program tells it to do.
  • 10. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (5 of 18) Hardware ENIAC • World’s 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 Figure 1-3 The ENIAC computer (courtesy of U.S. Army Historic Computer Images)
  • 11. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (6 of 18) Microprocessor • Much smaller • Much more powerful Figure 1-4 A lab technician holds a modern microprocessor (photo courtesy of Intel Corporation)
  • 12. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (7 of 18) Main Memory • Considered the computer’s work area • Computer stores the program that is running as well as the data • Commonly known as the random-access memory (RAM) • Data is quickly accessed • RAM is a volatile type of memory • Used for temporary storage • RAM is erased when computer is turned off
  • 13. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (8 of 18) • Read-Only Memory (ROM) – A computer can read the contents of ROM, but it cannot change its contents, or store additional data there. – ROM is nonvolatile. It does not lose its contents, even when the computer’s power is turned off. – ROM is typically used to store programs that are important for the system’s operation. For example, the computer’s startup program, which is executed each time the computer is started.
  • 14. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (9 of 18) Secondary Storage Devices • Type of memory that can hold data for long periods of time. • Programs and important data are stored in secondary storage • Disk drive is a common type of secondary storage – Data is stored by magnetically encoding it onto a circular disk – Most computers have an internal disk drive – Some have external disk drives; they are used to create backup copies
  • 15. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (10 of 18) • Solid-State drives are becoming increasingly popular – Does not contain a disk. Instead, it stores data in solid-state memory – No moving parts – Operates faster than a traditional disk drive
  • 16. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (11 of 18) • USB drives are small devices that plug into the computer’s universal serial bus (USB) port – It does not contain a disk – The data is stored on flash memory – Also known as memory sticks and flash drives – Inexpensive, reliable, and small
  • 17. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (12 of 18) • Optical devices (CD or DVD) – Data is encoded as a series of pits on the disc’s surface – Uses laser to encode the data – Holds large amounts of data – Good medium for creating backups
  • 18. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (13 of 18) • Cloud Storage – When you store data in the cloud, you are storing it on a remote server via the internet, or via a company’s private network. – You can access it from many different devices, and from any location where you have a network connection. – Can also be used to backup important data that is stored on a computer’s disk.
  • 19. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (14 of 18) Input Devices • Any data the computer collects from people and from other devices is called input. • The hardware component that collects the data is called an input device. • Common input devices are: – Keyboard – Mouse – Touch screen – Scanner – Microphone – Digital camera Can you think of any other input devices?
  • 20. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (15 of 18) Ouput 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: – monitor – printer Can you think of any other output devices?
  • 21. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (16 of 18) Software • Everything a computer does is controlled by software. • Two categories of software: – System software – Application software
  • 22. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (17 of 18) System Software • Programs that control and manage the basic operations of a computer are referred to as system software. • Includes the following types: – Operating System controls the internal operations of the computer’s hardware and manages all of the devices connected to the computer. – Utility Programs perform a specialized task that enhances the computer’s operation or safeguards data. – Software Developments Tools are programs that are used to create, modify, and test software.
  • 23. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.2 Hardware and Software (18 of 18) Application Software • Programs that people normally spend most of their time running on their computers performing everyday tasks are referred to as application software. • For example: – Word processing – Spreadsheet – Database – Presentation Can you think of any other application software?
  • 24. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (1 of 9) Concept: All data that is stored in a computer is converted to sequences of 0s and 1s.
  • 25. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (2 of 9) • A computer’s memory is divided into tiny storage locations known as bytes • One byte represents one number • A byte is divided into eight smaller storage locations known as bits (binary digits) • Bits are tiny electrical components that can hold either a positive or a negative charge. • A positive charge is similar to a switch in the on position • A negative charge is similar to a switch in the off position Figure 1-6 Think of a byte as eight switches
  • 26. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (3 of 9) Storing Numbers • The positive charge or the on position is represented by the digit 1 • The negative charge or the off position is represented by the digit 0 • This corresponds to the binary numbering system where all numeric values are written as a sequence of 0s and 1s • Each digit in a binary number has a value assigned to it Figure 1-8 The values of binary digits as powers of 2
  • 27. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (4 of 9) For example: Figure 1-10 Determining the value of 10011101 Figure 1-11 The bit pattern for 157
  • 28. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (5 of 9) • The largest value that can be stored in a byte with eight bits is 255 • Two bytes are used for larger numbers; maximum value is 65535 Figure 1-12 Two bytes used for a large number
  • 29. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (6 of 9) Storing Characters • Characters are stored in the computer’s memory as binary number • ASCII (American Standard Code for Information Interchange) is a coding scheme Figure 1-13 The letter A is stored in memory as the number 65
  • 30. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (7 of 9) • ASCII is a set of 128 numeric codes • ASCII is limited • Unicode is an extensive encoding scheme – It is compatible with ASCII – It represents characters for many languages in the world
  • 31. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (8 of 9) Advanced Number Storage • Binary numbering system can be used to represent only integer numbers • Negative numbers are encoded using two’s complement • Real numbers are encoded using floating-point notation
  • 32. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.3 How Computers Store Data (9 of 9) Other Types of Data • Digital data is data that is stored in binary • A digital device is any device that works with binary data • Digital images are composed of tiny dots of color known as pixels (picture elements) • Digital sound is broken into small pieces known as samples
  • 33. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (1 of 12) Concept: A computer’s CPU can only understand instructions that are written in machine language. Because people find it very difficult to write entire programs in machine language, other programming languages have been invented.
  • 34. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (2 of 12) • CPU is the most important component in a computer • CPU is not a brain • CPU is not smart • CPU is an electronic device that is designed to do specific things.
  • 35. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (3 of 12) CPU is designed to perform the following operations: • Read a piece of data from main memory • Adding two numbers • Subtracting one number from another number • Multiplying two numbers • Dividing one number by another number • Moving a piece of data from one memory location to another • Determining whether one value is equal to another value
  • 36. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (4 of 12) • CPU only understands instructions written in machine language • Machine language instructions are written in 1s and 0s • The entire set of instructions that a CPU can execute is known as the CPU’s instruction set • Each brand of microprocessors (Intel, AMD, and Motorola) has a unique instruction set
  • 37. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (5 of 12) • Fetch-decode-execute cycle is the term used when the CPU executes the instructions in a program. • The cycle consist of three steps: – Fetch – Decode – Execute Figure 1-16 The fetch-decode- execute cycle
  • 38. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (6 of 12) From Machine Language to Assembly Language • Computers only understand machine language • Machine language is difficult to write • Assembly language uses short words that are known as mnemonics • Assembler is used to translate an assembly language program to machine language
  • 39. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (7 of 12) Figure 1-17 An assembler translates an assembly language program to a machine language program
  • 40. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (8 of 12) High-Level Languages • Assembly language is referred to as a low-level language High-level languages allow you to create powerful and complex programs without knowing how the CPU works, using words that are easy to understand. For example: Java, C++, Python, Visual Basic, C# , Ada, Fortran Do you know of any other high-level computer programming languages?
  • 41. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (9 of 12) Key Words, Operators, and Syntax: an Overview • Key words or reserved words have specific meaning and purpose in the programming language • Operators perform various operations on data • Syntax is a set of rules that must be strictly followed when writing a program • Statements are individual instructions written in a programming language
  • 42. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (10 of 12) Compilers and Interpreters • The statements written in a high-level language are called source code or simply code • Source code is translated to machine language using a compiler or an interpreter • Syntax error is a mistake such as a: – Misspelled word – Missing punctuation character – Incorrect use of an operator
  • 43. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (11 of 12) • Compiler is a program that translates a high-level language program into a separate machine language program Figure 1-18 Compiling a high-level program and executing it
  • 44. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.4 How a Program Works (12 of 12) • An interpreter is a program that both translates and executes the instructions in a high-level language program Figure 1-19 Executing a high-level program with an interpreter
  • 45. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved 1.5 Types of Software Programs generally fit into one of two categories • System software – The set of programs that control or enhance the operation of a computer such as an Operating System, Utility Programs, or Software Development Tools. • Application software – Programs that make a computer useful for every day tasks such as Microsoft Word, email programs, and Web browsers.
  • 46. Copyright © 2022, 2016, 2013, 2010 Pearson Education, Inc. All Rights Reserved Copyright