CHAPTER1
COMPUTER SYSTEM
1.2 Number System
and Representation
Chapter 1: Computer System
1.2 Number system and Representation
Learning Outcomes :
At the end of the lesson, students should be
able to:
a. Explain data representation in computer (Bit, byte) Clo1
b. Convert between binary and decimal whole numbers.
c. Describe why hexadecimal notation is used.
d. Convert between hexadecimal and decimal.
e. Convert between hexadecimal and binary clo3
Chapter 1: Computer System
1.2 Number system and Representation
Learning Outcomes :
At the end of the lesson, students should be
able to:
a. Explain data representation in computer (Bit, byte)
b. Convert between binary and decimal whole numbers.
c. Describe why hexadecimal notation is used.
d. Convert between hexadecimal and decimal.
e. Convert between hexadecimal and binary
1.2 Number system and Representation
Difference Between
Data:
• A collection of unprocessed items, which
can include number, character and
symbol, images, audio, video and
instructions.
✓ E.g. : blue, 3, car
Information:
• Processed data that conveys meaning
and is useful to people.
✓ E.g. : 3 blue cars
1.2 Number system and Representation
What is Data Representation?
▪ The form in which data is stored, processed and
transmitted.
▪ In computer, all data and instruction are represented
digitally.
▪ Computer only recognized two discrete electrical
states; on and off.
▪ To represent those two electrical states is binary system
which consist two digits: 0 and 1.
1.2 Number system and Representation
What is Data Representation?
Example :-
Devices such as PDAs, iPod and computers store
numbers, text, music, photos and videos in formats
that can be handled by electronic circuitry.
1.2 Number system and Representation
How does a computer represent data ?
✓ By using two unique binary digits 1 and 0 to represent the
two states on and off.
✓ Computer recognizes only
two discrete electrical states
(on and off) because
computers are electronic
devices powered by
electricity, which also has
only two states :
( 0 – off, 1 – on)
1.2 Number system and Representation
How does a computer represent data ?
✓ The digit 1 represents the electronic
state is ON
❑ (presence of an electronic charge)
✓ The digit 0 represents the electronic
state of OFF.
❑ (absence of an electronic charge)
1.2 Number system and Representation
How does a computer represent data
All letters and numbers are stored in a computer as a series of
bits, each represented in the computer as on or off.
1.2 Number system and Representation
How does a computer represent data ? (Example)
All letters and numbers are stored in a computer as a series
of bits, each represented in the computer as on or off
1.2 Number system and Representation
Data Representation in Computer
Difference Between
Bit Byte
▪ A bit is the smallest unit of data ▪ Is the basic storage unit in
the computer can process. memory.
▪ Short for binary digit (1 or 0) ▪ A group of 8 bits (ex:11110000)
▪ Represents an electrical state (on ▪ Represents a character such as a
or off) digit, a letter, a punctuation mark
▪ Bit 1 represents On or any symbol in computer
▪ Bit 0 represents Off ▪ 1 byte could be equal to 1
character.
1 byte = 8 bits 00110000
Figure 1: Bit numbering in a byte
STORAGE CAPACITY
Definition:
• Capacity – The number of bytes(characters) can be hold
by storage medium.
• Measured in units such as Kilobyte, Megabyte, Gigabyte,
Terabyte, Petabyte.
1 Byte = 8 bits
1 KB = 1024 bytes
1 MB = 1024 KB (approx. 1 million bytes)
1 GB = 1024 MB (approx. 1 billion bytes)
1 TB = 1024 GB (approx. 1 trillion bytes)
1 PB = 1024 TB (approx. 1 quadrillion bytes)
STORAGE CAPACITY
• Capacity is the number of bytes a storage medium can hold
Equal to
1,024 bytes
1,024KB
1,024MB
1,024GB
1,024TB
1,024PB
1,024EB
1,024ZB
STORAGE CAPACITY
The Number of Bytes in Common Terms
Name Number of Bytes Amount of Text
Kilobyte • 210 or 1,024 ½ page
(KB) • approx. 1,000 or 103
500 page or thick
Megabyte • 220 or 104,8576 book
(MB) • approx. 1,000,000 or 106
Gigabyte • 230 or 1,073,741,824 500,000 pages or
(GB) • approx 1,000,000,000 or 109 1,000 thick books
Terabyte • 240 or 1,099,511,627,776
(TB) • approx. 1,000,000,000,000 or 1012 1,000,000 thick books
STORAGE CAPACITY
The Number of Bytes in Common Terms
Name Number of Bytes Amount of Text
Petabyte • 250 or 1,125,899,906,842,624 180 Libraries of
(PB) • approx. 1,000,000,000,000,000 or 10 Congress
15
Exabyte 260 or 1,152,292,150,460,684,6976 180 thousand
Zettabyte Libraries of Congress
Yottabyte approx. 1,000,000,000,000,000,000 or 10
18
270 or 1,180,591,620,717,411,303,424 180 million Libraries
of Congress
280 or 180 billion Libraries
1,208,925,819,614,629,174,706,176 of Congress
STORAGE CAPACITY
Conversion Diagram :
STORAGE CAPACITY
Conversion Examples :
• Convert 1GB to KB
1 GB = 1 X 1024 X 1024 OR 1 GB = 1 X 210 X 210
= 1 048 575 KB = 1 048 575 KB
STORAGE CAPACITY
Conversion Examples:
• Convert 1200 MB to GB
1200 MB = 1200/1024
= 1.17 GB
STORAGE CAPACITY
Conversion Examples (show works) :
Task 1: Convert 3,000 Kilobytes to Megabytes
Formula:
x Kilobytes ÷ 1,024 = y Megabytes
Calculations:
3,000 Kilobytes ÷ 1,024 = 2.9296875 Megabytes
Result:
3,000 Kilobytes is equal to 2.9296875 Megabytes
STORAGE CAPACITY
Conversion Examples (show works) :
Task 2 : Convert 25 Megabytes to Kilobytes
Formula:
x Megabytes x 1,024 = y Kilobytes
Calculations:
25 Megabytes x 1,024 = 25,600 Kilobytes
Result:
25 Megabytes is equal to 25,600 Kilobytes
1.2 Number system and Representation
How A Letter Is Converted To Binary Form And Back
Step 1. Step 2.
The user presses An electronic signal
the capital letter D for the capital letter D
on the keyboard. is sent to the system
unit.
Step 4. Step 3.
After processing, the binary code for The signal for the capital letter
the capital letter D is converted to D is converted to its binary
an image, and displayed on the code (01000100) and is stored
monitor. in memory for processing.
1.2 Number system and Representation
Data Representation in Computer (Example)
A computer
converts the
words in 0’s and
1’s
Chapter 1: Computer System
1.2 Number system and Representation
Learning Outcomes :
At the end of the lesson, students should be
able to:
a. Explain data representation in computer (Bit, byte)
b. Convert between binary and decimal whole numbers.
c. Describe why hexadecimal notation is used.
d. Convert between hexadecimal and decimal.
e. Convert between hexadecimal and binary
1.2 Number system and Representation
Number System
Types of number systems
i. Binary Numbers (base 2)
Binary numbers uses symbols 0 and 1
ii. Decimal Numbers (base 10)
Decimal numbers uses 10 symbols.
This include 0 through 9.
iii. Hexadecimal Numbers (base 16)
Hexadecimal uses 16 symbols.
This include 0 through 9 and A through F
1.2 Number system and Representation
Number System
i. Binary number system
❑ Machine / Computer recognizes two Binary digit
states: 0 and 1 (binary digit)
110
❑ Bits 0 and 1 and are joined together to
form binary numbers Binary number
❑ Binary number represents numeric
values using two symbols 0 and 1
1.2 Number system and Representation
Number System
ii. Decimal number system
❑ Is a base 10 number system.
❑ Uses 10 symbols:0 through 9
❑ Decimal digits are joined together to form
longer decimal numbers
❑ Examples:0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12,………
Learning Outcomes :
a. Explain data representation in computer (Bit, byte) Clo1
b. Convert between binary and decimal whole numbers.
c. Describe why hexadecimal notation is used.
d. Convert between hexadecimal and decimal.
e. Convert between hexadecimal and binary
1.2 Number system and Representation
Number System
iii. Hexadecimal number system
❑ Uses 16 symbols to represents values.
❑ The symbols are: 0,1,2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E
and F.
Why hexadecimal is used?
❑ Hexadecimal number system is used by programmer with
computer because:
i.It can represent binary values in more compact and
readable form.
ii.The conversion between the binary and the hexadecimal
number system is very efficient.
1.2 Number system and Representation
Comparison Between
Hexadecimal number Decimal number Binary number
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
1.2 Number system and Representation
TYPES OF NUMBER SYSTEM CONVERSION
1. Binary To Decimal Conversion
2. Decimal To Binary Conversion
3. Decimal To Hexadecimal Conversion
4. Hexadecimal To Decimal Conversion
5. Hexadecimal To Binary Conversion
6. Binary To Hexadecimal Conversion
Learning Outcomes :
a. Explain data representation in computer (Bit, byte) clo3
b. Convert between binary and decimal whole numbers.
c. Describe why hexadecimal notation is used.
d. Convert between hexadecimal and decimal.
e. Convert between hexadecimal and binary
1.2 Number system and Representation
Binary to Decimal
Conversion
1.2 Number system and Representation
Binary to Decimal Conversion
Example 1:
Convert the binary number 101102 to decimal number
Place Value 24 23 22 21 20
Binary 1 011 0
16 x 1 8x0 4x1 2x1 0x0
Conversion 16 + 0 + 4 + 2 + 0 = 2210
Decimal
1.2 Number system and Representation
Binary to Decimal Conversion
Example 2:
Convert the binary number 11101102 to decimal number
Place Value 26 25 24 23 22 21 20
0
Binary 1 1 1 0 1 1 1x0
Conversion 64 x 1 32 x 1 16 x 1 8 x 0 4 x 1 2 x 1
Decimal 64 + 32 + 16 + 0 + 4 + 2 + 0 = 11810
1.2 Number system and Representation
Binary to Decimal Conversion
Exercise 1:
❑ Convert the binary number 1011100 to decimal number .
Solution:
64 32 16 8 4 2 1
0
101110
64 16 8 4
64 + 16 + 8 + 4
Hence, 10111002 = 9210
1.2 Number system and Representation
Binary to Decimal Conversion
Exercise 2:
❑Convert the binary number 1110110 to decimal number
Solution:
64 32 16 8 4 2 1
1110110
64 32 16 42
64 + 32 + 16 + 4 + 2
Hence, 11101102= 11810
1.2 Number system and Representation
Decimal to Binary
Conversion
1.2 Number system and Representation
Decimal to Binary conversion – Method 1
Example 1:
Convert the decimal number 2210 to binary number
2210 = _1__0_1__1_0___2
Binary
number
1.2 Number system and Representation
Decimal to Binary conversion – Method 2
Example 1:
Convert the decimal number 2210 to binary number
Place Value 24 23 22 21 20
= 16 =8 =4 =2 =1
Binary 1 0 11 0
22 6 2
16 4 2
6 20
1.2 Number system and Representation
Decimal to Binary conversion – Method 1
Example 2:
Convert the number 4010 to the binary number system.
Hence, 4010 = 1010002
Binary
number
1.2 Number system and Representation
Decimal to Binary conversion – Method 2
Example 2:
Convert the decimal number 4010 to binary number
Place Value 25 24 23 22 21 20
= 32 = 16 =8 =4 =2 =1
Binary 1 0 10 00
40 8
32 8
80
1.2 Number system and Representation
Decimal to Hexadecimal
Conversion
1.2 Number system and Representation
Decimal to hexadecimal conversion
Example 1:
❑Convert the decimal number 134110 to hex number
Solution:
Desired base is 16, so we repeatedly divide the given decimal
number by 16.
1.2 Number system and Representation
Decimal to hexadecimal conversion – Method 1
Example 1:
❑Convert the decimal number 134110 to hex number
13 = D
Hence,134110 = 53D16
1.2 Number system and Representation
Decimal to hexadecimal conversion – Method 2
Example 1:
❑ Convert the decimal number 134110 to hex number
Place Value 162 161 160
= 256 = 16 =1
Binary 5 3 13 (D)
5 3 13
256 1341 16 61 1 13
1280 48 13
61 13 0
Hence, 134110 = 53D16
1.2 Number system and Representation
Example 2: Decimal to hexadecimal conversion – Method 1
Convert the decimal number 86016 to hexadecimal number
Hence, 86010 = 35C16
1.2 Number system and Representation
Decimal to hexadecimal conversion – Method 2
Example 2:
❑Convert the decimal number 86010 to hex number
Place Value 162 161 160
= 256 = 16 =1
Binary 3 5 12 (C)
3 5 12
256 860 16 92 1 12
768 80 12
92 12 0
Hence, 86010 = 35C16
1.2 Number system and Representation
Decimal to hexadecimal conversion –Method 1
Example3:
Convert the decimal number 202010 to hex number
solution:
Hence, 202010 = 7E416
1.2 Number system and Representation
Decimal to hexadecimal conversion – Method 2
Example3:
❑ Convert the decimal number 202010 to hex number
Place Value 162 161 160
Binary = 256 = 16 =1
7 14( E) 4
7 14 4
256 2020 16 228 14
1792 224 4
228 4 0
Hence, 202010 = 7E416
1.2 Number system and Representation
Hexadecimal to Decimal
Conversion