1/25
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What are the five primitive data types?
Integer, Real/Floating Point, Character, String, Boolean.
What is a character?
A single symbol used by a computer (e.g., A
, 7
, %
).
How do computers store integers?
Using binary (base 2), where each bit represents a power of 2.
What is a byte?
8 bits.
What is a nibble?
4 bits (half a byte).
What are the two main methods to represent negative numbers in binary?
Sign magnitude and Two’s complement.
How does sign magnitude work?
The leftmost bit represents the sign (0 = positive, 1 = negative).
What is a problem with sign magnitude?
It has two representations for zero (00000000
and 10000000
).
How does two’s complement work?
The most significant bit (MSB) represents a negative value.
How do you convert a number to two’s complement?
Flip all bits and add 1.
What are the four rules of binary addition?
0 + 0 = 0
0 + 1 = 1
1 + 1 = 10 (carry 1)
1 + 1 + 1 = 11 (carry 1)
How is binary subtraction done?
By using two’s complement and then adding.
What is hexadecimal (hex)?
A base 16 number system using 0-9 and A-F.
How do you convert binary to hex?
Group bits into 4-bit chunks and convert each group to hex.
Convert 10101110
to hex.
1010 1110
→ AE
.
What are the two parts of a floating-point number?
Mantissa and Exponent.
What is the purpose of normalisation?
To ensure maximum precision by adjusting the mantissa and exponent.
How do you normalise a floating-point number?
Adjust the number so it starts with 01
(positive) or 10
(negative).
What are the three types of bitwise operations?
Shifts, AND/OR/XOR, Masks.
What does a left shift do?
Multiplies a number by 2^n.
What does a right shift do?
Divides a number by 2^n
What is a mask?
A binary pattern used to extract or modify specific bits.
What are the two main character sets?
ASCII and Unicode.
How many bits does ASCII use?
7 bits, representing 128 characters.
Why was Unicode introduced?
To support multiple languages and more characters.
How many bits does Unicode use?
Variable length (16-bit, 32-bit, etc.).