Post on 15-Apr-2017
transcript
Number Systems
University Computer Center
Topic:- Number System
Presented by:-MohammedShoyeb
Submitted to:-
Mrs. Priyanka maam
ObjectiveUnderstand the concept of number systems.Distinguish between non-positional and positional number systems.Describe the decimal, binary, OCTAL and HEXADECIMAL system. Convert a number in binary, octal or hexadecimal to a number in the decimal system.Convert a number in the decimal system to a number in binary, octal and hexadecimal.Convert a number in binary to octal and vice versa.Convert a number in binary to hexadecimal and vice versa.
IntroductionANumber System(orsystem of numeration) is awriting systemfor expressing numbers, that is amathematical notationfor representing numbersof a given set, usingdigitsor other symbols in a consistent manner.Ideally, a numeral system will Represent a useful set of numbers (e.g. allintegers, orrational numbers) Give every number represented a unique representation (or at least a standard representation)Reflect the algebraic and arithmetic structure of the numbers.
Types of Number SystemPositional NumberNon-Positional NumberPositional Number-In a Positional Number System there are only a few symbols called represent different values, depending on the position they occupy in a number. The value of each digit in such a number is determined by three considerationsThe digit itselfThe position of the digit in the numberThe base of the number system(where base is defined as the total number of digits available in the number system)Non-positional Number-In This system we have symbols such as I for 1,II for 2,III for 3 etc. Each symbols represents the same value regardless of its position in a number and to find the value of a number.
Types of positonal Number System
The Binary System(base 2)
The word binary is derived from the Latin root bini (or two by two). In this system the base b = 2 and we use only two symbols
S ={1,0}
The symbols in this system are often referred to as binary digits or bits (binary digit).
The Decimal System(base 10)
The word decimal is derived from the Latin root decem (ten). In this system the base b = 10 and we use ten symbols s={0,1,2,3,4,5,6,7,8,9}Example:-
The Octal System(base 8)
The word octal is derived from the Latin root octo (eight). In this system the base b = 8 and we use eight symbols to represent a number. The set of symbols is S={0,1,2,3,4,5,6,7}
The base of the octal number system is eight, so each position of the octal number represents a successive power of eight. From right to left
The Hexadecimal System(base 16)
The word hexadecimal is derived from the Greek root hex (six) and the Latin root decem (ten). In this system the base b = 16 and we use sixteen symbols to represent a number. The set of symbols is S={0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
Note that the symbols A, B, C, D, E, F are equivalent to 10, 11, 12, 13, 14, and 15 respectively. The symbols in this system are often referred to as hexadecimal digits.
Common Number SystemsSystemBaseSymbolsUsed by humans?Used in computers?Decimal100, 1, 9YesNoBinary20, 1NoYesOctal80, 1, 7NoNoHexa-decimal160, 1, 9,A, B, FNoNo
Quantities/Counting (1 of 2) DecimalBinaryOctalHexa-decimal000011112102231133410044510155611066711177
Quantities/Counting (2 of 2) DecimalBinaryOctalHexa-decimal810001089100111910101012A11101113B12110014C13110115D14111016E15111117F
Etc
Conversion Among BasesThe possibilities:
Decimal
Octal
Binary
Hexadecimal
Quick Example
2510 = 110012 = 318 = 1916
Base
Binary to DecimalTechniqueMultiply each bit by 2n, where n is the weight of the bitThe weight is the position of the bit, starting from 0 on the rightAdd the results
Example
1010112 => 1 x 20 = 1 1 x 21 = 2 0 x 22 = 0 1 x 23 = 8 0 x 24 = 0 1 x 25 = 32 4310
Octal to DecimalTechniqueMultiply each bit by 8n, where n is the weight of the bitThe weight is the position of the bit, starting from 0 on the rightAdd the results
Example
7248 => 4 x 80 = 4 2 x 81 = 16 7 x 82 = 448 46810
Hexadecimal to DecimalTechniqueMultiply each bit by 16n, where n is the weight of the bitThe weight is the position of the bit, starting from 0 on the rightAdd the results
Example
ABC16=> Cx160= 12x1 = 12 Bx161= 11x16 = 176 Ax162= 10x256= 2560 274810
Decimal to BinaryTechniqueDivide by two, keep track of the remainderFirst remainder is bit 0 (LSB, least-significant bit)Second remainder is bit 1Etc.
Example
12510 = ?22 125 62 1
2 31 0
2 15 1
2 7 1
2 3 1
2 1 1
2 1 1
12510 = 11111012
Octal to BinaryTechniqueConvert each octal digit to a 3-bit equivalent binary representation
Example
7058 = ?2 7 0 5
111 000 101
7058 = 1110001012
Hexadecimal to BinaryTechniqueConvert each hexadecimal digit to a 4-bit equivalent binary representation
Example
10AF16 = ?2 1 0 A F
0001 0000 1010 1111
10AF16 = 00010000101011112
Decimal to OctalTechniqueDivide by 8Keep track of the remainder
Example
123410 = ?88 1234 154 28 19 28 2 38 0 2
123410 = 23228
Decimal to HexadecimalTechniqueDivide by 16Keep track of the remainder
Example
16 1234 2 16 77 13=D 16 4 123410 = ?16
123410 = 4D216
Binary to OctalTechniqueGroup bits in threes, starting on rightConvert to octal digits
Example
10110101112 = ?81 011 010 111
1 3 2 7
10110101112 = 13278
Binary to HexadecimalTechniqueGroup bits in fours, starting on rightConvert to hexadecimal digits
Example
10101110112 = ?1610 1011 1011
2 B B 10101110112 = 2BB16
Octal to HexadecimalTechniqueUse binary as an intermediary
Example
10768 = ?16 1 0 7 6
001 000 111 110
2 3 E
10768 = 23E16
Hexadecimal to OctalTechniqueUse binary as an intermediary
Example
1F0C16 = ?8 1 F 0 C
0001 1111 0000 1100
0 1 7 4 1 4
1F0C16 = 174148
FractionsBinary to decimal
10.1011 => 1 x 2-4 = 0.06251 x 2-3 = 0.1250 x 2-2 = 0.01 x 2-1 = 0.50 x 20 = 0.01 x 21 = 2.0 2.6875
FractionsDecimal to binary3.14579 .14579x 20.29158x 20.58316x 21.16632x 20.33264x 20.66528x 21.33056etc.11.001001...
Thank you