Representation of Numbers

In a computer, numbers are represented by numeric codes.

Representations of digits

Digits in base 10 (decimal): 0 1 2 3 4 5 6 7 8 9
 
Digits in base 16 (hex): 0 1 2 3 4 5 6 7 8 9 A B C D E F
 
Digits in base 8 (octal): 0 1 2 3 4 5 6 7
 
Digits in base 2 (binary): 0 1

Counting in different bases

What are the numbers after 9 in base 10?
10 11 12 ... 19 20 21 22 ... 99 100 101 ...
What are the numbers after F in base 16?
10 11 12... 19 1A 1B ... 1F 20 21 22 ... 99
9A 9B ... 9F A0 A1 ... A9 AA AB ... AF B0 ...
FF 100 101 ...
What are the numbers after 7 in base 8?
10 11 12 ... 17 20 21 22 ... 77 100 101 ...
What are the numbers after 1 in base 2?
10 11 100 101 110 111 1000 1001 1010
1011 1100 1101 1110 1111

Using bases other than 10

In base 10:
16498 = 1*104 + 6*103 + 4*102 + 9*101 + 8*100
In base 16:
16F98 = 1*164 + 6*163 + 15*162 + 9*161 + 8*160
So,  16F9816 = 9410410
In base 8:
16475 = 1*84 + 6*83 + 4*82 + 7*81 + 5*80
So,  164758 = 748510
In base 2:
11010 = 1*24 + 1*23 + 0*22 + 1*21 + 0*20
So,  110102 = 2610

What is the binary representation for 148?

Remember that:
20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64
27 = 128
28 = 256
29 = 512
210 = 1024