(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 5 th century: place-value notation ◦ Placement of a symbol gave it added meaning In the 6 th 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 Example using base 3: The value of the symbol in each position is multiplied by the position value Position 4Position 3Position 2Position 1Position 0 Position value: base 4 Position value: base 3 Position value: base 2 Position value: base 1 Position value: base 0 Position 4Position 3Position 2Position 1Position 0 Position value: 3 4 Position value:3 3 2 Position value: 3 1 Position value: 3 0
Determining a value for a particular base and set of symbols (cont): ◦ Base 10 To convert from another base to base 10, calculate position value, multiply position value times symbol value, and add them all together Example: converting in base 3 to decimal Position 4Position 3Position 2Position 1Position 0 Position value: 10 4 = Position value: 10 3 = 1000 Position value: 10 2 = 100 Position value: 10 1 = 10 Position value: 10 0 = 1 Position 4Position 3Position 2Position 1Position 0 Position value: 3 4 = 81 Position value: 3 3 = 27 Position value: 3 2 = 9 Position value: 3 1 = 3 Position value: 3 0 = 1 81 * 1 = 8127 * 2 = 549 * 0 = 03 * 2 = 61 * 1 = in base 3 = = 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: Position 7Position 6Position 5Position 4Position 3Position 2Position 1Position 0 Position value: 2 7 = 128 Position value: 2 6 = 64 Position value: 2 5 = 32 Position value: 2 4 = 16 Position value: 2 3 = 8 Position value: 2 2 = 4 Position value: 2 1 = 2 Position value: 2 0 = * 1 = * 0 = 032 * 0 = 016 * 1 = 16 8 * 1 = 84 * 1 = 42 * 0 = 01 * 1 = binary = = 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
BinaryHexDecimal A B C D E F15
Some sequences of binary digits are represented as hex digits for convenience ◦ MAC: B-08-C7-4A; 00-1E-EC-DA ◦ 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:
In the past, base 8 (octal) numbering system was sometimes used It could easily represent three binary digits (2 3 = 8) Rarely used now