Back to marketplace

1.4.1 Data Types

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

What are the 5 primitive data types?

Back (Answer)

• Real / Floating Point – Stores decimal numbers (3.141) • Character - A single letter, number or special character (‘H’) • String – A collection of characters (“Hello World”) • Boolean – TRUE or FALSE • Integer – A positive or negative whole number (24, -34)

#2
Front (Question)

What is casting? This is sometimes referred to as parsing

Back (Answer)

The process of changing one data type into another.

#3
Front (Question)

What is a character set? What are some examples?

Back (Answer)

• A list of the characters the computer can represent. • Each character is represented by a unique binary value. • Used to map binary values to characters. Examples: UNICODE and ASCII

#4
Front (Question)

Describe the ASCII character set

Back (Answer)

• ASCII is a character set which is a subset of UNICODE • Uses 7 bits, or 8 bits for extended ASCII • Fewer characters can be represented than UNICODE • Characters from different languages cannot be represented in ASCII

#5
Front (Question)

Describe the UNICODE character set

Back (Answer)

• Each character is represented by 1-4 bytes. • It supports a very large number of characters • It is backwards compatible with ASCII • Text using UNICODE rather than ASCII would take up more storage (roughly 4 times more)

#6
Front (Question)

Convert 177 to an unsigned 8-bit binary number

Back (Answer)

• Use the binary number line (128 | 64 | 32 | 16 | 8 | 4 | 2 | 1) • 128+32+16+1 = 177 Answer = 10110001

#7
Front (Question)

Convert the unsigned 8-bit binary number 10110010 to denary

Back (Answer)

Use the binary number line (128 | 64 | 32 | 16 | 8 | 4 | 2 | 1) 128+32+16+2 = 178

#8
Front (Question)

Convert the denary number 188 to Hex

Back (Answer)

• Binary = 010111100 • Split from right to left into nibbles = 1011 1100 • Convert to denary using 8421 number line for each nibble • 1011 = 11 | 1100 = 12 • Remember A = 10 | F = 15 Answer = BC

#9
Front (Question)

Convert the hex FE to a denary number

Back (Answer)

• Remember A = 10 | F = 15 • F = 15 | E = 14 • Write each character in a 4-bit nibble = 1111 1110 • Combine into one binary number = 11111110 • Convert to denary = 128+64+32+16+8+4+2 Answer = 254

#10
Front (Question)

Convert -49 to an 8-bit binary number using two’s complement

Back (Answer)

• Write out the positive version of 49 in binary = 00110001 • Flip and add one to the bits (2’s Complement) = 11001111 Answer = 11001111 Alternative methods exist using (-128) + 64 + 8 + 4 + 2 + 1 = -49

#11
Front (Question)

Convert 49 to an 8-bit binary number using two’s complement

Back (Answer)

• No flipping required as it is a positive number • You only need to flip when it requires a negative number Answer = 00110001

#12
Front (Question)

Convert -49 to an 8-bit binary number using sign and magnitude

Back (Answer)

• Your left-most bit (most significant) is now only available to store a 1 for negative OR 0 for positive. • Use the remaining bits to make the number (-) 0110001 Answer = 10110001

#13
Front (Question)

Add the following two binary numbers 01101010 + 00111111

Back (Answer)

Stack the numbers on top of each other and use the rules of binary addition going from right to left • 0 + 0 = 0 • 1 + 0 = 1 • 1 + 1 = 0 (carry 1) • 1 + 1 + 1 = 1 (carry 1) 01101010 00111111 + Answer = 10101001 Carries - 11111100

#14
Front (Question)

Subtract the following two binary numbers 00101111 - 00010111

Back (Answer)

• Convert the second number to a negative version (flip+add 1) • Stack the original first number on top of the new negative second number • Follow the rules of binary addition Answer = 00011000 An overflow should always occur using this method An alternative borrowing method is also suitable

#15
Front (Question)

Normalise 0001011000 001100

Back (Answer)

• A normalised number can only start with 01 if positive, or 10 if it is negative • Remove the excess bits from the front of the number - be careful not to change the sign of the number. (01011000) • For each digit removed - pad the right of the mantissa with 0s (0101100000) • Convert the original exponent to denary and subtract the number of number bits that you removed from the front of the mantissa (12-2) • Convert the exponent back to binary (it could be a negative number) 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

#16
Front (Question)

