SlideShare une entreprise Scribd logo
1  sur  84
SWE – 105T
INTRODUCTION TO COMPUTING
Software Engineering Department
Sir Syed University of Engineering & Technology
NUMBER SYSTEM AND
CONVERSIONS
1
Numbers
• Natural Numbers
Zero and any number obtained by repeatedly
adding one to it.
Examples: 100, 0, 45645, 32
• Negative Numbers
A value less than 0, with a – sign Examples: -24, -1, -
45645, -32
2
Numbers (Cont’d)
• Integers
A natural number, a negative number, zero
Examples: 249, 0, - 45645, - 32
• Rational Numbers
An integer or the quotient of two integers Examples:
-249, -1, 0, ¼ , - ½
3
Understanding Number System
• The radix, or base, of a number system is the total
number of unique symbols available in that
system.
• The largest valued symbol always has a magnitude
of one less than the radix.
• The study of binary system will help us gain better
understanding of how computers perform
computation.
4
Positional Notation
5
Types of Number System
There are various types of number system which as
follows:
 Decimal Number System
 Binary Number System
 Octal Number System
 Hexadecimal Number System
6
Types of Number System
• Four most commonly used number systems are-
7
Number System
• The following table shows the base and digits
used in these number systems-
Number System Base Digits Used
Decimal Number
System
10
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
(Total 10 digits)
Binary Number
System
2
0, 1
(Total 2 digits)
Octal Number
System
8
0, 1, 2, 3, 4, 5, 6, 7
(Total 8 digits)
Hexadecimal
Number System
16
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, F
(Total 16 digits)
8
Conversion Among Bases
• The possibilities:
Hexadecimal
Decimal Octal
Binary
9
Binary Number System
• Binary Number System
– It is the simplest form of number system. It consists of only
two digits in base which are 0 and 1 or on and off
respectively
– They are used as the numbering system for computers. A
binary number can be easily represented by using a series
of switches
– Each single digit in the binary system is called as a bit.
When four bits are combined together a nibble is formed
– Eight bits or two nibbles are combined to form a byte.
Sixteen bits or two bytes combine to form a word and
similarly thirty two bits or two words are called as a
double word
10
Binary Number System
• The following is the diagrammatic representation of
binary number system:
11
Binary Numbers (cont.)
Decimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
1 0 1 0
8 4 2 1
Considering the digits that
has a value of 1 and adding
it number marker on the
top of each digits
8 + 2 = 10
12
Definitions
• nibble = 4 bits
• byte = 8 bits
• (short) word = 2 bytes = 16 bits
• (double) word = 4 bytes = 32 bits
• (long) word = 8 bytes = 64 bits
• 1K (kilo or “kibi”) = 1,024
• 1M (mega or “mebi”) = (1K)*(1K) = 1,048,576
• 1G (giga or “gibi”) = (1K)*(1M) = 1,073,741,824
13
Decimal Number System
Decimal system consists of 10 digits starting from 0
to 9. This number system has ten as its base.
14
Decimal Number System
• In number system,
• It is very important to have a good knowledge of
how to convert numbers from one base to
another base.
• Here, we will learn how to convert any given
number from any base to base 10.
15
Decimal Number System
• Converting to Base 10-
• A given number can be converted from any base
to base 10 using Expansion Method.
• According to expansion method, if abc.de is any
given number in base x, then its value in base 10
is given as-
(abc.de)x = (ax2 + bx + c + dx-1 + ex-2)10
16
Decimal Number System
• Explanation-
• To use expansion method for conversion,
• Assign position number to each digit of the given number.
• Digits to the left of decimal are numbered starting from 0.
• Digits to the right of decimal are numbered starting from -1.
• Write a term for each digit as digit x (base of given
number)position number of digit
• Perform the addition of all terms to obtain the number in base
10.
• This formula can be expanded for any number of digits.
17
Decimal Number System
18
Decimal to Binary Conversion( Base 10 to
base 2)
• In number system,
• It is very important to have a good knowledge of
how to convert numbers from one base to
another base.
• Here, we will learn how to convert any given
number from base 10 to base 2.
19
Explanation
• Steps To Convert From Base 10 To Base 2-
• Multiply the given fraction (in base 10) with 2.
• Write the real part and fractional part of the result so
obtained separately.
• Multiply the fractional part with 2.
• Write the real part and fractional part of the result so
obtained separately.
• Repeat this procedure until the fractional part remains 0.
• If fractional part does not terminate to 0, find the result up
to as many places as required.
20
Decimal to Octal Conversion( Base 10 to Base
8)
• In number system,
• It is very important to have a good knowledge of
how to convert numbers from one base to
another base.
• Here, we will learn how to convert any given
number from base 10 to base 8.
21
Explanation
• Steps To Convert From Base 10 To Base 8
• Multiply the given fraction (in base 10) with 8.
• Write the real part and fractional part of the result so
obtained separately.
• Multiply the fractional part with 8.
• Write the real part and fractional part of the result so
obtained separately.
• Repeat this procedure until the fractional part remains 0.
• If fractional part does not terminate to 0, find the result up
to as many places as required.
22
Decimal to Hexadecimal Conversion( Base 10
to base 16)
• In number system,
• It is very important to have a good knowledge of
how to convert numbers from one base to
another base.
• Here, we will learn how to convert any given
number from base 10 to base 16.
23
Explanation
• Steps To Convert From Base 10 To Base 16
• Multiply the given fraction (in base 10) with 16.
• Write the real part and fractional part of the result so obtained
separately.
• Multiply the fractional part with 16.
• Write the real part and fractional part of the result so obtained
separately.
• Repeat this procedure until the fractional part remains 0.
• If fractional part does not terminate to 0, find the result up to as
many places as required.
24
Octal Number System
• Octal Number System
It is one of the most commonly used number
system in computers. It is used in programming
because of its similarity to binary number system
A single octal digit is equal to three binary digits.
Octal Number System uses the base as 8.
• Base 8
• Ten Digits: 0, 1, 2, 3, 4, 5, 6, 7
• Example: 238
25
Hexadecimal Number System
• Hexadecimal Number System
This number system is used for larger numbers.
Hexadecimal number system uses the base as 16
In hexadecimal number system the number 0 to 9
are denoted normally then the numbers 10 to 15
are denoted by alphabets A through F
respectively.
26
ASCII Code
• ASCII Code
– The American Standard Code for Information Interchange (ASCII)
code is a special form of BCD code that is widely used in digital
computers and data communications equipment.
– It is a 7-bit binary code that is used in transferring data between
computers and their external peripheral devices and in
communicating data by radio and telephone lines.
– The ASCII code is used to represent the 26 upper case letters (A to Z),
26 lowercase letters (a to z), 10 numbers (0 to 9), 33 special
characters and symbols and 33 control characters
– They are considered as a standard code for denoting character as
binary numbers which is used in computer terminals, printers and
microcomputers
– If a file is saved in ASCII format it can be easily used by another
application
27
Conversion of the Number System
• Binary to Decimal , Octal, Hexadecimal
• Decimal to Binary, Octal, Hexadecimal
• Octal to Decimal, Binary, Hexadecimal
• Hexadecimal to Binary, Octal, Decimal
28
Quick Example
2510 = 110012 = 318 = 1916
Base
29
Binary to Decimal
• Remember that Binary numbers are based on the radix of 2
while Decimal numbers are based on the radix of 10.
• Remember also that binary will only be represented in 1s and
0s.
• Steps in converting Binary to Decimal:
– Place a number marker on the top of the given digits, starting
from 0 up the last given digits—starting from the right to
determine the exponent to use.
– Consider all the 1s in the given digits and multiply it with the
base number of the given digits (which is base 2) and raised it
with power of the number corresponded in the number marker
you placed on the top of the given digits.
30
Example: Binary to Decimal
1010102 = ?10
= 101010
= 1*25
+ 1*23
+ 1*21
= 32 + 8 + 2
= 4210
5 4 3 2 1 0
Place the number marker
on the top of the given
digits, starting from the
right, starting from 0 up to
the last given digit on the
left.
31
Example: Binary to Decimal
• (10010)2 → ( ? )10
Using expansion method, we have-
(10010)2
= ( 1 x 24 + 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20 )10
= ( 16 + 0 + 0 + 2 + 0 )10
= ( 18 )10
32
Example: Binary to Decimal
• (10010.101)2 → ( ? )10
Using expansion method, we have-
(10010.101)2
= ( 1 x 24 + 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20 + 1 x 2-1 + 0 x 2-
2 + 1 x 2-3 )10
= ( 16 + 0 + 0 + 2 + 0 + 0.5 + 0.125 )10
= ( 18.625 )10
33
Binary to Octal
• Since one octal digit is equivalent to three binary digits, just
group three binary digits, starting from the least significant bit
(right side).
• Append 0 to the most significant bit (left side), if the grouping
does not have enough to form three binary digits.
• In short, you must complete the grouping of three digits.
• If you will be having a fraction (decimal point), append 0 to
the least most significant bit (right side) of the given digits to
complete the grouping of three bits.
34
Binary to Octal (cont.)
• Steps in converting Binary to Octal:
– Group the given digits in three starting from the
right side.
– If the grouping is not complete, place 0 to
complete the grouping.
– Once you have grouped it into three digits, you
starting converting the binary digits into decimal
values following the concepts of binary digits (4, 2,
1) starting from the right.
35
Binary to Octal Conversion
36
Example: Binary to Octal
(1101010)2 = ?8
= 001 101 010
= 001 101 010
= 1 5 28
= 1528
1st group
2nd group
3rd group
4 2 1
4 2 1
4 2 1
Add 0 to the left, to
complete the
grouping
Simply add all the
number markers
considering the
binary digits that has
1 on it.
37
Example: Binary to Octal
(1010)2=( ? )8
Split the binary number from left to right each group
3 bits
001 010
1 2
(1010)2=(12)8
38
Example: Binary to Octal
(111110011001)2= ?8
Split the binary number from left to right each
group 3 bits
111 110 011 001
7 6 3 1
(111110011001)2=(7631)8
39
Binary to Hexadecimal
• Since one hexadecimal digit is equivalent to four binary digits,
just group four binary digits, starting from the least significant
bit (right side).
• Append 0 to the most significant bit (left side), if the grouping
does not have enough to form four binary digits.
• In short, you must complete the grouping of four digits.
• If you will be having a fraction (decimal point), append 0 to
the least most significant bit (right side) of the given digits to
complete the grouping of three bits.
40
Binary to Hexadecimal (cont.)
• Steps in converting Binary to Hexadecimal:
– Group the given digits in four starting from the right
side.
– If the grouping is not complete, place 0 to complete
the grouping.
– Once you have grouped it into three digits, you
starting converting the binary digits into decimal
values following the concepts of binary digits (8, 4, 2,
1) starting from the right.
41
Binary to Hexa conversions
42
Example: Binary to Hexadecimal
(1101010)2 = ?16
= 0110 1010
= 0110 1010
= 6 A16
= 6A16
1st group
2nd group
8 4 2 1
Add 0 to the left, to
complete the
grouping
Simply add all the
number markers
considering the
binary digits that has
1 on it.
8 4 2 1
43
Example: Binary to Hexadecimal
10101110112 = ?16
10 1011 1011
2 B B
10101110112 = 2BB16
44
Decimal to Binary
• Converting a decimal number to a binary number
is done by successively dividing the decimal
number by 2 on the left side of the radix.
• If you will have a fractional part of the given
decimal, successively multiplying the decimal
number by 2 on the right side of the radix.
45
Decimal to Binary (cont.)
• Steps in converting Decimal to Binary:
– Divide the given decimal number with the base
number you are converting it to, which is 2.
– Whatever the answer you will get in the division will
be divided again with the base (2) until you cannot
divide the answer anymore with 2.
– The remainder that you will get will be the one you
consider as your converted answer.
46
Example: Decimal to Binary
(125)10 = ?2
2 125
62 1
2
31 0
2
15 1
2
7 1
2
3 1
2
1 1
2
0 1
12510 = 11111012
47
Example: Decimal to Binary
• (18)10 → ( ? )2
• Using division method, we have-
• From here, (18)10 = (10010)2
48
Example: Decimal to Binary
• (172)10 → ( ? )2
• Using division method, we have-
• From here, (172)10 = (10101100)2
49
Decimal to Octal
• Converting a decimal number to an octal number
is done by successively dividing the decimal
number by 8 on the left side of the radix.
• If you will have a fractional part of the given
decimal, successively multiplying the decimal
number by 8 on the right side of the radix.
50
Decimal to Octal (cont.)
• Steps in converting Decimal to Octal:
– Divide the given decimal number with the base
number you are converting it to, which is 8.
– Whatever the answer you will get in the division will
be divided again with the base (8) until you cannot
divide the answer anymore with 8.
– The remainder that you will get will be the one you
consider as your converted answer.
51
Example: Decimal to Octal
123410 = ?8
8 1234
154 2
8
19 2
8
2 3
8
0 2
123410 = 23228
52
Example: Decimal to Octal
• (1032)10 → (?)8
• Using division method, we have-
• From here, (1032)10 = (2010)8
53
Example: Decimal to Octal
• (172)10 → ( ? )8
• Using division method, we have-
• From here, (172)10 = (254)8
54
Decimal to Hexadecimal
• Converting a decimal number to a hexadecimal
number is done by successively dividing the
decimal number by 16 on the left side of the radix
• If you will have a fractional part of the given
decimal, successively multiplying the decimal
number by 16 on the right side of the radix.
55
Decimal to Hexadecimal (cont.)
• Steps in converting Decimal to Hexadecimal:
– Divide the given decimal number with the base number you are
converting it to, which is 16.
– Whatever the answer you will get in the division will be divided
again with the base (16) until you cannot divide the answer
anymore with 16.
– The remainder that you will get will be the one you consider as
your converted answer.
56
Example: Decimal to Hexadecimal
123410 = ?16
123410 = 4D216
16 1234
77 2
16
4 13 = D
16
0 4
57
Example: Decimal to Hexadecimal
• (2020)10 → (?)16
• Using division method, we have-
• From here, (2020)10 = (7E4)16
58
Example: Decimal to Hexadecimal
• (172)10 → ( ? )16
• Using division method, we have-
• From here, (172)10 = (AC)16
59
Octal to Decimal
• Remember that Octal numbers are based on the radix of 8 while Decimal
numbers are based on the radix of 10.
• Remember also that Octal will only be represented with value 0-7.
• Steps in converting Octal to Decimal:
– Place a number marker on the top of the given digits, starting from 0 up the
last given digits—starting from the right to determine the exponent to use.
– Considering all the given digits, multiply it with the base number of the
given digits (which is base 8) and raised it with power of the number
corresponded in the number marker you placed on the top of the given
digits.
60
Example: Octal to Decimal
(761)8 = ?10
= 761
= 7*82
+ 6*81
+ 1*80
= 56 + 48 + 1
= 10510
2 1 0
Place the number marker
on the top of the given
digits, starting from the
right, starting from 0 up to
the last given digit on the
left.
61
Example: Octal to Decimal
(254)8 → ( ? )10
Using expansion method, we have-
(254)8
= ( 2 x 82 + 5 x 81 + 4 x 80 )10
= ( 128 + 40 + 4 )10
= ( 172 )10
62
Example: Octal to Decimal
(254.7014)8 → ( ? )10
Using expansion method, we have-
(254.7014)8
= ( 2 x 82 + 5 x 81 + 4 x 80 + 7 x 8-1 + 0 x 8-2 + 1 x 8-3 + 4 x 8-4 )10
= ( 128 + 40 + 4 + 0.875 + 0.0019 + 0.0009 )10
= ( 172.8778 )10
63
Binary to Octal Conversion
64
Octal to Binary
• Since one octal digit is equivalent to three binary
digits, just convert the individual octal digit into
three binary digits.
• Steps in converting Octal to Binary:
– Convert each of the given octal number by simply
using the concept of (4, 2, 1).
– Place a binary 1 to correspond the given octal
number.
65
Example: Octal to Binary
(761)8 = ?2
= 7 111
= 6 110
= 1 001
= 111 110 0012
4 2 1
4 2 1
4 2 1
Simply add all the number
markers considering the
binary digits that has 1 on
it, to get the octal number
given.
66
Example: Octal to Binary
7058 = ?2
7 0 5
111 000 101
7058 = 1110001012
67
Octal to Hexadecimal
• When converting an octal digit to a hexadecimal digit, you
must first convert the octal number to binary number and
group it by four and convert the grouped digits to
hexadecimal by using the concept of (8, 4, 2, 1).
• If the digits is not enough to form a grouping of four then
append 0 on the left side of the digits.
• If the given octal have fraction, then append 0 on the right
side of the given digits.
68
Octal to Hexadecimal (cont.)
• Steps in converting Octal to Hexadecimal:
– Convert the octal digits in binary by considering each
given digits and represent it in binary using the
concept (4, 2, 1).
– Once it is in binary, that’s the time you convert the
binary into hexadecimal, by grouping it into four.
69
Example: Octal to Hexadecimal
(761)8 = ?16
= 111 110 001
= 0001 1111 0001
= 1F116
7 6 1
1 F 1
70
Example: Octal to Hexadecimal
10768 = ?16
1 0 7 6
001 000 111 110
2 3 E
10768 = 23E16
71
Hexadecimal to Binary
• Since one hexadecimal digit is equivalent to four
binary digits, just convert the individual
hexadecimal digit into four binary digit
72
Example: Hexadecimal to Binary
(7AE3)16 = ?2
= 7 0111
A 1010
E 1110
3 0011
= (0111 1010 1110 0011)2
73
Example: Hexadecimal to Binary
10AF16 = ?2
1 0 A F
0001 0000 1010 1111
10AF16 = 00010000101011112
74
Hexadecimal to Octal
• When converting an hexadecimal digit to an octal digit, you
must first convert the hexadecimal number to binary number
and group it by three and convert the grouped digits to octal
by using the concept of (4, 2, 1).
• If the digits is not enough to form a grouping of three then
append 0 on the left side of the digits.
• If the given hexadecimal have fraction, then append 0 on the
right side of the given digits.
75
Hexadecimal to Octal (cont.)
• Steps in converting Hexadecimal to Octal:
– Convert the hexadecimal digits in binary by
considering each given digits
– Once converted to binary group the binary into three
and using the concept (4, 2, 1).
76
Example: Hexadecimal to Octal
7AE316 = ?8
= 7 0111
A 1010
E 1110
3 0011
= 0 111 101 011 100 0112
= 753438
7 5 3 4 3
77
Example: Hexadecimal to Octal
1F0C16 = ?8
1 F 0 C
0001 1111 0000 1100
1 7 4 1 4
1F0C16 = 174148
78
Hexadecimal to Decimal
• Each hexadecimal position is weighted with a power of 16.
• Digits on the left side of the radix point has a positive
exponent while on the right side of the radix point has a
negative exponent.
• Converting a hexadecimal number to a decimal number is
done by successively multiplying the decimal number by 16
on the left side of the radix
• If you will have a fractional part of the given decimal,
successively multiplying the decimal number by 16 on the
right side of the radix.
79
Hexadecimal to Decimal (cont.)
• Steps in converting Hexadecimal to Decimal:
– Place a number marker on the top of the given
number for determining the exponent to be used.
– Get the individual digit and multiply it by the base
number (16) and raised it with the exponent
corresponds to the number marker you place on each
digit, then to the addition operation.
80
Example: Hexadecimal to Decimal
286A16 = ?10
= 286A
= 2*163 + 8*162 + 6*161 + A*160
= 1034610
3 2 1 0
81
Example: Hexadecimal to Decimal
(AC)16 → ( ? )10
Using expansion method, we have-
(AC)16
= ( A x 161 + C x 160 )10
= ( 10 x 16 + 12 x 1 )10
= ( 160 + 12 )10
= ( 172 )10
82
Example: Hexadecimal to Decimal
(AC.FBA5)16 → ( ? )10
Using expansion method, we have-
(AC.FBA5)16
= ( A x 161 + C x 160 + F x 16-1 + B x 16-2 + A x 16-3 + 5 x 16-4 )10
= ( 10 x 16 + 12 x 1 + 15 x 16-1 + 11 x 16-2 + 10 x 16-3 + 5 x 16-4 )10
= ( 160 + 12 + 0.9375 + 0.0429 + 0.0024 + 0.0001 )10
= ( 172.9829 )10
83
Conversion Table
84

