NEW
Font size
WorksheetsNEW 1.4.1 Data Types
Total questions: 67
Worksheet time: 34mins
In floating point representation what is the purpose of the mantissa?
Stores the actual value
Tells you if the number is using two's complement or sign and magnitude
Stores the position of the binary point
Tells you know if the number is negative or positive
How would you store the base-10 denary number -55 using two's complement in 8-bits?
0101 0111
0011 0111
1100 1001
1010 0100
What is the hexadecimal number 20 in binary?
0000 0010
0010 0000
0001 0000
0001 0100
What is the number 6 in binary?
0000 0110
0000 1010
0011 1111
0000 0111
In this line of code: FOR counter = 1 to 10, what data type should counter be declared as?
Integer
String
Boolean
Real
What is the binary number 0011 0100 in hexadecimal?
34
24
38
52
What is the result of binary left shifting 0100 0010 one digit?
0010 0010
1000 0100
0010 0001
0100 0001
What is the result of using the XOR mask 1111 0000 with the binary value 1001 1101?
0110 1010
1001 1101
0110 0010
0110 1101
What does bitwise AND do to a sequence of bits?
Toggles a subset of the bits
Extracts a subset of the bits
Sets a subset of the bits
None of these
What is the result of using an AND mask 0101 1111 with the binary value 0110 0001?
0111 1111
0100 0001
1011 1110
1011 1111
In this line of code, identify a casting function: score = score + int(input('Enter your score: '))
score
'Enter your score: '
int
input
ASCII was originally a 7 bit character set. This means it could store in binary:
2^8 = 256 characters
2^7 = 128 characters
7*8 = 56 characters
2*7 = 14 characters
Given the following 8-bit binary number: 10000 110 stored in normalised floating point form where the first 5-bits are the mantissa and the last 3-bits are the exponent, what is the exponent telling us to do?
Shift the floating binary point 2 places to the left
Shift the floating binary point 2 places to the right
Shift the floating binary point 6 places to the right
Shift the floating binary point 6 places to the left
What is the binary number 0001 0011 in denary?
3
19
18
9
What data type should be used for storing an average?
Real
String
Boolean
Integer
Why do we normalise floating point binary numbers?
So that we can store positive numbers in the negative form
So that we store numbers to the greatest degree of accuracy possible
So that we can perform binary arithmetic
There is no other way to store floating point binary numbers
In an 8-bit binary number stored using two's complement what would the most significant bit (left-most bit) represent if it was set to 1?
+128
-128
+ character
- character
What is the purpose of bitwise masks?
Allows you to perform addition and subtraction on negative numbers
Allows you to shift a binary number in order to perform multiplication
Allows you to shift a binary number in order to perform division
Allows you to isolate and extract, toggle and set bit values in a sequence
What is the denary number 20 in hexadecimal?
14
8
16
32
In this line of code, identify a string: score = score + int(input('Enter your score: '))
'Enter your score: '
input
score
int
What is an integer data type?
A set of alphanumeric characters
A whole number
A number that may have a fractional component
A value that is true or false, -1/1 or 0
What is a string data type?
A set of alphanumeric characters
A whole number
A number that may have a fractional component
A value that is true or false, -1/1 or 0
What data type should be used for storing a telephone number?
Boolean
Integer
Real
String
What data type should be used to store the value of a 4 digit pin number?
Boolean
Integer
Real
String
How would you store the base-10 denary number -116 using sign and magnitude in 8-bits?
1100 0100
1111 0100
0111 0101
0111 0100
What is the result of: 0000 0011 + 0000 0010
0000 0011
0000 0101
0000 0001
0000 0111
What is the result of: 0001 0101 + 0000 0011
0001 1000
0000 0001
0001 0111
0000 0111
What steps should you use to illustrate how the calculation 62 - 97 is performed in binary?
Simply convert the numbers to binary and perform (62 - 97)
Convert 97 into -97 and then perform the addition (62 + -97)
Convert 62 into -62 and then perform the addition (-62 + 97)
Use Sign and magnitude representation to perform the calculation
Computers can only process data in this format.
Denary
Binary
ASCII
Hexadecimal
What is the character data type?
A single alphanumeric character
An single item of punctuation e.g. ?
A single alphabetic character
None of these
How do you represent the denary number 12 in hexadecimal?
D
C
B
12
In an 8-bit binary number stored using sign and magnitude what would the most significant bit (left-most bit) represent if it was set to 1?
+ character
+128
- character
-128
What is meant by the term, 'character set'?
The American Standard Code for Information Interchange
A defined list of characters recognised by the computer hardware and software
The data type used to assign memory for a variable
All the characters used in a language
What number system can be described as, 'a method of storing positive and negative numbers using the most significant bit as a negative value place'?
Two's complement
Mantissa and exponent
Sign and magnitude
Floating point
What character set can be described as, 'an international encoding standard for use with different languages and scripts'?
ASCII
EBCDIC
Unicode
Extended ASCII
In this line of code: x = True, what data type is x?
String
Boolean
Real
Integer
How would you store the base-10 denary number +116 using sign and magnitude in 8-bits?
0111 0101
0100 0100
0111 0100
1111 0100
What does bitwise XOR do to a sequence of bits?
Sets a subset of the bits
Extracts a subset of the bits
Toggles the bits from 0 to 1 or 1 to 0
None of these
UTF-8 Unicode which is the most popular character set on the web uses 17, two byte code points in the character set. The number of characters in the set can be calculated as:
(2^16)*17 = 1,114,112 characters
(2^17)*16 = 2,097,152 characters
(2^2)*17 = 68 characters
2^17 = 131,072 characters
ASCII is an example of:
A searching algorithm
A standard for meta-data
A character set
A conversion technique for hexadecimal to denary
What is the hexadecimal number 24 in denary?
32
36
16
28
Why is sign and magnitude rarely used?
Arithmetic with numbers in sign and magnitude format is more difficult
Because it requires a RISC architecture
Because it requires an extra bit in the accumulator register
It is an old representation of negative numbers and it has been superseded
Why do we often choose to represent base-2 binary numbers in base-16 hexadecimal?
It provides for a more compact and human-readable format of a number than binary
Machine code run on the processor is written in hexadecimal
Computers store memory addresses as hexadecimal values
Computers can't perform calculations in binary
Extended ASCII is an 8 bit character set. This means it could store in binary:
2*8 = 16 characters
2^7 = 128 characters
2^8 = 256 characters
8*8 = 64 characters
What is the binary number 0100 1111 in hexadecimal?
8E
4F
117
79
What are floating point data types?
Any data type that can store negative numbers
Any data type that can store positive numbers
Any data type that can store a decimal / fractional part of a number
Any data type that can store both positive and negative numbers
Which of the following is the normalised representation of the base-10 denary number 1?
00100 010
00010 011
01000 001
None are normalised
What data type should be used for storing the name of a person?
Boolean
String
Integer
Real
In floating-point representation what is the purpose of the exponent?
Stores the position of the binary point
Tells you if the number is using two's Complement or sign and magnitude
Tells you know if the number is negative or positive
To store the actual value of the number
In this line of code: x = 6 < 3, what data type is x?
Boolean
Integer
String
Real
Which of the following 8-bit floating point binary numbers is normalised?
0010 1000
1100 0101
1011 0100
0000 1111
What is the denary number 26 in hexadecimal?
2A
1A
B6
14
What data type should be used to store the value for Pi?
Boolean
Integer
String
Real
What is the binary number 0000 1001 in denary?
8
9
10
1001
What does bitwise OR do to a sequence of bits?
None of these
Toggles a subset of the bits
Extracts a subset of the bits
Sets a subset of the bits to 1
Using two's complement representation, what is the negative version of the following 8-bit binary number: 0100 0100?
1111 0000
1011 1100
1011 1011
1100 0100
What is the number 11 in binary?
0000 0011
0000 0110
0000 1011
0000 1010
What is a Boolean data type?
A number that may have a fractional component
A whole number
A set of alphanumeric characters
A value that is true or false, -1/1 or 0
What is the result of binary right shifting 0100 0010 one digit?
0010 0001
0100 0001
0010 0010
1000 0100
What can be described as, 'a method of storing numbers which uses the most significant bit to represent a character. A + or - denoting whether the binary pattern is a positive or negative number.
Mantissa and exponent
Two's complement
Sign and magnitude
Floating point
What is meant by the term casting?
A character that represents an action
A value that does not change whilst the program is running
Converting a variable from one data type to another
A string with a single alphanumeric character
What is the binary number 1100 0011 in hexadecimal?
123
D2
C3
195
Given the following 8-bit binary number: 01101 011 stored in normalised floating point form where the first 5-bits are the mantissa and the last 3-bits are the exponent, what is the exponent telling us to do?
Shift the floating binary point 3 places to the left
Shift the floating binary point 3 places to the right
Multiple the mantissa by 3
Divide the mantissa by 3
How would you store the base-10 denary number +55 using two's complement in 8-bits?
0011 0111
1100 1001
0101 0111
1010 0100
What is a real number data type?
A value that is true or false, -1/1 or 0
A number that may have a fractional component
A whole number
A set of alphanumeric characters
What is the result of using an OR the mask 0010 0000 with the binary value 0100 0011?
1011 1100
0110 0011
0100 0001
1001 0001
Why doesn't it work to add together the following two binary numbers using two's complement and storing the result in 8-bits: 0111 000 + 0101 1110?
The result would underflow
The result would overflow
We should be using sign and magnitude for all calculations
The numbers should be normalised first