Normalise 1110011000 001100

Back (Answer)

• A normalised number can only start with 01 if positive, or 10 if it is negative • Remove the excess bits from the front of the number - be careful not to change the sign of the number (10011000) • For each digit removed - pad the right of the mantissa with 0s (1001100000) • Convert the original exponent to denary and subtract the number of number bits that you removed from the front of the mantissa (12-2) • Convert the exponent back to binary (it could be a negative number) 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

#17
Front (Question)

Convert 5.25 to an 6-bit mantissa and 3-bit exponent

Back (Answer)

• Write out the number in fixed point binary (0101.01) • Float the binary point to be to the left of the first 1 (0.10101) • Write out the number without the binary point (010101) - this is your mantissa. If it is not long enough then pad on the right with zeros. • In binary, write out how many places you floated the binary point (011) this is your exponent. If it is not long enough then pad on the left with zeros. Answer = 010101 011 Alternative methods are available

#18
Front (Question)

Convert -5.25 to an 6-bit mantissa and 3-bit exponent

Back (Answer)

• Write out the number in fixed point binary (0101.01) • Float the binary point to be to the left of the first 1 (0.10101) • Write out the number without the binary point (010101) - this is your mantissa. If it is not long enough then pad on the right with zeros. • In binary, write out how many places you floated the binary point (011) this is your exponent. If it is not long enough then pad on the left with zeros. • We need the mantissa to be negative - so flip and add one to the bits. Answer = 101011 011 Alternative methods are available

#19
Front (Question)

Convert 01110 0001 to floating point denary

Back (Answer)

Pause! look at the binary. It starts with a zero, so is postive.. the exponent also starts with a zero, so overall this is not a really tiny number. * Convert the exponent (0001) to denary (Exp = 1) * If the mantissa is negative then flip and add one to it. * Add the binary point to the left of the first 1 in the mantissa (0.1110) * Float the binary point as dictated by the exponent - left if negative exponent OR right if positive exponent (01.110 in fixed point). * Calculate the denary value - normal binary to the left of the binary point and fractions to the right of it (1/2 | 1/4 | 1/8 | 1/16) Answer = 1.75 Alternative methods are available

#20
Front (Question)

Convert 10010 0001 to floating point denary

Back (Answer)

Pause! look at the binary. It starts with a one, so is negative..The exponent starts with a zero, so overall this is not a really tiny number. • Convert the exponent (0001) to denary (Exp = 1) • If the mantissa is negative then flip and add one to it (01110) • Add the binary point to the left of the first 1 in the mantissa (0.1110) • Float the binary point as dictated by the exponent - left if negative exponent OR right if positive exponent (01.110 in fixed point). • Calculate the denary value - normal binary to the left of the binary point and fractions to the right of it (1/2 | 1/4 | 1/8 | 1/16) Answer = -1.75 Alternative methods are available

#21
Front (Question)

Convert 0.125 to an 6-bit mantissa and 3-bit exponent

Back (Answer)

• Write out the number in fixed point (0.0010) - 1/8 • Calculate how many places the binary point needs to float to be to the left of the left-most one (2 places to the right, this is a negative movement) • Remove the additional zeros from the front of the mantissa to get it to be 01 for positive or 10 for negative. • Pad the mantissa on the right hand side to make it to the required number of bits (010000) • Write out your exponent 010 - flip to be negative 110 Answer = 010000 110 Any number less than 0.5 would have a negative exponent

#22
Front (Question)

Convert -0.125 to an 6-bit mantissa and 3-bit exponent

Back (Answer)

• Ignore the negative - write out the number in fixed point (0.0010) - 1/8 • Calculate how many places the binary point needs to float to be to the left of the left-most one (2 places to the right, this is a negative movement) • Remove the additional zeros from the front of the mantissa to get it to be 01 for positive or 10 for negative. • Pad the mantissa on the right hand side to make it to the required number of bits (010000) • Flip and add one to the mantissa to make it negative. • Write out your exponent 010 - flip to be negative 110 Answer = 110000 110 Alternative methods are available

#23
Front (Question)

Why do we normalise floating point numbers?

Back (Answer)

• Allows for more accuracy/precision from the given number of bits • So that the representation of each binary value is unique

#24
Front (Question)

What impact does increasing the size of the exponent have?

Back (Answer)

Increases the size of the number that can be stored. Allows us to move the binary point further