wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

NEW 1.4.1 Data Types

Total questions: 67

Worksheet time: 34mins

Name
Class
Date
1.

In floating point representation what is the purpose of the mantissa?

a)

Stores the actual value

b)

Tells you if the number is using two's complement or sign and magnitude

c)

Stores the position of the binary point

d)

Tells you know if the number is negative or positive

2.

How would you store the base-10 denary number -55 using two's complement in 8-bits?

a)

0101 0111

b)

0011 0111

c)

1100 1001

d)

1010 0100

3.

What is the hexadecimal number 20 in binary?

a)

0000 0010

b)

0010 0000

c)

0001 0000

d)

0001 0100

4.

What is the number 6 in binary?

a)

0000 0110

b)

0000 1010

c)

0011 1111

d)

0000 0111

5.

In this line of code: FOR counter = 1 to 10, what data type should counter be declared as?

a)

Integer

b)

String

c)

Boolean

d)

Real

6.

What is the binary number 0011 0100 in hexadecimal?

a)

34

b)

24

c)

38

d)

52

7.

What is the result of binary left shifting 0100 0010 one digit?

a)

0010 0010

b)

1000 0100

c)

0010 0001

d)

0100 0001

8.

What is the result of using the XOR mask 1111 0000 with the binary value 1001 1101?

a)

0110 1010

b)

1001 1101

c)

0110 0010

d)

0110 1101

9.

What does bitwise AND do to a sequence of bits?

a)

Toggles a subset of the bits

b)

Extracts a subset of the bits

c)

Sets a subset of the bits

d)

None of these

10.

What is the result of using an AND mask 0101 1111 with the binary value 0110 0001?

a)

0111 1111

b)

0100 0001

c)

1011 1110

d)

1011 1111

11.

In this line of code, identify a casting function: score = score + int(input('Enter your score: '))

a)

score

b)

'Enter your score: '

c)

int

d)

input

12.

ASCII was originally a 7 bit character set. This means it could store in binary:

a)

2^8 = 256 characters

b)

2^7 = 128 characters

c)

7*8 = 56 characters

d)

2*7 = 14 characters

13.

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?

a)

Shift the floating binary point 2 places to the left

b)

Shift the floating binary point 2 places to the right

c)

Shift the floating binary point 6 places to the right

d)

Shift the floating binary point 6 places to the left

14.

What is the binary number 0001 0011 in denary?

a)

3

b)

19

c)

18

d)

9

15.

What data type should be used for storing an average?

a)

Real

b)

String

c)

Boolean

d)

Integer

16.

Why do we normalise floating point binary numbers?

a)

So that we can store positive numbers in the negative form

b)

So that we store numbers to the greatest degree of accuracy possible

c)

So that we can perform binary arithmetic

d)

There is no other way to store floating point binary numbers

17.

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?

a)

+128

b)

-128

c)

+ character

d)

- character

18.

What is the purpose of bitwise masks?

a)

Allows you to perform addition and subtraction on negative numbers

b)

Allows you to shift a binary number in order to perform multiplication

c)

Allows you to shift a binary number in order to perform division

d)

Allows you to isolate and extract, toggle and set bit values in a sequence

19.

What is the denary number 20 in hexadecimal?

a)

14

b)

8

c)

16

d)

32

20.

In this line of code, identify a string: score = score + int(input('Enter your score: '))

a)

'Enter your score: '

b)

input

c)

score

d)

int

21.

What is an integer data type?

a)

A set of alphanumeric characters

b)

A whole number

c)

A number that may have a fractional component

d)

A value that is true or false, -1/1 or 0

22.

What is a string data type?

a)

A set of alphanumeric characters

b)

A whole number

c)

A number that may have a fractional component

d)

A value that is true or false, -1/1 or 0

23.

What data type should be used for storing a telephone number?

a)

Boolean

b)

Integer

c)

Real

d)

String

24.

What data type should be used to store the value of a 4 digit pin number?

a)

Boolean

b)

Integer

c)

Real

d)

String

25.

How would you store the base-10 denary number -116 using sign and magnitude in 8-bits?

a)

1100 0100

b)

1111 0100

c)

0111 0101

d)

0111 0100

26.

What is the result of: 0000 0011 + 0000 0010

a)

0000 0011

b)

0000 0101

c)

0000 0001

d)

0000 0111

27.

What is the result of: 0001 0101 + 0000 0011

a)

0001 1000

b)

0000 0001

c)

0001 0111

d)

0000 0111

28.

What steps should you use to illustrate how the calculation 62 - 97 is performed in binary?

a)

Simply convert the numbers to binary and perform (62 - 97)

b)

Convert 97 into -97 and then perform the addition (62 + -97)

c)

Convert 62 into -62 and then perform the addition (-62 + 97)

d)

Use Sign and magnitude representation to perform the calculation

29.

Computers can only process data in this format.

a)

Denary

b)

Binary

c)

ASCII

d)

Hexadecimal

30.

What is the character data type?

a)

A single alphanumeric character

b)

An single item of punctuation e.g. ?

c)

A single alphabetic character

d)

None of these

31.

How do you represent the denary number 12 in hexadecimal?

a)

D

b)

C

c)

B

d)

12

32.

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?

a)

+ character

b)

+128

c)

- character

d)

-128

33.

What is meant by the term, 'character set'?

a)

The American Standard Code for Information Interchange

b)

A defined list of characters recognised by the computer hardware and software

c)

The data type used to assign memory for a variable

d)

All the characters used in a language

34.

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'?

a)

Two's complement

b)

Mantissa and exponent

