9th & 10th Class Computer Science Formulas
Number system conversions, Boolean algebra and logic gate rules for 9th and 10th class computer science.
Number Systems (15)
| Formula | Expression |
|---|---|
| Binary to Decimal | Decimal = Σ(digit × 2^position), position starting at 0 from right |
| Decimal to Binary | Repeatedly divide decimal number by 2, read remainders bottom to top |
| Binary to Octal | Group binary digits in 3s from right, convert each group to octal digit |
| Binary to Hexadecimal | Group binary digits in 4s from right, convert each group to hex digit |
| Octal to Decimal | Decimal = Σ(digit × 8^position) |
| Hexadecimal to Decimal | Decimal = Σ(digit × 16^position) |
| 1's Complement | Flip every bit (0→1, 1→0) |
| 2's Complement | 2's Complement = 1's Complement + 1 |
| Signed Binary Range (n bits) | Range = −2^(n−1) to 2^(n−1) − 1 |
| Unsigned Binary Range (n bits) | Range = 0 to 2ⁿ − 1 |
| BCD (Binary Coded Decimal) | Each decimal digit represented by its own 4-bit binary code |
| ASCII Value Range | Standard ASCII = 0 to 127 (7-bit) |
| Number of Addressable Bytes (n address lines) | Bytes = 2ⁿ |
| Floating Point Bias (IEEE 754 Single) | Bias = 127, Exponent stored = Actual exponent + 127 |
| IEEE 754 Single Precision Value | Value = (−1)^S × 1.M × 2^(E−127) |
Boolean Algebra & Logic Gates (13)
| Formula | Expression |
|---|---|
| AND Gate | Y = A · B (Y = 1 only if A = 1 and B = 1) |
| OR Gate | Y = A + B (Y = 1 if A = 1 or B = 1) |
| NOT Gate | Y = A' (inverts input) |
| NAND Gate | Y = (A · B)' |
| NOR Gate | Y = (A + B)' |
| XOR Gate | Y = A ⊕ B (Y = 1 only when A ≠ B) |
| XNOR Gate | Y = (A ⊕ B)′ (Y = 1 only when A = B) |
| De Morgan's First Theorem | (A · B)' = A' + B' |
| De Morgan's Second Theorem | (A + B)' = A' · B' |
| Idempotent Law | A · A = A, A + A = A |
| Complement Law | A · A' = 0, A + A' = 1 |
| Absorption Law | A + (A · B) = A, A · (A + B) = A |
| Distributive Law | A · (B + C) = (A·B) + (A·C) |
IT Fundamentals (6)
| Formula | Expression |
|---|---|
| Green Computing (concept) | designing and using computers and IT resources in an energy-efficient, environmentally responsible way |
| Open Source vs Proprietary Software (concept) | open source allows free access and modification of source code; proprietary software restricts it under license |
| System Software vs Application Software (concept) | system software manages hardware and runs the computer (e.g. OS); application software performs user tasks |
| Compiler Error vs Runtime Error (concept) | a compiler error is caught before the program runs; a runtime error occurs while the program is executing |
| Digital Divide (concept) | the gap between those who have easy access to computers/internet and those who do not |
| Data vs Information (concept) | data is raw, unprocessed facts; information is data that has been processed into a meaningful form |
About these 9th & 10th Class Computer Science formulas
This is a compact page, because computer science at this level relies on a handful of methods: converting between binary, decimal, octal and hexadecimal, the rules of Boolean algebra, and the behaviour of the logic gates, plus some units for IT fundamentals. Most of these are procedures rather than formulas, so the best way to use the page is to follow the steps on paper with your own numbers, and then check your answer by converting back.
How to revise 9th & 10th Class Computer Science
- Learn the powers of two up to 2¹⁰ (1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024). Binary conversions become fast once you know them.
- Memorise the truth tables of AND, OR, NOT and XOR. Every Boolean expression is built from these four.
- Always check a conversion by going back. If decimal 45 becomes binary 101101, then 101101 must give 45 again.
- For hexadecimal, group the binary digits in fours from the right. Each group is one hex digit.
Worked example
Question. Convert the decimal number 45 to binary, and check it by converting back.
Divide by 2 and keep the remainders: 45 → 22 r1, 22 → 11 r0, 11 → 5 r1, 5 → 2 r1, 2 → 1 r0, 1 → 0 r1.
Read the remainders from bottom to top: 101101.
Check: 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45.
Common mistakes
- Reading the remainders from top to bottom. They must be read from the bottom up.
- Mixing up OR and XOR. XOR gives 1 only when the two inputs are different, while OR also gives 1 when both are 1.
- Starting the position count at 1 instead of 0 when converting binary to decimal. The rightmost digit is 2⁰.
FAQ
How do I convert a decimal number to binary?
Divide the number by 2 again and again, writing down each remainder, until you reach 0. Then read the remainders from the last to the first.
What is the output of an XOR gate?
The output is 1 only when the two inputs are different. If both inputs are the same, 0 or 1, the output is 0.
How many addressable bytes do n address lines give?
They give 2ⁿ bytes. With 10 address lines that is 1,024 bytes, which is 1 KB.