Unicode has enough capacity to represent a wealth of different languages, symbols and emoji.
Primitive data types include Integer, Real/Floating Point, Character, String, and Boolean.
Unicode solves the problem of ASCII’s limited character set.
128 characters is sufficient for standard letters, numbers and symbols, but ASCII encounters trouble when computers need to represent other languages with different characters.
Unicode uses a varying number of bits, allowing for over 1 million different characters, many of which have yet to be allocated.
Integer is a whole number that includes zero and negative numbers, but cannot have a fractional part.
Real numbers are positive or negative numbers which can, but do not necessarily, have a fractional part.
Character is a single symbol used by a computer, including the letters A to Z, the numbers 0 to 9 and hundreds of symbols like %, £ and 。
String is a collection of characters, which can be used to store a single character or many characters in succession.
Boolean data type values are restricted to True and False.
Integers can be represented in binary, hexadecimal and decimal.
Negative numbers can be represented in binary using sign magnitude or two’s complement.
Addition and subtraction of binary integers can be performed.
Positive integers can be represented in hexadecimal.
Positive integers can be converted between binary, hexadecimal and decimal.
Character sets are used to represent text, including ASCII and Unicode.
Data is always stored in binary by computers, but the way in which data is represented varies between different types of data.
In this case, the exponent is 5.
Floating point numbers can be split into two parts: mantissa and exponent.
The mantissa is always taken to have the binary point after the most significant bit.
Combining the three parts, the binary point needs to be moved five places to the right, giving us 110010.0111.
Floating point binary can be thought of as being like scientific notation.
One way to convert from hexadecimal to decimal is to first convert to binary, as explained above, and then convert from binary to decimal.
In binary, a sign of 0 represents a positive number and a 1 represents a negative number.
The hexadecimal number 4E7F equals 20095 in decimal.
In the case of a mantissa and exponent, the mantissa is 6.67 and the exponent is -11.
The mantissa in this case is 1.100100111.
When combined, the mantissa and exponent provide all the information needed to work out the actual value being represented.
The exponent is converted to decimal using the method explained earlier.
In the case of scientific notation, the mantissa is shifted 11 times from the decimal point.
Another way to convert from hexadecimal to decimal is to use the place values of hexadecimal to convert directly to decimal.
To convert hexadecimal to binary, first convert each hexadecimal digit to a decimal digit and then to a binary nybble before combining the nybbles to form a single binary number.
Strings can be used to store text and phone numbers which start with a 0, which numeric data types like integers would cut off.
Flipping all the bits and adding one gives us 11111001.
Checking the result, -16 + 8 + 4 = -4, so the calculation is correct.
Place values in hexadecimal start with 1 (16 0) and go up in powers of 16.
The two’s complement numbers are then added using the same technique for adding that was explained earlier before the result can be read off as 11100.
Hexadecimal makes use of the characters A-F to represent 10-15.
The binary byte representing 7 is 00000111.
Decimal 0-9, A-F are represented by the numbers 0-15 in hexadecimal.