Chapter 6 Computer Program Translation Computers use machine language -- simple instructions e.g. add two numbers -- represented by 0s and 1s Translators Assembler - simple "English" instructions to machine e.g. add -> 01001010 Compiler - High level language to executable file (machine) Interpreter - Reads high level language and executes each statement. (JavaScript) Representations Everything is a 1 or 0: bit - Binary digIT 8 bits - Byte 4 bits - nibble kiloBytes - 10^3 base two -> 2^10 = 1024 Mega 10^6 2^20 Giga 10^9 2^30 Tera 10^12 2^40 Positive Integers binary to decimal decimal to binary Hexadecimal - base 16 more digits: A, B, C, D, E, F ( and 0..9) Decimal Binary Hex 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F 0x185A6BE0