You are on page 1of 20

CS101: Introduction to Computing

Fall 2018

Instructors:
Dr. Fawad Hussain, Dr. S. Anwar, Engr.
Usman Raza, Dr. Shahbuddin Ansari, Mr.
Shahab Haider, Dr. Raja Hashim Ali & 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 [base 2]
 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 don’t !
Conversions
 Conversion from binary to decimal:
 (1011)2 = 1*23 + 0*22 + 1*21 + 1*20 = (11)10
 Conversion from decimal to binary:
2 125
2 62 – 1 2 16
2 31 – 0 2 8 – 0
2 15 – 1 (125)10 2 4 – 0
(16)10
2 7 – 1 = (1111101)2 2 2 – 0 = (10000)2
2 3 – 1 2 1 – 0
2 1 – 1
Binary Conversions Sum-of-Weights Method
You can convert a decimal whole number to binary Sum-of-
Weights Method . Write the decimal weight of each column
and place 1’s 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, 10 th 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)
 Ch Deci
8-bit character encoding used mainly on IBM mainframe EBCD Unicode ASCII
ar mal IC Binary
and IBM midrange computer OS
 Unicode- 16 bits A 65 193 0041 100 0001
B 66 194 0042 100 0010
 Sounds and pictures must be transformed
into a format the computer can understand 0 48 240 0030 011 0000
 A computer must digitize colors, notes, and 1 49 241 0031 011 0001
instrument sounds into 1s and 0s $ 36 91 0024 010 0100
Quantifying Bits and Bytes
 A bit is one binary digit (b):
 can have value either 0 or 1
 A byte is 8 bits (B)
 0010 0100
 Kilo- means a 1000; Mega- means million; Giga -means billion
 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
 Thin slices of silicon crystal packed with microscopic circuit elements
 e.g., wires, transistors, capacitors, logic gates and resisters

 Semiconducting materials are


used to fabricate a chip
 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
Dual In-line
In-line Memory
Package Module
(DIP) (DIMM)

Pin Single
Grid Edge
Array Contact
(PGA) (SEC)
Microprocessor
 An integrated circuit designed to process
instructions - CPU on a chip
 The CPU has two parts
 ALU (arithmetic logic unit)
 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.
Other Types of Memory
 Read-Only Memory (ROM)
 Permanent and non-volatile
 Type of memory circuitry that holds the computer’s startup routine (ROM
BIOS (basic input/output system) ,find the OS and load it.
 ROM contains a small set of instructions called the

 These instructions tell the computer how to access the hard disk, find
the operating system and load it into the RAM
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 – e.g., Hard Disk
 Optical Storage – e.g., CD, DVD
 Solid State Storage, e.g., USB, SD card
Moore’s 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
Moore’s Law:
An Important Observation (-2-)
Moore’s 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/
portal/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

You might also like