Presentation is loading. Please wait.

Presentation is loading. Please wait.

DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the.

Similar presentations


Presentation on theme: "DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the."— Presentation transcript:

1 DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the hundreds, the 2 represent the thousands. 2, 468 = 8*1 + 6*10 + 4*100 + 2*1000 You can use ANY number for a base

2 Hexadecimal Numbers – Base 16 Decimal NumberHexadecimal Number 00 11 22 33 44 55 66 77 88 99 10A or a 11B or b 12C or c 13D or d 14E or e 15F or f

3 Hexadecimal Numbers cont. 0x283 – C++ uses 0X or 0x to indicate that the number is hexadecimal. ( i. e. if you have the number 283 how would you know if it is a hexadecimal or decimal ? )

4 Hexadecimal to decimal conversion 0X283 = 3 * 16^0 + 8*16^1 + 2*16^2 = = 3*1 + 8*16 + 2*256 = 637 283h = 637d ( another way to differentiate between hexadecimal and decimal but this notation is good in assembly language and for humans too )

5 Binary Numbers ( base 2 ) The computer’s number system Whether you write a n umber in decimal, hexadecimal, octal, or even other base, the computer stores it in binary. 10011011 The memory is commonly organized in units called bytes ( 1 byte = 8 bits )

6 Conversion Binary numbers to Decimal 100110111 = 1*2^0 + 1 * 2^1 + 1 * 2^2 + 0*2^3 + 1*2^4 + 1*2^5 + 0*2^6 + 0*2^7 + 1*2^8 = 1*1 + 1 * 2 + 1 * 4 + 0 * 8 + 1 * 16 + 1* 32 + 0 * 64 + 0 *128 + 1 * 256 = 1 + 2 + 4 + 0 + 16 + 32 + 0 + 0 + 256 = 311

7 Easier Way to convert binary to base 10 2561286432168421 100110111

8 Base Table Decimal DigitBinary DigitHexadecimal Digit 000000 100011 200102 300113 401004 501015 601106 701117 810008 910019 101010A 111011B 121100C 131101D 141110E 151111F

9 Conversion from Decimal to Binary and Hexadecimal LONG DIVISION….. Pay attention in class Or Google – there are excellent sites that you can learn how to do it: Here is one of them: http://www.cs.iupui.edu/~n241/readings/binc onv.html#Dec2Bin1 http://www.cs.iupui.edu/~n241/readings/binc onv.html#Dec2Bin1


Download ppt "DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the."

Similar presentations


Ads by Google