Lec 2 PF
Lec 2 PF
Lecture 2
1
What is a Computer?
An electronic machine that can accept data (input),
manipulate the data according to specified rules (process),
produce results (output), and stores the results for future
use.
A computer consists of a CPU, memory, hard disk, monitor,
printer, and communication devices.
Bus
Bus
4
How Data is Stored?
Data of various kinds, such as numbers,
characters, and strings, are encoded as a
series of bits (zeros and ones). Memory address Memory content
convention. .
2000
.
01001010 Encoding for character ‘J’
The programmers need not to be 2001 01100001 Encoding for character ‘a’
concerned about the encoding and 2002 01110110 Encoding for character ‘v’
decoding of data, which is performed 2003 01100001 Encoding for character ‘a’
automatically by the system based on 2004 00000011 Encoding for number 3
the encoding scheme.
The encoding scheme varies. For
example, character ‘J’ is represented by
01001010 in one byte.
A byte is the minimum storage unit.
5
Storage Devices
Memory is volatile, because information is lost when the power is
off. Programs and data are permanently stored on storage devices
and are moved to memory when the computer actually uses them.
There are three main types of storage devices:Disk drives (hard
disks), CD drives (CD-R and CD-RW), and Tape drives.
Bus
6
Output Devices: Monitor
The monitor displays information (text and graphics). The
resolution and dot pitch determine the quality of the display.
Bus
7
Communication Devices
A regular modem uses a phone line and can transfer data in a speed
up to 56,000 bps (bits per second).
A DSL (digital subscriber line) also uses a phone line and can
transfer data in a speed 20 times faster than a regular modem.
A cable modem uses the TV cable line maintained by the cable
company. A cable modem is as fast as a DSL.
Network interface card (NIC) is a device to connect a computer to a
local area network (LAN). The LAN is commonly used in business,
universities, and government organizations.
A typical type of NIC, called 10BaseT, can transfer data at 10 mbps
(million bits per second).
Bus
1101101010011010
10
Programming Languages
Machine Language Assembly Language High-Level Language
…
ADDF3 R1, R2, R3
Assembler …
1101101010011010
… …
11
Programming Languages
Machine Language Assembly Language High-Level Language
12
Popular High-Level Languages
COBOL (COmmon Business Oriented Language)
FORTRAN (FORmula TRANslation)
Microsoft)
Delphi (Pascal-like visual language developed by Borland)
C# 13
(a Java-like developed my Microsoft)
Compiling Source Code
A program written in a high-level language is called a
source program. Since a computer cannot understand a
source program.
Program called a compiler is used to translate the
source program into a machine language program
called an object program. The object program is often
then linked with other supporting library code before
the object can be executed on the machine.