Agenda. Data Representation Purpose Numbering Systems Binary, Octal, Hexadecimal (Hex) Numbering System Conversions Binary to Octal, Octal to Binary Binary to Hex, Hex to Binary. Data Representation. Manipulating binary data on the computer:
Before you can program at the “machine level” you need to understand how computers store data such as numbers and characters.
The “2” represents the binary code (i.e. “0” and “1” in the code). The “n” represents the total number of digits in the binary code.Example: 2^8 = 256 Therefore, an eight-digit binary code would allowa total of 256 characters, or positive integers from0 to 255, or integers from –128 to 127.
Remember that zero takes up one of those numbers as well!
164 (Decimal number)Therefore the binary code 10100100 represents the decimal number 164.
Note - In Hex:
A = 10B = 11C = 12D = 13E = 14F = 15
1 octal number is equal to 3 binary numbers. Group binary numbers into groups of 3’s starting from the right and multiply each digit by the appropriate power of 2, then add.
“Spread-out” octal number to make room for binary number result.
Determine digits(0’s or 1’s) that are required when multiplied by appropriate power of 2 to add up to octal digit.
1 hexadecimal number is equal to 4 binary numbers. Group binary numbers into groups of 4’s starting from the right. Add leading zeros if last group of digits is less than 4. To obtain result, multiply digit by appropriate power of 2, then add.
“Spread-out” hex number to make room for binary number result.
Determine digits(0’s or 1’s) that are required when multiplied by appropriate power of 2 to add up to hexadecimal digit.
The combination of red, blue and green colour settings will create any colour desired. Check the “webpage colour selector” link contained in UNX122 course notes!
The computer uses special mathematical tricks such as“bit-shifting” and “two’s complement” to perform common mathematical operations other than simply add numbers.