280 likes | 520 Views
Number Systems Rohit Khokher. NUMBER SYSTEM. POSTIONAL SYSTEM. NON-POSTIONAL SYSTEM. New numbers are formed using digits : 0-9 and a decimal point. New Symbolic representation for every number. +. +. 35. 25. POSITIONAL NUMBER SYSTEM.
E N D
NUMBER SYSTEM POSTIONAL SYSTEM NON-POSTIONAL SYSTEM New numbers are formed using digits: 0-9 and a decimal point. New Symbolic representation for every number. + + 35 25
POSITIONAL NUMBER SYSTEM Decimal (BASE 10) Number System uses 10 symbols 0,1,2,3,4,5,6,7,8,9 called digits. Decimal numbers Integer numbers Integers are whole numbers Examples 1, 2, -3, 50, 675, -560, ….. Real numbers Numbers that has fractions like 687. 345, -49.56, …
NUMBER SYSTEM • In computer real numbers are referred to as floating point numbers. • Floating point numbers are represented as <Integer part> <Radix Point> <Fractional part> 34568 . 56735 34568.56735
Decimal Number System In decimal number system the value of a digit is determined by digit × 10position . In integer numbers the position is defined as 0,1,2,3,4,5,… starting from the rightmost position and moving one position at a time towards left.
Decimal Number System 72134
Decimal Number System In floating point numbers the position is defined as 0,1,2,3,4,5,… starting from the radix point and moving one position at a time towards left, and -1,-2,-3, … starting from the radix point and moving towards right one position at a time. Position Place Value Digits 436.85 = 4 × 100 + 3 × 10 + 6 × 1 . 8 × 0 .1 + 5 × 0.01
Data Representation for Computers • Computers store numeric(numbers) as well non-numeric(text, images and others) data in binary representation (binary number system). • Binary number system is a two digits (0 and 1), also referred to as bits, so it is a base 2 system. • Binary number system is also a positional number system. In this system, the position definition is same as in decimal number system. • In binary number system the value of a digit is determined by digit × 2position .
Binary Number System Value = digit × 2position (11101)2 + = (29)10
Binary Number System Floating Point Number (101.11)2= (5.75)10 Position Place Value Digits 5 75
Can we make new number systems? Base Binary Decimal Octal Hexadecimal Relationship
Decimal, Binary, Octal and Hexdecimal (1101)2 = 1 x 23+1x22+0x21+1x20 = 1 x 8+ 1 x 4 + 0 x 2 + 1 x 1 = 8+4+0+1 = (13)10 Binary to decimal (2057)8 = 2 x 83+0x82+5x81+7x80 = 2 x 512+ 0 x 64 + 5 x 8 + 7 x 1 = 1024+0+40+7 = (1071)10 Octal to decimal (1AF)16 = 1 x 162+Ax161+Fx160 = 1 x 256+ 10 x 16 + 15 x 1 = 256+160+15 = (431)10 Fexadecimal to decimal
More examples Ternary (base-3) numbers Quaternary (base-4) numbers Quinary (base-5) numbers (211)3 = 2 x 32 + 1 x 31 + 1 x 30 =18 + 3+1 = (22)10 (211)4 = 2 x 42 + 1 x 41 + 1 x 40 =32 + 4+1 = (37)10 Senary (base-6 ) numbers ?? (base-7) numbers Tridecimal or Tredecimal (base-13) numbers (211)5 = 2 x 52 + 1 x 51 + 1 x 50 =50 + 5+1 = (56)10 Mayan number (base-20) system Ex. (211)6 = (?)10 (211)7 = (?)10 (211)13 = (?)10 (211)20= (?)10
From Decimal to Another Base • Divide the decimal number by the new base. • Record the remainder as the right most digit. • Divide the quotient of the previous divide by the new base. • Record the remainder as the next digit. • Repeat step 3& 4 until the quotient becomes 0 in step 3. Example Convert (25)10=()2 Number/ Base Quotient Reminder 25/2 12 1 6 0 12/2 6/2 3 0 3/2 1 1 1/2 0 1 (25)10=(11001)2
From Decimal to Another Base Convert (42)10=()2 Convert (952)10=()8 Convert (952)10=(1670)8 Convert (42)10=(101010)2
From Decimal to Another Base Convert (428)10=()16 Convert (100)10=()5 Convert (100)10=(400)5 Convert (428)10=(1AC)16
From Decimal to Another Base Convert (100)10=()4 Convert (1715)10=()12 Convert (1715)10=(BAB)12 Convert (100)10=(1210)4
Converting form a base other than to a base other than 10 Convert the original number to a decimal number. Convert that decimal number to the new base. Convert (545)6 to () 4 (545)6 = 5 x 62+4 x 61+ 5 x 60 = 5 x 36 + 4 x 6 + 5 x 1 = 180+24+5= (209)10 545)6 = (209)10=(3101) 4
Converting form a base other than to a base other than 10 Convert (101110)2 to () 8 (101110)2 = 1 x 25+0 x 24+1 x 23 +1 x 22+1 x 21+0 x 20 = (46)10 (101110)2 = (46)10=(56) 4 Convert (11010011)2 to () 16 (11010011)2 = 1 x 27+1 x 26+0 x 25 +1 x 24+0 x 23 +0 x 22+1 x 21+1 x 20 = (211)10 (11010011)2 = (211)10=D3) 16
Shortcut methods Binary to Octal Start from the rightmost position, make groups of three binary digits. Convert each group into octal digit 101110 Convert (101110)2 to () 8 (5 6)8 Octal to Binary Convert each octal to three digit binary. Combine them in a single binary number (5 6)8 (101110)2
Shortcut methods Convert (562) 8 to ()2 6 2 5 101 110 010 Convert (6751) 8 to ()2 5 6 7 1 110 111 101 001
Shortcut methods Binary to Hexadecimal conversion Starting from the right most position make groups of 4 binary digits Convert each group its hexadecimal equivalent digits (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Convert (10 1110 0000 1000)2 to () 16 10 1110 0000 1000 (2) (13) (0) (8) (2D08) 16
Shortcut methods Binary to Hexadecimal conversion Convert each hexadecimal digit 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F into 4 binary digit. Convert (1EBA2F ) 16 (2) (1) (B) (F) (E) 0001 1110 1011 0010 1111
Floating Point 368.65 368.65 x 10-1 = 36.865 368.65 x 101 = 3686.5 368.65 x 10-2 = 3.6865 368.65 x 102 = 36865. 368.65 x 10-3 = .36865 36865. x 10-2 .36865 x 103 Mantissa Exponent