1.4.1 Data Types Flashcards
(15 cards)
What is a data type?
A classification of data into groups according to the kind of data they represent e.g., integer, real, char, string, and Boolean.
What is casting?
When you convert one data type into another data type.
How many bits does a byte represent?
8 bits.
What is binary?
A system of representing info using only two digits (0 and 1).
What is a bit?
The smallest unit of digital information, representing either an “off” (0) or an “on” (1) state.
What data type should be used for storing a phone number like 07886756443?
String
Numeric types would omit the leading 0.
What data type should be used for storing a single character such as ‘a’, ‘$’, or ‘5’?
Char
Perform an AND mask on the binary numbers:
1101
1011
1001
Which data type stores a collection of characters?
String
What do the following binary numbers add to:
1. 0+0+0
2. 0+0+1
3. 0+1+1
4. 1+1+1
- 0
- 1
- 10
- 11
What is the decimal 17 in binary? Give your answer as a byte
00010001
What does the most significant bit in sign and magnitude represent if it is 1 and if it is 0?
1 means negative number, 0 means positive number.
Translate the binary number 1000 1111 to denary using Sign and Magnitude
-15
Translate 24 to binary using sign and magnitude
0001 1000
What does the most significant bit in Two’s complement represent if it is 1 and if it is 0?