Contenu connexe

Tendances

01.number systems
01.number systems01.number systems
01.number systems
rasha3
 
Final features of 8086_microprocessor
Final features of 8086_microprocessorFinal features of 8086_microprocessor
Final features of 8086_microprocessor
LAVANYA PALANIYAPPAN
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
gavhays
 

Tendances (20)

Smart cities india
Smart cities indiaSmart cities india
Smart cities india
 
Binary codes
Binary codesBinary codes
Binary codes
 
Number system
Number systemNumber system
Number system
 
Architecture of 80386(www.munnuz.co.cc)
Architecture of 80386(www.munnuz.co.cc)Architecture of 80386(www.munnuz.co.cc)
Architecture of 80386(www.munnuz.co.cc)
 
01.number systems
01.number systems01.number systems
01.number systems
 
Knight's Tour
Knight's TourKnight's Tour
Knight's Tour
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
Final features of 8086_microprocessor
Final features of 8086_microprocessorFinal features of 8086_microprocessor
Final features of 8086_microprocessor
 
Number system part 1
Number  system part 1Number  system part 1
Number system part 1
 
N queen problem
N queen problemN queen problem
N queen problem
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
ppt-knight'stour
ppt-knight'stourppt-knight'stour
ppt-knight'stour
 
Importance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptxImportance of Numerical Methods in CSE.pptx
Importance of Numerical Methods in CSE.pptx
 
