Vous êtes sur la page 1sur 29

CS101: Introduction to Computing

Fall 2014
Instructors:
Dr. Fawad Hussain, Dr. Rashad Jilani, Dr.
Saima Jabeen, Mr. Gibrail Islam & Dr.
Ahmar Rashid.
Faculty of Computer Science and
Engineering
GIK Institute of Engineering Sciences and
Technology

Data Representation

Data Representation

Modern computers are digital devices

A digital device works with discrete data, such as the


digits 1 and 0
An analog device works with continuous data

Just as a standard light switch is a simpler


technology than a dimmer, so is digital when
compared to analog
digital analog

Number System
We

use decimal number system [base 10] when


representing numeric values in our daily life

E.g., consider the number 123

123 = 100 + 20 + 3 = 1*102 + 2 * 101 + 3*100

Most

modern computer systems do not use the decimal


system to represent numeric values.

Instead, they use a binary numbering system

Consisting of only two digits: 1 and 0


Uses powers of 2 rather than 10

It is said that there are 10 types of people:

those who understand binary, and those who dont !

[base 2]

Conversions
Conversion

from binary to decimal:

(1011)2 = 1*23 + 0*22 + 1*21 + 1*20 = (11)10

Conversion

2 125
2 62
2 31

1
0

2
2
2

15
7
3

1
1
1

from decimal to binary:

(125)10
= (1111101)2

2 16
2 8
2 4

0
0

2
2

0
0

2
1

(16)10
= (10000)2

Binary Conversions

Sum-of-Weights Method

You can convert a decimal whole number to binary Sum-ofWeights Method . Write the decimal weight of each column
and place 1s in the columns that sum to the decimal
number.
Convert the decimal number 49 to binary.
The column weights double in each position to the
right. Write down column weights until the last
number is larger than the one you want to convert.
26 25 24 23 22 21 20.
64 32 16 8 4 2 1.
0 1 1 0 0 0 1.
Floyd, Digital Fundamentals, 10th ed

2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights


Reserved

Representing
Non-Numeric Data

Some decimal values & their binary equivalents

In addition to numeric data, computers also


manipulate character data
numbers, symbols, numerals that are not used
in arithmetic operations
To represent them, codes have been developed
that specify binary equivalent for each character
ASCII (American Standard Code for Information Exchange )

7 bits [Example table given ]


Extended ASCII 8 bits
EBCDIC (Extended Binary-Coded Decimal Interchange Code)
8-bit character encoding used mainly on IBM
mainframe and IBM midrange computer OS
Unicode- 16 bits

Ch
ar

Deci
mal

EBC
DIC

Unicode

ASCII
Binary

65

193

0041

100 0001

Sounds and pictures must be transformed


into a format the computer can understand

66

194

0042

100 0010

48

240

0030

011 0000

A computer must digitize colors, notes, and


instrument sounds into 1s and 0s

49

241

0031

011 0001

36

91

0024

010 0100

Quantifying Bits and Bytes

A bit is one binary digit (b):

A byte is 8 bits (B)

0010 0100

Kilo- means a 1000; Mega- means million; Giga -means billion

can have value either 0 or 1

Kilobit (Kb) is 1,024 bits


Kilobyte (KB) is 1,024 bytes
Megabyte (MB) is 1,048,576 bytes
Gigabyte (GB) is 1,073,741,824 bytes
Terabyte 240 bytes
Petabyte 250 bytes
Exabyte 260 bytes

Bits take the form of electrical pulses that can travel over
circuits

Almost the same way as electricity flows over a wire when you turn on a light switch

Computer Hardware
Microprocessor
Memory
Storage Devices
I/O Devices

Computer Chips (-1-)

Most electronic components inside a computer are integrated


circuits

Semiconducting materials are


used to fabricate a chip

Thin slices of silicon crystal packed with microscopic circuit elements


e.g., wires, transistors, capacitors, logic gates and resisters

Semidocnductors: Silicon, germanium properties b/w conductor and


insulator
To fabricate a chip, the conductive properties of selective parts of
semiconducting material can be enhanced to create very small electronic
circuits and components such as capacitors

Types of chips:

DIPs; DIMMs; PGAs;


SEC cartridge
*The motherboard houses all essential chips
and provides connecting circuitry between them

Computer Chips (-2-)


Dual
In-line
Package
(DIP)

Dual
In-line
Memory
Module
(DIMM)

Pin
Grid
Array
(PGA)

Single
Edge
Contact
(SEC)

Microprocessor
An

integrated circuit designed to process


instructions - CPU on a chip

The

ALU (arithmetic logic unit)

CPU has two parts

Performs arithmetic operations


Performs logical operations
Uses registers to hold data being
processed

Control Unit

Directs and coordinates processing

Memory Hierarchy

Microprocessor
Processes Instructions, one at a time
Registers
Current Instruction + related variables (operator, operand etc, are
loaded into registers)
Cache
Also know as RAM cache, faster compared to any other memory on
the board

Level 1 Cache (L1): Built into the processor chip, cannot be replaced without
replacing the processor
Level 2 Cache (L2): Located on a separate chip and takes a little bit more time to
get data to processor

RAM
Load whole programs, operating system, etc. into memory
Virtual Memory
If memory is full, part of the current program can be swapped in and
out of the memory from/to hard disk
Hard Disk

Offline programs, data and etc.

http://www.pantherproducts.co.uk/index.php?pageid=cpucache

Random Access Memory


(RAM)

A temporary holding area for data, application program


instructions, and the operating system

RAM is primary storage (main memory)

As you type, characters are held in RAM

Measured in megabytes (MB) or gigabytes (GB)

