0% found this document useful (0 votes)
11 views23 pages

Lecture 3 - Number System

swe lec of iut4

Uploaded by

atikshahriar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views23 pages

Lecture 3 - Number System

swe lec of iut4

Uploaded by

atikshahriar16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Number System

SWE 4101
Introduction to Software Engineering

Tanjila Alam Sathi


Lecturer,
Department of CSE,
Islamic University of Technology (IUT)
O u tl i n e
2

⚫ Non-positional number system.


⚫ Positional number system.
⚫ Decimal number system.
⚫ Binary number system.
⚫ Octal number system.
⚫ Hexadecimal number system.
Number System
3

⚫ Two types of number system


 Non-positional number system.

 Positional number system.


Non-p o s i t i o n a l N u m b e r S y s t e m
4

⚫ Characteristics
 Each symbol represents the same value regardless of its
positions in the number.
 Symbols are just added to determine a particular number.

 Example: Roman Number System.

I 1
II 2
V 5
VI 6
X 10

 Difficulty in Arithmetic operations.


Positional Number System
5

⚫ Characteristics
 Symbols are less, called digits.

 Digits have different values depending on the position in the


number.
 Example: Decimal Number System.
Positional Number System
6

⚫ The value of each digit depends on:


 Digit itself (face value).

 Position in the number.

 Base of the number system.

⚫ Value of a number = ∑ value o f tℎe digit ∗ base index -1


[index is the position of the digit]
⚫ Base – Total number of different digits in the
number system.
 For any number system maximum value of the of a single digits always
equal to one less than the base.
Decimal Number System
7

⚫ Positional number system.


⚫ Digits – 0,1,2,3,4,5,6,7,8,9.
⚫ Example:
432110 = 1 ∗ 100 + 2 ∗ 101 + 3 ∗ 102 + 4 ∗ 103
= 1 + 20 + 300 + 4000
Binary Number System
8

⚫ Positional number system.


⚫ Digits – 0,1.
⚫ Example:
10102 = 0 ∗ 20 + 1 ∗ 21 + 0 ∗ 22 + 1 ∗ 23
= 0+ 2+ 0+ 8
Octal Number System
9

⚫ Positional number system.


⚫ Digits – 0,1,2,3,4,5,6,7.
⚫ Example:
76548 = 4 ∗ 80 + 5 ∗ 81 + 6 ∗ 82 + 7 ∗ 83
= 4 + 40 + 384 + 3584
= 4012
Hexadecimal Number System
10

⚫ Positional number system.


⚫ Digits – 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
⚫ Example:
ABCD8 = 13 ∗ 160 + 12 ∗ 161 +11 ∗ 162 + 10 ∗ 163
= 13 + 192 + 2816 + 40960
= 43981
C o n v e r t i n g A n y B a s e To D e c i m a l
11

⚫ Step 1: Determine the positional value of each digit


⚫ Step 2: Multiply the decimal value of the digit with
the positional value.
⚫ Step 3: Summation of these products is the result.
C o n v e r t i n g D e c i m a l Val ue To A n y B ase
12

Division-Remainder method

⚫ Step 1: Divide the decimal value with the base.


⚫ Step 2: Record the remainder from the step 1 as the
right most digit (least significant digit).
⚫ Step 3: Go to step 1 with the quotient as the new
decimal value until the quotient is 0.
C o n v e r t i n g D e c i m a l Value To B i n a r y
13

(25) 10 = (11001)2
Fractional Number
14

⚫ The positional value of the digit of a number after


fractional point is
X = base - position
[Position is counted from the fraction point]
Fractional Number
15

⚫ Decimal from octal number


Fractional Number
16

Decimal to any base

⚫ Step 1: Multiply the fractional number with the Base.


⚫ Step 2: Record the non-fractional part of the resulting
number from leftmost digit after fractional point.
⚫ Step 3: Go to step 1 with the fractional part of the
resulting number (stop if the fractional part is 0 or if
significant number of digits are calculated).
Fractional Number
17

Convert 0.865 from Base 10 to Base 2,8 and 16.


Conversion a m o n g t w o b a s e s
18

⚫ Step 1: Convert the number from “From Base” to


base 10.
⚫ Step 2: Convert the number in base 10 to “To Base”
number.
Shortcut method (Binary t o Octal)
19
Shortcut method (Octal t o Binary)
20
Shortcut method (Binary to Hexadecimal)
21
Shortcut method (Hexadecimal t o Binary)
22
Equivalent Chart
23

You might also like