0% found this document useful (0 votes)
3 views

ICT Lecture 03 Number System

The document provides an overview of number systems used in computing, including binary, octal, and hexadecimal systems, and their conversions. It explains digital data representation, coding systems for text and other data types, and the significance of bits and bytes. Additionally, it covers the decimal number system and methods for converting between different number bases.

Uploaded by

iamsaksaksak
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

ICT Lecture 03 Number System

The document provides an overview of number systems used in computing, including binary, octal, and hexadecimal systems, and their conversions. It explains digital data representation, coding systems for text and other data types, and the significance of bits and bytes. Additionally, it covers the decimal number system and methods for converting between different number bases.

Uploaded by

iamsaksaksak
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Lecture 04 (Ch 02)

CSC 101 – Introduction


to Computing
What is number system?
 When we type some letters or words, the computer
translates them in numbers as computers can understand
only numbers.
 The value of each digit in a number can be determined
using
• The digit
• The position of the digit in the number
• The base of the number system (where the base is defined as
the total number of digits available in the number system)
Number system and
description
 As a computer programmer or an IT professional,
you should understand the following number
systems and their conversions which are frequently
used in computers.
Number System and
S.No.
Description
Binary Number
System
1
Base 2. Digits used : 0,
1
Octal Number System
2 Base 8. Digits used : 0
to 7
Hexa Decimal
Number System
3
Data and Program
Representation
• Digital Data Representation
– Coding Systems
• Used to represent data and programs in a manner
understood by the computer
– Digital Computers
• Can only understand two states, off and on
(0 and 1)
– Digital Data Representation
• The process of representing
data in digital form so it can be
understood by a computer

4
Digital Data Representation

– Bit
• The smallest unit of data that a
binary computer can recognize
(a single 1 or 0)
– Byte = 8 bits
• Byte terminology used to express
the size of documents and other
files, programs, etc.
– Prefixes are often used to express larger quantities of
bytes: kilobyte (KB), megabyte (MB), gigabyte (GB),
terabyte (TB), petabyte (PB), exabyte (EB), zettabyte (ZB),
yottabyte (YB).

5
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

6
Representing Numerical
Data
• Numbering System
 A way of representing numbers
• Decimal numbering system
 Uses 10 symbols (0-9)
• Binary numbering system
 Uses only two symbols (1 and 0) to represent all
possible numbers
• In both systems, the position of the digits determines
the
power to which the base number (such as 10 or 2)
is raised

7
Representing Numerical
Data

8
Coding Systems for
Text-Based Data
• ASCII (American Standard Code for
Information Interchange)
– Coding system traditionally used with
personal computers
– Represent text in computers,
telecommunication system and other
devices.
– Communication
– Data transmission
• EBCDIC (Extended Binary-Coded
Decimal Interchange Code)
– Developed by IBM, primarily for
mainframes

9
Coding Systems for
Text-Based Data
• Unicode
– Unicode is a standard that assigns a unique number to each
character, allowing computers to represent and interpret text
from different languages.
– Universal coding standard designed to represent text-
based data written in any ancient or modern language
– Replacing ASCII as the primary text-coding system

10
Difference between Unicode
and ASCII
Difference between Unicode
and ASCII
Coding Systems for
Other Types of Data
• Audio Data
– Must be in digital form in order to be stored on or
processed by a computer
– Often compressed when sent over the Internet
• MP3 files are 10 times smaller than their uncompressed
digital versions
• Download more quickly and take up less storage space
• Video Data
– Displayed using a collection of frames, each frame contains
a still image
– Amount of data can be substantial, but can be compressed

13
Exercise
 Data Types in Computing
 Define and give an example of the following data types:
• Text Data
• Numerical Data (Integer & Float)
• Boolean Data
• Image Data
• Audio Data

 How are images stored and represented in a


computer? Explain the concepts of pixels,
resolution, and color depth.
What is the difference between bitmap (raster)
images and vector images?
Representing Software
Programs
• Machine language
– Binary-based language for representing computer
programs the computer can execute directly
– Early programs were written in machine language
– Today’s programs still need to be translated into
machine language in order to be understood by the
computer

15
Decimal Number System
 The number system that we use in our day-to-day life is the
decimal number system. Decimal number system has base 10
as it uses 10 digits from 0 to 9. In decimal number system, the
successive positions to the left of the decimal point represent
units, tens, hundreds, thousands, and so on.

 Each position represents a specific power of the base (10). For


example, the decimal number 1234 consists of the digit 4 in
the units position, 3 in the tens position, 2 in the hundreds
position, and 1 in the thousands position. Its value can be
written as

 (1 x 1000)+ (2 x 100)+ (3 x 10)+ (4 x l)


 (1 x 103)+ (2 x 102)+ (3 x 101)+ (4 x l00)
 1000 + 200 + 30 + 4
 1234
