Lecture 8
Lecture 8
Introduction to
Computing
Lecture 8
Muhammad Salman Ali
[email protected]
1
Transforming Data Into Information
2
How Computer Represent
Data
Number system
Manner of Counting
Several different number
systems exist
To Computer everything is
a number
Alphabets, numbers,
punctuation marks, sound,
pictures, computer
instructions
For example
“Here are some words.” 3
Decimal Numbers
Used by humans to count
Latin word deci mean 10
Also called Base 10
Have 10 distinct digits
0123456789
10 is a two-digit number
Digits combine to make
larger numbers
4
Binary Number System
Switch has two states
Off represents 0, On is 1
Latin bi means 2
Used by computers to count
Two distinct digits, 0 and 1
0 and 1 combine to make
numbers
represent a quantity >1 it
uses two (or more) digits
Pattern repeats indefinitely
5
Data Representation
A computer circuit represents the 0 or the 1
electronically by the presence or absence
of an electrical charge
6
Comparison Base 2 to
Base 16
7
Number Conversion
Decimal to Binary and Binary to Decimal
Decimal to Octal and Octal to Decimal
Decimal to Hexadecimal and
Hexadecimal to Decimal
Binary to Hexadecimal
Octal to Hexadecimal
Hexadecimal to Binary and Octal
8
Decimal To Binary
1
9
Decimal To Binary
(151)10 = (10010111)2
10
Decimal to Binary (with Fractions)
(12.75)10 = (1100.11)2
11
Binary to Decimal
12
Binary to Decimal
13
Binary to Decimal
11100012 = 11310
14
Binary to Decimal
111001111012 = 185310
110110102 = 21810
15
Binary to Decimal (with
Fractions)
(10.011010101) = (2.416015625)
2 10
16
Exercise Decimal to
Binary
17
Exercise Decimal to
Binary
18
Decimal to Octal
432110 = 103418
19
Decimal to Octal
(Fractions)
0.05 = 0.03146
10 8
20
Octal to Decimal
21
Exercise Decimal to
Octal
22
Exercise Octal to
Decimal
266018 =
14228 =
23
Decimal to Hexadecimal
24
Decimal to Hexadecimal
25
Hexadecimal to Decimal
26
Hexadecimal to Decimal
(ABC.123)16 = (2748.0710449219)10
27
Comparison Base 2 to
Base 16
28
Binary to Hexadecimal
29
Hexadecimal to Binary
and Octal
30
Octal to Hexadecimal
31
Exercise Binary to
Hexadecimal
(10110101010101) (1100010010)
2 2
32
Exercise Octal to
Hexadecimal
(344) (1422)
8 8
33
Number System Program
Genius Maker
Free software
Use the number system
http://www.goldenkstar.com/number-system-school-software-maths.htm
34
Summary
Number System
Decimal
Binary
Octal
Hexadecimal
Number conversion
35
Recommended Websites
http://www.cdrummond.qc.ca/cegep/info
rmat/Professeurs/Alain/files/ascii.htm
http://www.lookuptables.com/ebcdic_sc
ancodes.php
http://math.comsci.us/radix/hexadecimal
.html
36
Number System -
Exercise
Decimal Binary Octal Hexadecimal
(786)10 (1100010010)2 (1422)8 (312)16
(555)10 (1000101011)2 (1053)8 (22B)16
(228)10 (11100100)2 (786)8 (786)16
(179)10 (10110011)2 (786)8 (786)16
(483)10 (111100011)2 (743)8 (1E3)16
(4012)10 (111110101100)2 (7643)8 (FAC)16
(4321)10 (1000011100001)2 (10341)8 (10E1)16
(1853)10 (11100111101)2 (3475)8 (73D)16
(9526)10 (1001010011011)2 (22466)8 (2536)16
(11605)10 (10110101010101)2 (26525)8 (2D55)16
(48879)10 (111111011101111)2 (137357)8 (BEEF)16
37