Todays computers have between 1 GB and 16 GB of RAM


depending on software you use

You can purchase additional RAM


A computer can use disk storage to simulate RAM. This is called
virtual memory

Not as fast as RAM

Types of RAM

RAM components vary in speed, technology, and configuration

SDRAM (Synchronous Dynamic RAM)


RDRAM (Rambus Dynamic RAM)

DDR (Double data rate)

provides 4 data transfers per cycle


Compatible with a bunch of motherboards, used to install Intel P4, and some
AMD processors.

http://www.spectek.com/menus/mthrbrd.aspx?mfgName=ASUS&memType=DDR2

DDR3

DDR basically doubles the rate of data transfer of standard SDRAM by


transferring data on the up and down tick of a clock cycle

DDR2

a serial memory technology, more expensive compared to SDRAM


Originally developed for game systems: Nintendo 64, Sony Play Staton 2.
Used to be sole choice of memory for Intel's Pentium 4

provides 8 data transfers per cycle


compatible with X58 motherboard chipset used for Core i7 processors

Speed is measured in nanoseconds.

1 nanosecond (ns) is 1 billionth of a second


It can also be expressed in MHz (millions of cycles per second)

Other Types of Memory

Read-Only Memory (ROM)

Type of memory circuitry that holds the computers startup routine


ROM contains a small set of instructions called the ROM BIOS (basic
input/output system).
These instructions tell the computer how to access the hard disk, find
the operating system and load it into the RAM
Permanent and non-volatile
Only way to change the instructions on a ROM chip is to replace the chip

Additionally, a computer needs a semi-permanent way of


keeping boot data

CMOS memory holds data but requires very little power to retain its
contents

Retains important computer settings after you turn the power off
Can be run by a battery on the motherboard
CMOS holds computer configuration settings such as the date and time, hard
disk capacity, RAM capacity and etc.
To access the CMOS setup program, hold down the F1 key during PC bootup

Storage Devices
A

storage medium is the disk, tape, CD, DVD,


paper or other substance that contains data
A storage device is the mechanical apparatus
that records and retrieves data from a storage
medium
Types of storage devices

Magnetic Storage
Optical Storage
Solid State Storage

Magnetic Storage

Stores data by magnetizing microscopic particles on the


disk or tape surface
Contains a read-write head

mechanism in the disk drive that reads and writes magnetized


particles that represent data
Before data is stored, the particles on the surface of the disk are
scattered in random patterns.
The disk drives read-write head magnetizes the particles and
orients them in a positive (north) or negative (south) direction.
These patterns of magnetized particles represent 0 or 1.

Example

Hard Disk Drive [HDD]


Floppy Disk
Magnetic Tape

Magnetic Storage : HDD

Working of a hard disk

Hard disk platter - a flat, rigid disk made of aluminum or glass


and coated with magnetic iron oxide particles
Hard disk - one or more platters and their associated read-write
heads
Capacity up to 250 GB (even more today); Preferred type of main
storage

Limitations
Head crash - when a read-write head
runs into a dust particle or other
contaminant on the disk

Platter

Head crash damages some data


on disk
Triggered by shaking the hard disk
while in use
Not limited to hard disks

R/W
Head

Optical Storage

Stores data as microscopic light spots (lands) and dark


spots (pits) on the disk surface

Advantage

The lands represent 1 and the pits represent 0 in binary computing


Less susceptible to environmental
damage than data recorded on
magnetic media

Example

CD [Capacity: 700 MB]


DVD [Capacity: 4.7 GB;
Double Layered can store up to 8.5 GB]

Blue-Ray [Capacity: up to 50 GB ]

Optical Storage : CD / DVD


Working

of CD / DVD

Recordable technology uses a laser to change the


color in a synthetic dye layer sandwiched beneath the
clear plastic disk surface
Rewritable technology uses phase change
technology to alter a crystal structure on the disk surface

uses a phase change process to alter its state from a


reflective state to a light absorbing state rather than an
irreversable chemical change as in cyanine-based CD-R

Much slower than hard disk


Not a suitable replacement for hard disk yet

Solid State Storage

Stores data in a non-volatile, erasable, low-power chip


Some solid state storage requires a device called a card reader to transfer data to
or from a computer
Working

Advantage

The chips circuitry is arranged as a grid, and each cell in the grid contains two transistors that
act as gates.
gates open current flows a 1 bit
gates closed no current a 0 bit
Provides faster access to data than magnetic or optical storage technology because it includes
no moving parts
Portable

Example

USB flash drive


CompactFlash card

Moores Law:
An Important Observation (-1-)
Moore's

law describes a long-term trend in


the history of computing hardware

Since the invention of the IC in 1958, the number


of transistors that can be placed inexpensively on
an IC has increased exponentially, doubling
approximately every two years

Moores Law:
An Important Observation (-2-)

Moores Law:

References
Computer

Concepts, by Parsons & Oja


[Chapters 2]
http://en.wikipedia.org/wiki/ASCII

http://en.wikipedia.org/wiki/Moore's_law
http://www.google.com.pk/imgres?
q=moores+law&hl=en&sa=X&biw=1366&bih=565&tbm=isch&prmd=imvnsu&tbnid=cJCMmCj7UsiHOM:&imgrefurl=http://www.ieee.org/po
rtal/site/sscs/index.jsp%3FpageID%3Dsscs_level1_article%26TheCat%3D6010%26path%3Dsscs/06Sept%26file
%3DHalfhill.xml&docid=VOgwV-8TrJwmMM&w=800&h=600&ei=lsBwTv2_HcubOpqusJ0J&zoom=1

Vous aimerez peut-être aussi