Decimal Number System

 The decimal number 1457 consists


of the digit 7 in the units position, 5
in the tens place, 4 in the hundreds
position, and 1 in the thousands
place whose value can be written as:
▪ (1×103) + (4×102) + (5×101) + (7×100)
▪ (1×1000) + (4×100) + (5×10) + (7×1)
▪ 1000 + 400 + 50 + 7
▪ 1457
Decimal To Binary

18
Decimal To Binary
 (151)10 = (10010111)2

19
Decimal to Binary (with Fractions)

 (12.75)10 = (1100.11)2

20
Binary number system
 The easiest way to vary instructions through
electric signals is two-state system – on and
off. On is represented as 1 and off as 0,
though 0 is not actually no signal but signal
at a lower voltage. The number system
having just these two digits – 0 and 1 – is
called binary number system.
 Each binary digit is also called a bit. Binary
number system is also positional value
system, where each digit has a value
expressed in powers of 2, as displayed here.
Binary number system

 Characteristics
of the binary number
system are as follows −
• Uses two digits, 0 and 1
• Also called as base 2 number system
• Each position in a binary number represents
a 0 power of the base (2). Example 20
• Last position in a binary number represents
a x power of the base (2). Example
2x where x represents the last position - 1.
Binary to Decimal
(example)
 And decimal equivalent of this number is sum of
product of each digit with its positional value.
▪ 110102 = 1×24 + 1×23 + 0×22 + 1×21 + 0×20
▪ 16 + 8 + 0 + 2 + 0
▪ 2610
 Binary Number: 101012

Step Binary Number Decimal Number


((1 x 24) + (0 x 23)
Step 1 101012 + (1 x 22) + (0 x 21)
+ (1 x 20))10
(16 + 0 + 4 + 0 +
Step 2 101012
1)10
Step 3 101012 2110
Binary to Decimal

24
Binary to Decimal

25
Exercise
 11100012
 111001111012
 110110102
Binary to Decimal
 11100012 = 11310

27
Binary to Decimal

 111001111012 =
185310
 110110102 = 21810

28
Binary to Decimal (with
Fractions)
 (10.011010101)2 =
(2.416015625)10

29
Exercise Decimal to
Binary

30
Octal number system
 Octal number system has eight digits – 0, 1, 2,
3, 4, 5, 6 and 7. Octal number system is also a
positional value system with where each digit has
its value expressed in powers of 8, as shown
here.

 Decimal equivalent of any octal number is sum of product


of each digit with its positional value.
 7268 = 7×82 + 2×81 + 6×80
 448 + 16 + 6
 47010
Octal to Decimal

 7438 = 48310 265258 = 1160510

32
Exercise Decimal to
Octal
 4321
 932
 1853
Decimal to Octal
 432110 = 103418

34
Exercise Decimal to
Octal

35
Exercise Octal to
Decimal

 266018 =
 14228 =

36
Exercise Octal to
Decimal

 266018 =
 14228 =

37
Hexademical number
system
Hexadecimal number system has 16 symbols – 0 to 9 and
A to F where A is equal to 10, B is equal to 11 and so on till F.
Hexadecimal number system is also a positional value system
with where each digit has its value expressed in powers of 16,
as shown here.

 Decimal equivalent of any hexadecimal number is sum of


product of each digit with its positional value.
 27FB16 = 2×163 + 7×162 + 15×161 + 10×160
 = 8192 + 1792 + 240 +10
 = 1023410
Decimal to
Hexadecimal

39
Decimal to
Hexadecimal

40
Hexadecimal to Decimal

41
Hexadecimal to Decimal
 (ABC.123)16 =
(2748.0710449219)10

42
Comparison Base 2 to
Base 16

43
Binary to Hexadecimal

44
Hexadecimal to Binary and Octal

45
Octal to Hexadecimal

46
Exercise Binary to
Hexadecimal
 (10110101010101  (1100010010)2
)2

47
Exercise Octal to
Hexadecimal
 (344)8  (1422)8

48
Number System
Program
 Genius Maker
 Free software
 Use the number system

http://www.goldenkstar.com/number-system-school-software-
maths.htm
49
Summary
 Number System
 Decimal

 Binary

 Octal

 Hexadecimal

 Number conversion

50
Recommended
Websites
 http://www.cdrummond.qc.ca/cege
p/informat/Professeurs/Alain/files/a
scii.htm
 http://www.lookuptables.com/ebcdi
c_scancodes.php
 http://math.comsci.us/radix/hexade
cimal.html

51
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)1 (10110101010101) (26525)8 (2D55)16
0 2
52

You might also like