(Actually, “Numeral Systems”) Unary ◦ Each item is represented by an instance of a symbol Example: 7 might be ||||||| ◦ Also called “tally” Sign-value notation ◦ An abbreviated form of Unary ◦ Extra symbols replace groups of Unary symbols Example: + might represent 5 unary | symbols, and * might represent 10 unary | symbols, so 68 could be represented at ******+||| ◦ In both Unary and Sign-value notation, 0 isn’t used Roman numerals are a type of sign-value notation ◦ I is 1, V is 5, X is 10, etc. ◦ Added the concept of subtracting a smaller number from a larger one, if the smaller symbol was placed in front of the larger one: IX is 9, a shorter way of writing VIIII ◦ Very difficult to calculate anything other than small values and simple calculations ◦ Fractions are difficult to represent and calculate Two developments by Indian mathematicians led to our current number system In the 5th century: place-value notation ◦ Placement of a symbol gave it added meaning In the 6th century: the concept of zero Relatively small set of symbols used The placement of each symbol adds additional meaning ◦ Examples: 342 means three hundred forty two 423 means four hundred twenty three ◦ In a sign-value notation, each of these would add up to 9, the sum of the value of each symbol ◦ The value of placement makes a big difference The value of each position depends on the base used The system needs an ordered set of symbols ◦ There must be as many symbols as the base ◦ One of the symbols must be zero ◦ Example: A base three system might use the symbols 0, 1, 2 Counting: 0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, … The method of determining a value for a particular base and set of symbols is: 1. Number the positions from right to left, starting with zero 2. Each position then has a value of the base to the power of the number of that position Position 4 Position 3 Position 2 Position 1 Position 0 Position value: base4 Position value: base3 Position value: base2 Position value: base1 Position value: base0 Example using base 3: Position 4 Position 3 Position 2 Position 1 Position 0 Position value: 34 Position value: 33 Position value: 32 Position value: 31 Position value: 30 The value of the symbol in each position is multiplied by the position value Determining a value for a particular base and set of symbols (cont): ◦ Base 10 Position 4 Position 3 Position 2 Position 1 Position 0 Position value: 104 = 10000 Position value: 103 = 1000 Position value: 102 = 100 Position value: 101 = 10 Position value: 100 = 1 To convert from another base to base 10, calculate position value, multiply position value times symbol value, and add them all together Example: converting 12021 in base 3 to decimal Position 4 Position 3 Position 2 Position 1 Position 0 Position value: 34 = 81 Position value: 33 = 27 Position value: 32 = 9 Position value: 31 = 3 Position value: 30 = 1 81 * 1 = 81 27 * 2 = 54 9*0=0 3*2=6 1*1=1 12021 in base 3 = 81 + 54 + 0 + 6 + 1 = 142 in base 10 Base 2 used in computers because of the easy conversion of electrical switch state on/off to 1 and 0 Early attempts to use base 10 not successful ◦ Difficult to judge graduations in power from 0 to 9 (none to all) ◦ Easier to judge on/off state, even with noise in the measurement ◦ Base 10 might be more successful now with advanced tools, but binary is solidly established Translation from binary (base 2) to decimal (base 10) Example: 10011101 Position 7 Position 6 Position 5 Position 4 Position 3 Position 2 Position 1 Position 0 Position value: 7 2 = 128 Position value: 26 = 64 Position value: 25 = 32 Position value: 24 = 16 Position value: 23 = 8 Position value: 22 = 4 Position value: 21 = 2 Position value: 20 = 1 128 * 1 = 128 64 * 0 = 0 32 * 0 = 0 16 * 1 = 16 8*1=8 4*1=4 2*0=0 1*1=1 10011101 binary = 128 + 0 + 0 + 16 + 8 + 4 + 0 + 1 = 157 decimal In computers, a binary number can represent ◦ Data ◦ ◦ ◦ ◦ ◦ Number Character Sound Color Program instruction Memory address Screen location (pixel) A computer (IP address) etc Hexadecimal means 16; hexadecimal number system (hex) is base 16 First four positions in binary can represent 16 digits (0 – 15) Hex often used in place of binary for humans ◦ A single hex digit can replace 4 binary digits ◦ Easier to see/read/remember hex than binary Because base 16 system needs 16 symbols, the letters A-F are used in addition to 0-9: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Binary Hex Decimal 0000 0 0 0001 1 1 0010 2 2 0011 3 3 0100 4 4 0101 5 5 0110 6 6 0111 7 7 1000 8 8 1001 9 9 1010 A 10 1011 B 11 1100 C 12 1101 D 13 1110 E 14 1111 F 15 Some sequences of binary digits are represented as hex digits for convenience ◦ MAC: 00-24-2B-08-C7-4A; 00-1E-EC-DA-93-51 ◦ Memory addresses Often hex numbers have special characters added to make sure they are understood as hex ◦ Followed by a lowercase h ◦ Preceded by 0x (the number zero and lowercase x) Other sequences of binary digits are represented as decimal digits ◦ IP addresses: 127.0.0.1 In the past, base 8 (octal) numbering system was sometimes used It could easily represent three binary digits (23 = 8) Rarely used now