Worksheets › Class 11 › Encoding Schemes and Number System › Cheat sheet
Class 11 Encoding Schemes and Number System: cheat sheet
CBSE Computer Science. How text is coded (ASCII, ISCII, Unicode) and how numbers are written in binary, octal, decimal and hexadecimal, with conversions including fractional parts.
Key ideas
- An encoding scheme gives every character a unique code: ASCII uses 7 bits (128 characters), ISCII adds the Indian scripts, and Unicode covers every script.
- In UTF-8 a character takes 1 to 4 bytes (an English letter 1, a Devanagari letter 3); in UTF-32 every character takes 4 bytes.
- Binary has base 2 (digits 0, 1), octal base 8 (0 to 7), decimal base 10, and hexadecimal base 16 (0 to 9, then A to F).
- Decimal to another base: divide by the base again and again, then read the remainders from the bottom up.
- Any base to decimal: multiply each digit by its place value (a power of the base) and add.
- One octal digit is exactly 3 bits and one hexadecimal digit 4 bits, so group the bits outwards from the point.
- A decimal fraction becomes binary by multiplying by 2 again and again, taking the whole parts from the top down.
Remember
| ASCII codes | 'A' = 65, 'a' = 97, '0' = 48, space = 32 |
| Hexadecimal digits | A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 |
| To decimal | (157)₈ = 1 × 64 + 5 × 8 + 7 = 111; (2F)₁₆ = 2 × 16 + 15 = 47 |
| Decimal to binary | 13 ÷ 2 gives remainders 1, 0, 1, 1; read upwards: (1101)₂ |
| Binary to octal and hex | 10111010 → 010 111 010 = (272)₈; 1011 1010 = (BA)₁₆ |
| After the point | places 1/2, 1/4, 1/8: (101.11)₂ = 5 + 1/2 + 1/4 = 5.75 |
| Fraction to binary | 0.625 × 2 = 1.25 → 1; 0.25 × 2 = 0.5 → 0; 0.5 × 2 = 1.0 → 1: 0.101 |
| Message size | 20 English letters + 10 Devanagari: UTF-8 20 + 30 = 50 bytes; UTF-32 120 bytes |
Watch out
- Reading the remainders from the top: the last remainder is the leftmost digit.
- Grouping bits from the left end: group from the point, adding 0s at the outer ends.
- Padding a fraction on the wrong side: .101 becomes .1010 for hexadecimal, which is .A.
- Taking 'a' as 65: capital letters start at 65, small letters at 97.
Worked example
Convert (10111100.101)₂ into (a) decimal (b) octal (c) hexadecimal.
Working: 188 + 5/8; octal: groups of three on each side of the point; hexadecimal: groups of four, padding the fraction with a 0 (1010)
Answer: (a) 188.625; (b) 274.5; (c) BC.A
Practise Encoding Schemes and Number System
Revise with this page, then practise: every Encoding Schemes and Number System sheet in the app is new, with an answer key and working.
Coming soon for Android and iPhone.