Numeral systems (radix)
Commonly used systems Base / radix Name Symbols 2 Binary 0, 1 8 Octal 0, 1, 2, 3, 4, 5, 6, 7 10 Decimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 16 Hexadecimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 2018 Risto Heinsar
Binary (base 2) Positional number system Used mainly in digital circuitry Each digit is usually referred to as a bit 4 bits is a nibble, 8 bits is a byte Native format for most of the computers these days Typically written with either b suffix (00101b) or with base indication in subscript (01012) 2018 Risto Heinsar
Conversion (1) 77 = 10011012 Divide the decimal number by the radix of the desired system Repeat until the division result is less than 1 (integer division results to 0) Division remainders form the new number Start from the last remainder division result remainder 77 / 2 38 1 38 / 2 19 19 / 2 9 9 / 2 4 4 / 2 2 2 / 2 1 / 2 2018 Risto Heinsar
Conversion (2) 77 = 4D16 21980 = 55DC16 division result remainder in hex 77 / 16 4 13 D 4 / 16 division result remainder in hex 21980 / 16 1373 12 C 1373 / 16 85 13 D 85 / 16 5 5 / 5 2018 Risto Heinsar
Conversion (3) Positional number system – each position has a different value. In the case of binary, it’s the powers of two. 01 01102 = 0*25 + 1*24 + 0*23 + 1*22 +1*21 +0*20 = 22 02178 = 0*83 + 2*82+ 1*81 + 7*80 = 143 24A16 = 2*162 + 4*161 + 10*160 = 586 Easy to convert between binary and hexadecimal 0010 0110 1100 1011 0100 0001 1111 01102 2 6 C B 4 1 F 6 0010 0110 1100 1011 0100 0001 1111 01102 = 26 CB 41 F616 2018 Risto Heinsar
Base 10 Base 2 Base 8 Base 16 0000 0000 00 1 0000 0001 01 2 0000 0010 02 3 0000 0011 03 4 0000 0100 04 5 0000 0101 05 6 0000 0110 06 7 0000 0111 07 8 0000 1000 10 08 9 0000 1001 11 09 0000 1010 12 0A 0000 1011 13 0B 15 0000 1111 17 0F 16 0001 0000 20 0001 0001 21 18 0001 0010 22