1.4 Data Flashcards
Data Types Data Structures Boolean Algebra
What data type should be used for storing a phone number like 07574893758?
- String
Perform an AND mask on the binary numbers:
10101101
01011011
00001001
What data type stores a collection of characters?
String
Add the two binary numbers:
01011011
00111010
Give your answer in decimal.
149
What is the decimal 45 in binary? Give your answer as a byte.
00101101
What is the hexadecimal 2E in decimal?
46
What is the hexadecimal in binary? Give your answer as a byte.
01000101
Which data type stores just TRUE and FALSE?
Boolean
What is -5 in sign magnitude binary? Give your answer as a nibble.
1101
What does the binary 01101100 represent in hexadecimal?
6C
What is the effect of a logical shift left by one place?
The value is doubled
What is the two’s complement binary 10101101 in decimal?
-83
The binary 0011010000110 is a floating point number with a single-bit sign, 8-bit mantissa and 4-bit exponent. What is the number in decimal?
52
Perform a logical shift right two places on the binary number 01101010 and convert your result to decimal.
26.5
Perform an XOR masking on the binary numbers:
01010101
10111011
11101110
Which of the following is not a character? A) 8 B) R C) % D) 43
- D) 43
The binary 1100110000011 is a floating point number with a single bit sign, 8 bit mantissa and 4 bit exponent. What is the number in decimal?
-9.5
What is an array?
- An ordered, finite set of elements of a single type.
What type of array is a linear array?
- A one dimensional array
How can you visualise a two dimensional array?
- You can visualise it as a spreadsheet/table