Number+system (1)
Number+system (1)Number+system (1)
Number+system (1)
 
80386 processor
80386 processor80386 processor
80386 processor
 
Logical and shift micro operations
Logical and shift micro operationsLogical and shift micro operations
Logical and shift micro operations
 
Binary to decimal Conversion
Binary to decimal ConversionBinary to decimal Conversion
Binary to decimal Conversion
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Mathematical Thinking.pdf
Mathematical Thinking.pdfMathematical Thinking.pdf
Mathematical Thinking.pdf
 
Reflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and RotationReflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and Rotation
 

Similaire à Week 4-Number Systems.pptx

Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
Lovely Professional University
 

Similaire à Week 4-Number Systems.pptx (20)

data representation
 data representation data representation
data representation
 
Number-Systems presentation of the mathematics
Number-Systems presentation of the mathematicsNumber-Systems presentation of the mathematics
Number-Systems presentation of the mathematics
 
Number system
Number systemNumber system
Number system
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 
Lecture-2(2): Number System & Conversion
Lecture-2(2): Number System & ConversionLecture-2(2): Number System & Conversion
Lecture-2(2): Number System & Conversion
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Lecture 2 ns
Lecture 2 nsLecture 2 ns
Lecture 2 ns
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Computer Number system
Computer Number systemComputer Number system
Computer Number system
 
