ISC CS Study Notes
ISC CS Study Notes
Computers use binary because digital circuits only have two stable states: ON/OFF, High/Low
voltage. Octal and hexadecimal exist purely as shorthand for binary — they make long strings of
1s and 0s easier for humans to read, because 3 binary bits = 1 octal digit, and 4 binary bits = 1 hex
digit exactly.
Notation: A number's base is written as a subscript. (25)₁₀ means 25 in decimal. (11001)₂
means that binary number.
(85)₁₀ = (125)₈
Same number to Hex: divide repeatedly by 16.
16 | 85 → remainder 5
16 | 5 → remainder 5
0
(85)₁₀ = (55)₁₆
Tip: Whatever the base, the process is identical — only the divisor changes.
→ 101001
Fractional part (0.75):
0.75 × 2 = 1.50 → integer part 1
0.50 × 2 = 1.00 → integer part 1
(0.95)₁₀ ≈ (0.1111001)₂
The same logic applies for converting to octal (multiply by 8) or hex (multiply by 16) — only the
multiplier changes.
Digit 1 1 0 1 0 1
Position 2⁵ 2⁴ 2³ 2² 2¹ 2⁰
(power of 2)
Value 32 16 8 4 2 1
Octal → Binary: replace each octal digit with its 3-bit binary code. Example: (312)₈ → 3=011,
1=001, 2=010 → (011 001 010)₂
Binary → Octal: group binary digits into 3s from the decimal point outward (right to left for
integer part, left to right for fractional part), padding with zeros if needed, then convert each
group. Example: (10101011110)₂ → group as 010 101 011 110 → 2 5 3 6 → (2536)₈
Same idea: Hex→Binary, expand each digit to 4 bits. Binary→Hex, group into 4s (pad with zeros
at the outer ends if needed).
Answer: (1001101)₂
Subtraction Rules
A B Result Borrow?
0 0 0 No
1 0 1 No
1 1 0 No
0 1 1 Yes (borrow 1 from
next higher digit; that
borrow adds 2 to the
current digit, since
base=2)
Example: Subtract (11011)₂ from (100100)₂ Work column by column from the right, borrowing as
needed (borrowing adds 2, since binary base = 2). Answer: (1001)₂
Multiplication Rules
Same as decimal — 0×0=0, 0×1=0, 1×0=0, 1×1=1. Multiply digit by digit to get partial products,
shift left for each subsequent digit, then add all partial products using binary addition rules.
Example: (1010)₂ × (101)₂ = (110010)₂
1.7 Octal Arithmetic
Addition: Add corresponding digits. If the sum ≥ 8, subtract 8 and carry 1 to the next column
(instead of subtracting 10 as in decimal).
Example: (6547)₈ + (5436)₈
7+6=13 → 13−8=5, carry 1
4+3+1=8 → 8−8=0, carry 1
5+4+1=10 → 10−8=2, carry 1
6+5+1=12 → 12−8=4, carry 1 Result: (14205)₈
Subtraction: If borrowing is needed, borrow adds 8 (not 10) to the digit, since octal's base is 8.
Multiplication (no direct table method taught):
1. Convert both octal numbers to decimal.
2. Multiply in decimal.
3. Convert the product back to octal (repeated division by 8).
Example: (75)₈ × (64)₈
(75)₈ = 7×8+5 = 61; (64)₈ = 6×8+4 = 52
61×52 = 3172
Convert 3172 to octal: 3172÷8=396 r4, 396÷8=49 r4, 49÷8=6 r1, 6÷8=0 r6 → 6144 (75)₈ ×
(64)₈ = (6144)₈
CHAPTER 2: ENCODINGS
2.1 What Is Encoding?
Encoding = converting characters (letters, digits, symbols) into a specific binary format so a
computer can store, process, or transmit them. Since computers only understand 0s and 1s, every
character we type needs a numeric binary code behind it.
Why encoding matters:
Keeps data safe/unreadable to unauthorized users during transmission
Reduces file size for storage
Organizes unstructured data
Ensures compatibility across different systems/devices
Improves speed of data transmission
Common encoding schemes: BCD, ASCII, ISCII, Unicode, BinHex, MIME. Manchester
Encoding specifically depicts ON/OFF (High/Low) signal states.
Decimal BCD
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Multi-digit numbers: convert each digit separately and concatenate. Example: (12)₁₀ → 1=0001,
2=0010 → BCD = 00010010
Important distinction: BCD ≠ pure binary. E.g., (12)₁₀ in pure binary is 1100, but in BCD it's
00010010 (each digit encoded separately).
Worked Example: Represent the word "TEXT" in BCD. T = 010011, E = 110101, X = 010111, T
= 010011 → 010011 110101 010111 010011
Limitations of ASCII
Only 128 characters (7-bit) — not enough for global use
Cannot represent accented characters (é, ñ, ü, ç)
Cannot represent non-Latin scripts (Hindi, Chinese, Arabic, Japanese)
Designed for American English only — not multilingual
2.5 Unicode
Why it was needed: No single encoding system (like ASCII) could represent all the world's
languages. A global standard was needed so the same software/website could work across all
languages and platforms without altering the original data.
Established: 1991, by a consortium in California ("The Unicode Consortium")
Indian scripts (Devanagari, Bengali, Kannada, Malayalam, Oriya, Tamil, Telugu, etc.) were
added in version 3.0
Assigns a unique code point to every character across nearly all languages/symbols
Advantages of Unicode
Supports multiple languages in a single encoding system
Much larger character set than ASCII
Universal, platform-independent standard
Supports special symbols: math symbols, currency signs, emojis, technical characters
Key facts
The first 128 Unicode characters are identical to ASCII (ensures backward compatibility)
Uses variable-width encoding formats: UTF-8, UTF-16, UTF-32
Written as U+XXXX (hex code point)
Since ASCII is a subset of Unicode, Java stores ASCII-only strings efficiently while still
maintaining full Unicode compatibility.
CHAPTER 3.1: PROPOSITIONAL LOGIC
3.1.1 What Is a Proposition?
A proposition is a sentence that can be concluded as either True or False (not both, not neither).
Statement Is it a proposition?
"Apples are red." Yes — True/False
"Where are you going?" No — a question, can't be True/False
"Sita is singing." Yes
"What is your name?" No
Types of Propositions
Simple proposition: a single, standalone sentence. E.g., "Milk is a liquid."
Compound proposition: two or more simple propositions joined by a connective
(and/or/if-then/etc.). E.g., "Bengaluru is a green city AND it is situated in Karnataka" → (a
∧ b)
Statement WFF
You work hard. a
You will win the race. b
You work hard and you will win the race. a∧b
If you work hard then you will win the race. a→b
You will listen to a song or play music. a∨b
3.1.3 Truth Values and Truth Tables
Truth values = the True/False (or 1/0) outcome of a proposition. Truth table = a systematic
tabular listing of all possible combinations of truth values for the propositions involved, along with
the resulting conclusion after applying a connective.
For n propositions, a truth table has 2ⁿ rows (covering every possible True/False combination).
a b a∧b
0 0 0
0 1 0
1 0 0
1 1 1
Real examples: "Anita's age is 12 years and she is minor." / "John is a rock singer and he has long
hair." (Note: "but" can also express conjunction.)
a b a∨b
0 0 0
0 1 1
1 0 1
1 1 1
a ~a
1 0
0 1
Double negation: negating twice returns the original value: (a) = a Example: (0) = ~(1) = 0 ✓
(matches original)
a b a→b
0 0 1
0 1 1
1 0 0
1 1 1
Key rule to remember: the implication is False only when the antecedent (a) is True and the
consequent (b) is False. All other combinations are True.
Algebraic identity: a → b = a' + b (this can be verified with a truth table — both give
identical results).
a b a⇔b
0 0 1
0 1 0
1 0 0
1 1 1
Summary Table
Connective Symbol Name
not ~ or ' Negation
and ∧ or . Conjunction
or ∨ or + Disjunction
if...then → or ⇒ Conditional/Implication
if and only if ⇔ Equivalence/Bi-conditional
a b ~b a⇒~b (a⇒~b)∨b
0 0 1 1 1
0 1 0 1 1
1 0 1 1 1
1 1 0 0 1
All outputs = 1 → Tautology
Worked Example (Contradiction): a ∧ 0 — anything ANDed with 0 is always 0 →
Contradiction
Worked Example (Contingency): a ∧ (a∨b) gives outputs 0,0,1,1 (mixed) → Contingency
G S A X Conjunction
term (only for
X=1)
0 0 0 0 —
0 0 1 1 G∧S∧A
0 1 0 0 —
0 1 1 1 ~G∧S∧A
1 0 0 0 —
1 0 1 1 G∧~S∧A
G S A X Conjunction
term (only for
X=1)
1 1 0 1 G∧S∧~A
1 1 1 1 G∧S∧A
P S T X Disjunction term
(only for X=0)
0 0 0 0 P∨S∨T
0 0 1 0 P∨S∨~T
0 1 0 0 P∨~S∨T
0 1 1 0 P∨S∨T
1 0 0 0 ~P∨S∨T
A A'
0 1
1 0
2. Complementary Laws
A+A' = 1
A.A' = 0
3. Idempotent Law
A+A = A
A.A = A
4. Involution Law (double complement)
(A')' = A
5. Commutative Law
A+B = B+A
A.B = B.A
6. Distributive Law
A(B+C) = A.B + A.C (this one also applies in ordinary math)
A+BC = (A+B).(A+C) (this one is UNIQUE to Boolean algebra — doesn't hold in ordinary
math)
7. Associative Law
A+(B+C) = (A+B)+C
A(B.C) = (A.B)C
8. Absorption Law
A+A.B = A
A(A+B) = A
How to prove any of these: construct a truth table for LHS and RHS separately; if every row
matches, the law is proved (this is the standard exam method — "prove using truth table").
Original Dual
A+0=A A.1=A
A+A'=1 A.A'=0
A+1=1 A.0=0
A(A+B)=A A+AB=A
A+BC=(A+B)(A+C) A.(B+C)=AB+AC
A A'
0 1
1 0
A B A+B
0 0 0
0 1 1
1 0 1
A B A+B
1 1 1
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
A B (A+B)'
0 0 1
0 1 0
1 0 0
1 1 0
A B (A.B)'
0 0 1
0 1 1
1 0 1
1 1 0
XOR (Exclusive-OR) Gate: A⊕B = A'B + AB'. Output is HIGH (1) when the number of 1s in the
input is ODD; LOW (0) when EVEN.
A B A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
XNOR (Exclusive-NOR) Gate: complement of XOR. Output is HIGH when number of 1s is
EVEN; LOW when ODD. (Opposite behavior of XOR.)
A B (A⊕B)'
0 0 1
0 1 0
1 0 0
1 1 1
Memory tip: XOR = "odd ones → 1"; XNOR = "even ones → 1" (this pattern extends to 3+ inputs
too).
3.2.9 Adders
An adder is a logic circuit that performs binary addition.
Half Adder
Adds exactly 2 binary digits. Has 2 outputs: Sum and Carry.
A B Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Formulas:
Sum = A ⊕ B (XOR gate)
Carry = A . B (AND gate)
Limitation: cannot handle a third input (e.g., a carry-in from a previous addition) — this is why we
need the Full Adder.
Full Adder
Adds 3 binary digits (A, B, and an incoming carry C) — needed for adding multi-bit numbers
where carries propagate between columns.
Built from 2 Half Adders + 1 OR gate:
1. H.A.1 adds A and B → produces intermediate Sum (S1) and intermediate Carry (C1).
2. H.A.2 adds S1 and C (the third input) → produces the final Sum, and its own carry.
3. The carries from H.A.1 and H.A.2 are combined with an OR gate to get the final Carry.
Formulas:
Sum = A ⊕ B ⊕ C
Carry = AB + (A⊕B).C
A B C Carry Sum
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
QUICK SELF-CHECK QUESTIONS (test yourself before
the exam)
1. Convert (58823)₁₀ to hexadecimal. Convert (D97)₁₆ to binary.
2. Represent the word "SCIENCE" in ASCII-7 hex codes.
3. What's the difference between BCD and pure binary conversion of the same decimal
number? Show with (18)₁₀.
4. Write the converse, inverse, and contrapositive of: "If 17 is a prime number, then it has only
two factors."
5. Is (p∧~q)∨(p∧q) a tautology, contradiction, or contingency? Prove with a truth table.
6. Prove A+BC = (A+B).(A+C) using a truth table.
7. Draw a logic circuit for AB̄ C + AB(A+BC) using only NAND gates.
8. Design a full adder truth table and derive its Sum and Carry expressions from first principles
(using two half adders).
(Work these out fully on paper — the process, not just the final answer, is what scores marks in
ISC.)