c)

Sign and magnitude

d)

Floating point

35.

What character set can be described as, 'an international encoding standard for use with different languages and scripts'?

a)

ASCII

b)

EBCDIC

c)

Unicode

d)

Extended ASCII

36.

In this line of code: x = True, what data type is x?

a)

String

b)

Boolean

c)

Real

d)

Integer

37.

How would you store the base-10 denary number +116 using sign and magnitude in 8-bits?

a)

0111 0101

b)

0100 0100

c)

0111 0100

d)

1111 0100

38.

What does bitwise XOR do to a sequence of bits?

a)

Sets a subset of the bits

b)

Extracts a subset of the bits

c)

Toggles the bits from 0 to 1 or 1 to 0

d)

None of these

39.

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:

a)

(2^16)*17 = 1,114,112 characters

b)

(2^17)*16 = 2,097,152 characters

c)

(2^2)*17 = 68 characters

d)

2^17 = 131,072 characters

40.

ASCII is an example of:

a)

A searching algorithm

b)

A standard for meta-data

c)

A character set

d)

A conversion technique for hexadecimal to denary

41.

What is the hexadecimal number 24 in denary?

a)

32

b)

36

c)

16

d)

28

42.

Why is sign and magnitude rarely used?

a)

Arithmetic with numbers in sign and magnitude format is more difficult

b)

Because it requires a RISC architecture

c)

Because it requires an extra bit in the accumulator register

d)

It is an old representation of negative numbers and it has been superseded

43.

Why do we often choose to represent base-2 binary numbers in base-16 hexadecimal?

a)

It provides for a more compact and human-readable format of a number than binary

b)

Machine code run on the processor is written in hexadecimal

c)

Computers store memory addresses as hexadecimal values

d)

Computers can't perform calculations in binary

44.

Extended ASCII is an 8 bit character set. This means it could store in binary:

a)

2*8 = 16 characters

b)

2^7 = 128 characters

c)

2^8 = 256 characters

d)

8*8 = 64 characters

45.

What is the binary number 0100 1111 in hexadecimal?

a)

8E

b)

4F

c)

117

d)

79

46.

What are floating point data types?

a)

Any data type that can store negative numbers

b)

Any data type that can store positive numbers

c)

Any data type that can store a decimal / fractional part of a number

d)

Any data type that can store both positive and negative numbers

47.

Which of the following is the normalised representation of the base-10 denary number 1?

a)

00100 010

b)

00010 011

c)

01000 001

d)

None are normalised

48.

What data type should be used for storing the name of a person?

a)

Boolean

b)

String

c)

Integer

d)

Real

49.

In floating-point representation what is the purpose of the exponent?

a)

Stores the position of the binary point

b)

Tells you if the number is using two's Complement or sign and magnitude

c)

Tells you know if the number is negative or positive

d)

To store the actual value of the number

50.

In this line of code: x = 6 < 3, what data type is x?

a)

Boolean

b)

Integer

c)

String

d)

Real

51.

Which of the following 8-bit floating point binary numbers is normalised?

a)

0010 1000

b)

1100 0101

c)

1011 0100

d)

0000 1111

52.

What is the denary number 26 in hexadecimal?

a)

2A

b)

1A

c)

B6

d)

14

53.

What data type should be used to store the value for Pi?

a)

Boolean

b)

Integer

c)

String

d)

Real

54.

What is the binary number 0000 1001 in denary?

a)

8

b)

9

c)

10

d)

1001

55.

What does bitwise OR do to a sequence of bits?

a)

None of these

b)

Toggles a subset of the bits

c)

Extracts a subset of the bits

d)

Sets a subset of the bits to 1

56.

Using two's complement representation, what is the negative version of the following 8-bit binary number: 0100 0100?

a)

1111 0000

b)

1011 1100

c)

1011 1011

d)

1100 0100

57.

What is the number 11 in binary?

a)

0000 0011

b)

0000 0110

c)

0000 1011

d)

0000 1010

58.

What is a Boolean data type?

a)

A number that may have a fractional component

b)

A whole number

c)

A set of alphanumeric characters

d)

A value that is true or false, -1/1 or 0

59.

What is the result of binary right shifting 0100 0010 one digit?

a)

0010 0001

b)

0100 0001

c)

0010 0010

d)

1000 0100

60.

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.

a)

Mantissa and exponent

b)

Two's complement

c)

Sign and magnitude

d)

Floating point

61.

What is meant by the term casting?

a)

A character that represents an action

b)

A value that does not change whilst the program is running

c)

Converting a variable from one data type to another

d)

A string with a single alphanumeric character

62.

What is the binary number 1100 0011 in hexadecimal?

a)

123

b)

D2

c)

C3

d)

195

63.

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?

a)

Shift the floating binary point 3 places to the left

b)

Shift the floating binary point 3 places to the right

c)

Multiple the mantissa by 3

d)

Divide the mantissa by 3

64.

How would you store the base-10 denary number +55 using two's complement in 8-bits?

a)

0011 0111

b)

1100 1001

c)

0101 0111

d)

1010 0100

65.

What is a real number data type?

a)

A value that is true or false, -1/1 or 0

b)

A number that may have a fractional component

c)

A whole number

d)

A set of alphanumeric characters

66.

What is the result of using an OR the mask 0010 0000 with the binary value 0100 0011?

a)

1011 1100

b)

0110 0011

c)

0100 0001

d)

1001 0001

67.

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?

a)

The result would underflow

b)

The result would overflow

c)

We should be using sign and magnitude for all calculations

d)

The numbers should be normalised first