What are the 5 primitive data types?
What is casting?
This is sometimes referred to as parsing
The process of changing one data type into another.
What is a character set?
What are some examples?
Describe the ASCII character set
Describe the UNICODE character set
Convert 177 to an unsigned 8-bit binary number
Answer = 10110001
Convert the unsigned 8-bit binary number 10110010 to denary
Use the binary number line (128 | 64 | 32 | 16 | 8 | 4 | 2 | 1)
128+32+16+2 = 178
Convert the denary number 188 to Hex
Answer = BC
Convert the hex FE to a denary number
Answer = 254
Convert -49 to an 8-bit binary number using two’s complement
Answer = 11001111
Alternative methods exist using (-128) + 64 + 8 + 4 + 2 + 1 = -49
Convert 49 to an 8-bit binary number using two’s complement
Answer = 00110001
Convert -49 to an 8-bit binary number using sign and magnitude
Answer = 10110001
Add the following two binary numbers
01101010 + 00111111
Stack the numbers on top of each other and use the rules of binary addition going from right to left
01101010
00111111 +
Answer = 10101001
Carries - 11111100
Subtract the following two binary numbers
00101111 - 00010111
Answer = 00011000
An overflow should always occur using this method
An alternative borrowing method is also suitable
Normalise
0001011000 001100
Answer = 0101100000 001010
(Remove the two extra bits from the front of the mantissa and reduce the exponent value by 2)
Alternative methods are available
Normalise
1110011000 001100
Answer = 1001100000 001010
(Remove the two extra bits from the front of the mantissa and reduce the exponent value by 2)
Alternative methods are available
Convert 5.25 to an 6-bit mantissa and 3-bit exponent
Answer = 010101 011
Alternative methods are available
Convert -5.25 to an 6-bit mantissa and 3-bit exponent
Answer = 101011 011
Alternative methods are available
Convert 01110 0001 to floating point denary
Answer = 1.75
Alternative methods are available
Convert 10010 0001 to floating point denary
Answer = -1.75
Alternative methods are available
Convert 0.125 to an 6-bit mantissa and 3-bit exponent
Answer = 010000 110
Any number less than 0.5 would have a negative exponent
Convert -0.125 to an 6-bit mantissa and 3-bit exponent
Answer = 110000 110
Alternative methods are available
Why do we normalise floating point numbers?
Allows for more accuracy/precision from the given number of bits
So that the representation of each binary value is unique
What impact does increasing the size of the exponent have?
Increases the size of the number that can be stored.