Fundamentals of Computers and Data Representation
What this domain tests
This domain checks whether you can move confidently between number systems, represent signed and unsigned values, and explain how characters are encoded. Questions often ask for a conversion, a complement, or a storage-size calculation.
Core rules
- Decimal is base 10; binary base 2; octal base 8; hexadecimal base 16, using A–F for 10–15.
- To convert decimal to another base, divide repeatedly by the target base and read remainders bottom-up. To convert back, multiply each digit by its positional weight and add.
- Group binary bits in threes for octal and fours for hexadecimal, starting from the binary point.
- In an n-bit 1's complement, flip every bit; in 2's complement, flip every bit and add 1. The leftmost bit is the sign bit in signed representation.
- ASCII is a 7-bit code (128 characters); extended ASCII uses 8 bits (256). Unicode is a universal character set, commonly encoded as UTF-8 or UTF-16.
- Storage: 1 byte = 8 bits; 1 KB = 1024 bytes; 1 MB = 1024 KB.
Worked example
Convert decimal 45 to binary. Powers of 2 are 32, 16, 8, 4, 2, 1. Now 45 = 32 + 8 + 4 + 1, so the bits for 32, 8, 4 and 1 are 1: 101101. Check: 32 + 0 + 8 + 4 + 0 + 1 = 45. To express −45 in 8-bit 2's complement, write +45 as 00101101, flip to 11010010, add 1 → 11010011. The sign bit is 1, confirming a negative value.
Traps
- Reading remainders top-down instead of bottom-up.
- Forgetting that the range of an n-bit signed number is −2^(n−1) to 2^(n−1)−1, and that 2's complement of 0 is 0.
- Mixing KB (1024 bytes) with kb (kilobits).
- Padding hexadecimal groups on the wrong side of the binary point.