numbersystem-211022083557.pdf
numbersystem-211022083557.pdfnumbersystem-211022083557.pdf
numbersystem-211022083557.pdf
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
12117188.ppt
12117188.ppt12117188.ppt
12117188.ppt
 
5a data representation
5a   data representation5a   data representation
5a data representation
 
12117188.ppt
12117188.ppt12117188.ppt
12117188.ppt
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
04 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa1604 chapter03 02_numbers_systems_student_version_fa16
04 chapter03 02_numbers_systems_student_version_fa16
 
1. basic theories of information
1. basic theories of information1. basic theories of information
1. basic theories of information
 
NUMBER SYSTEM.pptx
NUMBER SYSTEM.pptxNUMBER SYSTEM.pptx
NUMBER SYSTEM.pptx
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Dernier (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

Week 4-Number Systems.pptx

  • 1. SWE – 105T INTRODUCTION TO COMPUTING Software Engineering Department Sir Syed University of Engineering & Technology NUMBER SYSTEM AND CONVERSIONS 1
  • 2. Numbers • Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 • Negative Numbers A value less than 0, with a – sign Examples: -24, -1, - 45645, -32 2
  • 3. Numbers (Cont’d) • Integers A natural number, a negative number, zero Examples: 249, 0, - 45645, - 32 • Rational Numbers An integer or the quotient of two integers Examples: -249, -1, 0, ¼ , - ½ 3
  • 4. Understanding Number System • The radix, or base, of a number system is the total number of unique symbols available in that system. • The largest valued symbol always has a magnitude of one less than the radix. • The study of binary system will help us gain better understanding of how computers perform computation. 4
  • 6. Types of Number System There are various types of number system which as follows:  Decimal Number System  Binary Number System  Octal Number System  Hexadecimal Number System 6
  • 7. Types of Number System • Four most commonly used number systems are- 7
  • 8. Number System • The following table shows the base and digits used in these number systems- Number System Base Digits Used Decimal Number System 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (Total 10 digits) Binary Number System 2 0, 1 (Total 2 digits) Octal Number System 8 0, 1, 2, 3, 4, 5, 6, 7 (Total 8 digits) Hexadecimal Number System 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F (Total 16 digits) 8
  • 9. Conversion Among Bases • The possibilities: Hexadecimal Decimal Octal Binary 9
  • 10. Binary Number System • Binary Number System – It is the simplest form of number system. It consists of only two digits in base which are 0 and 1 or on and off respectively – They are used as the numbering system for computers. A binary number can be easily represented by using a series of switches – Each single digit in the binary system is called as a bit. When four bits are combined together a nibble is formed – Eight bits or two nibbles are combined to form a byte. Sixteen bits or two bytes combine to form a word and similarly thirty two bits or two words are called as a double word 10
  • 11. Binary Number System • The following is the diagrammatic representation of binary number system: 11
  • 12. Binary Numbers (cont.) Decimal Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 1 0 1 0 8 4 2 1 Considering the digits that has a value of 1 and adding it number marker on the top of each digits 8 + 2 = 10 12
  • 13. Definitions • nibble = 4 bits • byte = 8 bits • (short) word = 2 bytes = 16 bits • (double) word = 4 bytes = 32 bits • (long) word = 8 bytes = 64 bits • 1K (kilo or “kibi”) = 1,024 • 1M (mega or “mebi”) = (1K)*(1K) = 1,048,576 • 1G (giga or “gibi”) = (1K)*(1M) = 1,073,741,824 13
  • 14. Decimal Number System Decimal system consists of 10 digits starting from 0 to 9. This number system has ten as its base. 14
  • 15. Decimal Number System • In number system, • It is very important to have a good knowledge of how to convert numbers from one base to another base. • Here, we will learn how to convert any given number from any base to base 10. 15
  • 16. Decimal Number System • Converting to Base 10- • A given number can be converted from any base to base 10 using Expansion Method. • According to expansion method, if abc.de is any given number in base x, then its value in base 10 is given as- (abc.de)x = (ax2 + bx + c + dx-1 + ex-2)10 16
  • 17. Decimal Number System • Explanation- • To use expansion method for conversion, • Assign position number to each digit of the given number. • Digits to the left of decimal are numbered starting from 0. • Digits to the right of decimal are numbered starting from -1. • Write a term for each digit as digit x (base of given number)position number of digit • Perform the addition of all terms to obtain the number in base 10. • This formula can be expanded for any number of digits. 17
  • 19. Decimal to Binary Conversion( Base 10 to base 2) • In number system, • It is very important to have a good knowledge of how to convert numbers from one base to another base. • Here, we will learn how to convert any given number from base 10 to base 2. 19
  • 20. Explanation • Steps To Convert From Base 10 To Base 2- • Multiply the given fraction (in base 10) with 2. • Write the real part and fractional part of the result so obtained separately. • Multiply the fractional part with 2. • Write the real part and fractional part of the result so obtained separately. • Repeat this procedure until the fractional part remains 0. • If fractional part does not terminate to 0, find the result up to as many places as required. 20
  • 21. Decimal to Octal Conversion( Base 10 to Base 8) • In number system, • It is very important to have a good knowledge of how to convert numbers from one base to another base. • Here, we will learn how to convert any given number from base 10 to base 8. 21
  • 22. Explanation • Steps To Convert From Base 10 To Base 8 • Multiply the given fraction (in base 10) with 8. • Write the real part and fractional part of the result so obtained separately. • Multiply the fractional part with 8. • Write the real part and fractional part of the result so obtained separately. • Repeat this procedure until the fractional part remains 0. • If fractional part does not terminate to 0, find the result up to as many places as required. 22
  • 23. Decimal to Hexadecimal Conversion( Base 10 to base 16) • In number system, • It is very important to have a good knowledge of how to convert numbers from one base to another base. • Here, we will learn how to convert any given number from base 10 to base 16. 23
  • 24. Explanation • Steps To Convert From Base 10 To Base 16 • Multiply the given fraction (in base 10) with 16. • Write the real part and fractional part of the result so obtained separately. • Multiply the fractional part with 16. • Write the real part and fractional part of the result so obtained separately. • Repeat this procedure until the fractional part remains 0. • If fractional part does not terminate to 0, find the result up to as many places as required. 24
  • 25. Octal Number System • Octal Number System It is one of the most commonly used number system in computers. It is used in programming because of its similarity to binary number system A single octal digit is equal to three binary digits. Octal Number System uses the base as 8. • Base 8 • Ten Digits: 0, 1, 2, 3, 4, 5, 6, 7 • Example: 238 25
  • 26. Hexadecimal Number System • Hexadecimal Number System This number system is used for larger numbers. Hexadecimal number system uses the base as 16 In hexadecimal number system the number 0 to 9 are denoted normally then the numbers 10 to 15 are denoted by alphabets A through F respectively. 26
  • 27. ASCII Code • ASCII Code – The American Standard Code for Information Interchange (ASCII) code is a special form of BCD code that is widely used in digital computers and data communications equipment. – It is a 7-bit binary code that is used in transferring data between computers and their external peripheral devices and in communicating data by radio and telephone lines. – The ASCII code is used to represent the 26 upper case letters (A to Z), 26 lowercase letters (a to z), 10 numbers (0 to 9), 33 special characters and symbols and 33 control characters – They are considered as a standard code for denoting character as binary numbers which is used in computer terminals, printers and microcomputers – If a file is saved in ASCII format it can be easily used by another application 27
  • 28. Conversion of the Number System • Binary to Decimal , Octal, Hexadecimal • Decimal to Binary, Octal, Hexadecimal • Octal to Decimal, Binary, Hexadecimal • Hexadecimal to Binary, Octal, Decimal 28
  • 29. Quick Example 2510 = 110012 = 318 = 1916 Base 29
  • 30. Binary to Decimal • Remember that Binary numbers are based on the radix of 2 while Decimal numbers are based on the radix of 10. • Remember also that binary will only be represented in 1s and 0s. • Steps in converting Binary to Decimal: – Place a number marker on the top of the given digits, starting from 0 up the last given digits—starting from the right to determine the exponent to use. – Consider all the 1s in the given digits and multiply it with the base number of the given digits (which is base 2) and raised it with power of the number corresponded in the number marker you placed on the top of the given digits. 30
  • 31. Example: Binary to Decimal 1010102 = ?10 = 101010 = 1*25 + 1*23 + 1*21 = 32 + 8 + 2 = 4210 5 4 3 2 1 0 Place the number marker on the top of the given digits, starting from the right, starting from 0 up to the last given digit on the left. 31
  • 32. Example: Binary to Decimal • (10010)2 → ( ? )10 Using expansion method, we have- (10010)2 = ( 1 x 24 + 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20 )10 = ( 16 + 0 + 0 + 2 + 0 )10 = ( 18 )10 32
  • 33. Example: Binary to Decimal • (10010.101)2 → ( ? )10 Using expansion method, we have- (10010.101)2 = ( 1 x 24 + 0 x 23 + 0 x 22 + 1 x 21 + 0 x 20 + 1 x 2-1 + 0 x 2- 2 + 1 x 2-3 )10 = ( 16 + 0 + 0 + 2 + 0 + 0.5 + 0.125 )10 = ( 18.625 )10 33
  • 34. Binary to Octal • Since one octal digit is equivalent to three binary digits, just group three binary digits, starting from the least significant bit (right side). • Append 0 to the most significant bit (left side), if the grouping does not have enough to form three binary digits. • In short, you must complete the grouping of three digits. • If you will be having a fraction (decimal point), append 0 to the least most significant bit (right side) of the given digits to complete the grouping of three bits. 34
  • 35. Binary to Octal (cont.) • Steps in converting Binary to Octal: – Group the given digits in three starting from the right side. – If the grouping is not complete, place 0 to complete the grouping. – Once you have grouped it into three digits, you starting converting the binary digits into decimal values following the concepts of binary digits (4, 2, 1) starting from the right. 35
  • 36. Binary to Octal Conversion 36
  • 37. Example: Binary to Octal (1101010)2 = ?8 = 001 101 010 = 001 101 010 = 1 5 28 = 1528 1st group 2nd group 3rd group 4 2 1 4 2 1 4 2 1 Add 0 to the left, to complete the grouping Simply add all the number markers considering the binary digits that has 1 on it. 37
  • 38. Example: Binary to Octal (1010)2=( ? )8 Split the binary number from left to right each group 3 bits 001 010 1 2 (1010)2=(12)8 38
  • 39. Example: Binary to Octal (111110011001)2= ?8 Split the binary number from left to right each group 3 bits 111 110 011 001 7 6 3 1 (111110011001)2=(7631)8 39
  • 40. Binary to Hexadecimal • Since one hexadecimal digit is equivalent to four binary digits, just group four binary digits, starting from the least significant bit (right side). • Append 0 to the most significant bit (left side), if the grouping does not have enough to form four binary digits. • In short, you must complete the grouping of four digits. • If you will be having a fraction (decimal point), append 0 to the least most significant bit (right side) of the given digits to complete the grouping of three bits. 40
  • 41. Binary to Hexadecimal (cont.) • Steps in converting Binary to Hexadecimal: – Group the given digits in four starting from the right side. – If the grouping is not complete, place 0 to complete the grouping. – Once you have grouped it into three digits, you starting converting the binary digits into decimal values following the concepts of binary digits (8, 4, 2, 1) starting from the right. 41
  • 42. Binary to Hexa conversions 42
  • 43. Example: Binary to Hexadecimal (1101010)2 = ?16 = 0110 1010 = 0110 1010 = 6 A16 = 6A16 1st group 2nd group 8 4 2 1 Add 0 to the left, to complete the grouping Simply add all the number markers considering the binary digits that has 1 on it. 8 4 2 1 43
  • 44. Example: Binary to Hexadecimal 10101110112 = ?16 10 1011 1011 2 B B 10101110112 = 2BB16 44
  • 45. Decimal to Binary • Converting a decimal number to a binary number is done by successively dividing the decimal number by 2 on the left side of the radix. • If you will have a fractional part of the given decimal, successively multiplying the decimal number by 2 on the right side of the radix. 45
  • 46. Decimal to Binary (cont.) • Steps in converting Decimal to Binary: – Divide the given decimal number with the base number you are converting it to, which is 2. – Whatever the answer you will get in the division will be divided again with the base (2) until you cannot divide the answer anymore with 2. – The remainder that you will get will be the one you consider as your converted answer. 46
  • 47. Example: Decimal to Binary (125)10 = ?2 2 125 62 1 2 31 0 2 15 1 2 7 1 2 3 1 2 1 1 2 0 1 12510 = 11111012 47
  • 48. Example: Decimal to Binary • (18)10 → ( ? )2 • Using division method, we have- • From here, (18)10 = (10010)2 48
  • 49. Example: Decimal to Binary • (172)10 → ( ? )2 • Using division method, we have- • From here, (172)10 = (10101100)2 49
  • 50. Decimal to Octal • Converting a decimal number to an octal number is done by successively dividing the decimal number by 8 on the left side of the radix. • If you will have a fractional part of the given decimal, successively multiplying the decimal number by 8 on the right side of the radix. 50
  • 51. Decimal to Octal (cont.) • Steps in converting Decimal to Octal: – Divide the given decimal number with the base number you are converting it to, which is 8. – Whatever the answer you will get in the division will be divided again with the base (8) until you cannot divide the answer anymore with 8. – The remainder that you will get will be the one you consider as your converted answer. 51
  • 52. Example: Decimal to Octal 123410 = ?8 8 1234 154 2 8 19 2 8 2 3 8 0 2 123410 = 23228 52
  • 53. Example: Decimal to Octal • (1032)10 → (?)8 • Using division method, we have- • From here, (1032)10 = (2010)8 53
  • 54. Example: Decimal to Octal • (172)10 → ( ? )8 • Using division method, we have- • From here, (172)10 = (254)8 54
  • 55. Decimal to Hexadecimal • Converting a decimal number to a hexadecimal number is done by successively dividing the decimal number by 16 on the left side of the radix • If you will have a fractional part of the given decimal, successively multiplying the decimal number by 16 on the right side of the radix. 55
  • 56. Decimal to Hexadecimal (cont.) • Steps in converting Decimal to Hexadecimal: – Divide the given decimal number with the base number you are converting it to, which is 16. – Whatever the answer you will get in the division will be divided again with the base (16) until you cannot divide the answer anymore with 16. – The remainder that you will get will be the one you consider as your converted answer. 56
  • 57. Example: Decimal to Hexadecimal 123410 = ?16 123410 = 4D216 16 1234 77 2 16 4 13 = D 16 0 4 57
  • 58. Example: Decimal to Hexadecimal • (2020)10 → (?)16 • Using division method, we have- • From here, (2020)10 = (7E4)16 58
  • 59. Example: Decimal to Hexadecimal • (172)10 → ( ? )16 • Using division method, we have- • From here, (172)10 = (AC)16 59
  • 60. Octal to Decimal • Remember that Octal numbers are based on the radix of 8 while Decimal numbers are based on the radix of 10. • Remember also that Octal will only be represented with value 0-7. • Steps in converting Octal to Decimal: – Place a number marker on the top of the given digits, starting from 0 up the last given digits—starting from the right to determine the exponent to use. – Considering all the given digits, multiply it with the base number of the given digits (which is base 8) and raised it with power of the number corresponded in the number marker you placed on the top of the given digits. 60
  • 61. Example: Octal to Decimal (761)8 = ?10 = 761 = 7*82 + 6*81 + 1*80 = 56 + 48 + 1 = 10510 2 1 0 Place the number marker on the top of the given digits, starting from the right, starting from 0 up to the last given digit on the left. 61
  • 62. Example: Octal to Decimal (254)8 → ( ? )10 Using expansion method, we have- (254)8 = ( 2 x 82 + 5 x 81 + 4 x 80 )10 = ( 128 + 40 + 4 )10 = ( 172 )10 62
  • 63. Example: Octal to Decimal (254.7014)8 → ( ? )10 Using expansion method, we have- (254.7014)8 = ( 2 x 82 + 5 x 81 + 4 x 80 + 7 x 8-1 + 0 x 8-2 + 1 x 8-3 + 4 x 8-4 )10 = ( 128 + 40 + 4 + 0.875 + 0.0019 + 0.0009 )10 = ( 172.8778 )10 63
  • 64. Binary to Octal Conversion 64
  • 65. Octal to Binary • Since one octal digit is equivalent to three binary digits, just convert the individual octal digit into three binary digits. • Steps in converting Octal to Binary: – Convert each of the given octal number by simply using the concept of (4, 2, 1). – Place a binary 1 to correspond the given octal number. 65
  • 66. Example: Octal to Binary (761)8 = ?2 = 7 111 = 6 110 = 1 001 = 111 110 0012 4 2 1 4 2 1 4 2 1 Simply add all the number markers considering the binary digits that has 1 on it, to get the octal number given. 66
  • 67. Example: Octal to Binary 7058 = ?2 7 0 5 111 000 101 7058 = 1110001012 67
  • 68. Octal to Hexadecimal • When converting an octal digit to a hexadecimal digit, you must first convert the octal number to binary number and group it by four and convert the grouped digits to hexadecimal by using the concept of (8, 4, 2, 1). • If the digits is not enough to form a grouping of four then append 0 on the left side of the digits. • If the given octal have fraction, then append 0 on the right side of the given digits. 68
  • 69. Octal to Hexadecimal (cont.) • Steps in converting Octal to Hexadecimal: – Convert the octal digits in binary by considering each given digits and represent it in binary using the concept (4, 2, 1). – Once it is in binary, that’s the time you convert the binary into hexadecimal, by grouping it into four. 69
  • 70. Example: Octal to Hexadecimal (761)8 = ?16 = 111 110 001 = 0001 1111 0001 = 1F116 7 6 1 1 F 1 70
  • 71. Example: Octal to Hexadecimal 10768 = ?16 1 0 7 6 001 000 111 110 2 3 E 10768 = 23E16 71
  • 72. Hexadecimal to Binary • Since one hexadecimal digit is equivalent to four binary digits, just convert the individual hexadecimal digit into four binary digit 72
  • 73. Example: Hexadecimal to Binary (7AE3)16 = ?2 = 7 0111 A 1010 E 1110 3 0011 = (0111 1010 1110 0011)2 73
  • 74. Example: Hexadecimal to Binary 10AF16 = ?2 1 0 A F 0001 0000 1010 1111 10AF16 = 00010000101011112 74
  • 75. Hexadecimal to Octal • When converting an hexadecimal digit to an octal digit, you must first convert the hexadecimal number to binary number and group it by three and convert the grouped digits to octal by using the concept of (4, 2, 1). • If the digits is not enough to form a grouping of three then append 0 on the left side of the digits. • If the given hexadecimal have fraction, then append 0 on the right side of the given digits. 75
  • 76. Hexadecimal to Octal (cont.) • Steps in converting Hexadecimal to Octal: – Convert the hexadecimal digits in binary by considering each given digits – Once converted to binary group the binary into three and using the concept (4, 2, 1). 76
  • 77. Example: Hexadecimal to Octal 7AE316 = ?8 = 7 0111 A 1010 E 1110 3 0011 = 0 111 101 011 100 0112 = 753438 7 5 3 4 3 77
  • 78. Example: Hexadecimal to Octal 1F0C16 = ?8 1 F 0 C 0001 1111 0000 1100 1 7 4 1 4 1F0C16 = 174148 78
  • 79. Hexadecimal to Decimal • Each hexadecimal position is weighted with a power of 16. • Digits on the left side of the radix point has a positive exponent while on the right side of the radix point has a negative exponent. • Converting a hexadecimal number to a decimal number is done by successively multiplying the decimal number by 16 on the left side of the radix • If you will have a fractional part of the given decimal, successively multiplying the decimal number by 16 on the right side of the radix. 79
  • 80. Hexadecimal to Decimal (cont.) • Steps in converting Hexadecimal to Decimal: – Place a number marker on the top of the given number for determining the exponent to be used. – Get the individual digit and multiply it by the base number (16) and raised it with the exponent corresponds to the number marker you place on each digit, then to the addition operation. 80
  • 81. Example: Hexadecimal to Decimal 286A16 = ?10 = 286A = 2*163 + 8*162 + 6*161 + A*160 = 1034610 3 2 1 0 81
  • 82. Example: Hexadecimal to Decimal (AC)16 → ( ? )10 Using expansion method, we have- (AC)16 = ( A x 161 + C x 160 )10 = ( 10 x 16 + 12 x 1 )10 = ( 160 + 12 )10 = ( 172 )10 82
  • 83. Example: Hexadecimal to Decimal (AC.FBA5)16 → ( ? )10 Using expansion method, we have- (AC.FBA5)16 = ( A x 161 + C x 160 + F x 16-1 + B x 16-2 + A x 16-3 + 5 x 16-4 )10 = ( 10 x 16 + 12 x 1 + 15 x 16-1 + 11 x 16-2 + 10 x 16-3 + 5 x 16-4 )10 = ( 160 + 12 + 0.9375 + 0.0429 + 0.0024 + 0.0001 )10 = ( 172.9829 )10 83

Notes de l'éditeur

  1. 4
  2. 12
  3. 28
  4. 30
  5. 31
  6. 37
  7. 43
  8. 60
  9. 61
  10. 65
  11. 66
  12. 72
  13. 81