Você está na página 1de 25

CS 104: PROGRAMMING

FUNDAMENTALS

LECTURE # 01

Introduction to Computer
What is Computer ?

 Von Neumann, leading


mathematician, wrote a
report describing
computer design.
 A programmable
electronic device that can
store, retrieve and
process data.”

2
Components of a Computer

Computer

Hardware Software
Physical Devices Instructions & Data

3
Hardware
 Hardware refers to the physical things that go
together to make a computer.

 Peripheral devices are hardware components that


handle the computer’s input, output, and storage
capabilities.
Software
 Software are programs written to perform specific tasks
 Application programs perform a specific task for the user
 These programs include word processors, spreadsheets, and

games (e.g. Microsoft Office, Matlab, etc.)


 System programs take control of the computer, such as an
operating system (e.g., Linux, Windows XP, etc.)
 Programs that support the execution and development of other
programs
 Operating systems  execute other programs
 Translation systems  development of other programs
Computer Hardware Components

Components of a PC
Application Software
7

 Application software is the software that has made using computers


indispensable and popular

 Common application software


 Word processors
 Desktop publishing programs
 Spreadsheets
 Presentation managers
 Drawing programs

 Learning how to develop application software is our focus


Operating System

 Examples
 Windows®, UNIX®, Mac OS X®

 Controls and manages the computing resources


 Important services that an operating system provides
 File system

 Directories, folders, files


 Commands that allow for manipulation of the file system
 Sort, delete, copy

 Ability to perform input and output on a variety of devices

 Management of the running systems

 Memory Management
Computer Organization Basics
Input / Output Devices

 Input Devices
 Accepts information from the user and
transforms it to digital codes that the
computer can process
 Example: keyboard, mouse, scanner

 Output Devices
 An interface by which the computer conveys
the output to the user
 Example: monitor, printer
Central Processing Unit (CPU)
 Does most of the work in executing a program
 The CPU inside a PC is usually the microprocessor
 3 main parts:
 Control Unit
 Fetch instructions from main memory and put them in the
instruction register
 ALU (Arithmetic Logic Unit)
 Execute arithmetic operations
 Registers
 Temporarily store instructions or data fetched from memory
Central Processing Unit
 Brains of the computer  Executes program instructions!
 Arithmetic/Logic Unit performs arithmetic operations, and
makes logical comparisons
 Control Unit decodes and executes your instructions

 Arithmetic operations are performed using the binary


number system
Computer only understands 1’s and 0’s!
The Control Unit
 The fetch/execute cycle is the Fetch the instruction to
series of steps the CPU takes which the PC points
to execute an instruction
 Performing the action specified
by an instruction is known as Increment the PC
executing the instruction
 The program counter (PC)
holds the memory address of Execute the fetched
the next instruction instruction
Secondary Storage

 Secondary storage - the device that stores


information permanently
Examples of secondary storage
hard disks
floppy disks
Memory sticks
CD-ROMs
tapes
Input /Output Devices
 Input devices feed data and programs into computers.
They include:
keyboard
mouse
scanner
optical pen
secondary storage
 Output devices display results. They include:
monitor
printer
secondary storage
Main Memory
 A semiconductor device which stores the
information necessary for a program to run.
 2 types
 ROM (Read Only Memory)
 Contains information that is necessary for the computer to
boot up
 The information stays there permanently even when the
computer is turned off.
 RAM (Random Access Memory)
 Containsinstruction or data needed for a program to run
 Got erased when the computer is turned off.
Main Memory
 Directly connected to the CPU.
 When the power of the computer is
turned off, everything in the main,
memory is lost – VOLATILE
 All programs must be loaded into
main memory before they can be
executed.
 All data must be brought into main
memory before it can be
manipulated.
Main Memory Layout
Addresses Memory Contents
Memory Units
 Memory is an ordered sequence of storage cells, each
capable of holding a piece of information equal to one
byte.
 Each memory cell has its own unique address
 The information held in a memory cell can be input data,
computed values, or your program instructions.
 Von Neumann Architecture!

1001
y 12.5 1002
1003
1004
Temperature 32 1005
1006
Letter 'c' 1007
Number - 1008
1009
Memory Organization

 Two circuit states correspond to 0 and 1


 bit (short for binary digit)
 refers to a single 0 or 1
 Nibble (4), byte (8), word (16 or 32 or 64), double word
(32 or 64 or 128), etc.
 Bit patterns represent both the computer instructions and
computer data
 Von Neumann architecture
 1 byte = 8 bits
 1 KB = 1024 bytes
 1 MB = 1024 x 1024 bytes = 1,048,576 bytes
Storage Devices
 A magnetic device used to store a large
amount of information.
 Store the software components or data needed

for the computer to execute its tasks.


 Could be “read only” or “writable”.

 Example: Hard drive, CD ROM, floppy disks


Network Devices
 Connect a computer to the other computers.
 Enable the users to access data or execute
programs remotely.
 Example: modem, Ethernet card
How Many Digits?

 binary (base 2) numbers use 2 digits:


JUST 0 and 1

 decimal (base 10) numbers use 10 digits: 0


THROUGH 9

 hexadecimal (base 16) numbers use 16 digits: 0


THROUGH 9 AND a THROUGH f
Language of a Computer
 The only language a computer directly understands is
sequences of 0s and 1s
 The language made up of 0s and 1s is called
machine language
 The digits 0 or 1 are called binary digits (bits) with
eight bits equaling a byte
 A sequence of 0s and 1s is also referred to as binary
code
Coding Schemes – Representing
Human Language Characters
 ASCII (American Standard Code for Information Interchange)
 7 bits
 128 characters
 A is encoded as 1000001 (65th character)
 3 is encoded as 0110011
 EBCDIC
 used by IBM
 256 characters
 8 bits
 Unicode
 65536 characters
two bytes are needed to store a character(16 bits)

Você também pode gostar