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
Left shift the following 8-bit number 3 places: 00111010
What mathematical operation is left shift equivalent to?
Remove the required number of bits from the left
Add the same number of zeros to the right
Answer = 11010000
Equivalent to multiplying the number
Right shift the following 8-bit number 3 places: 00111010
What mathematical operation is right shift equivalent to?
Remove the required number of bits from the right
Add the same number of zeros to the left
Answer = 00000111
Equivalent to dividing the number
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
Mask 11010101 using the AND mask 10101010
Answer = 10000000
Mask 11010101 using the OR mask 10101010
Answer = 11111111
Mask 11010101 using the XOR mask 10101010
Answer = 01111111
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