Digital Design Fundamentals & Number Systems
8h
Class hours
7
Topics
0%
0/41 done
Why This Unit Matters
From analog to digital — understand how computers represent and process information using binary, octal, and hexadecimal number systems.
Why This Unit Matters
Unit 1 is the absolute foundation of digital logic. Every concept in Units 2–5 — logic gates, flip-flops, memory, processors — operates on binary numbers. If you understand how binary, hex, and complements work, the rest of digital logic will feel natural. This unit also carries heavy weight in TU BCA exams: number conversions and complement subtraction appear in every single past paper from 2019–2025.
Unit Overview in Simple Words
Signals & Systems
Analog vs digital — why digital won.
Counting Systems
Binary, octal, decimal, hex — and how to convert between them.
Negative Numbers
2's complement — how computers handle subtraction with adder circuits.
Codes & Errors
BCD, Gray, ASCII, parity — how data is encoded and protected.
Learning Outcomes
Teaching Hours
8 hours
Topics
7 main topics
Exam Weight
~25% of paper
Must Know
Conversions + 2's complement
Analog and Digital
1.1 Analog and Digital Signals
Every physical quantity in the world — sound, temperature, voltage, speed — varies continuously. Electronics must work with these quantities in one of two ways: keep them continuous (analog) or convert them to discrete steps (digital).
Definition
Analog Signal
A signal that varies continuously and smoothly over time, taking any value within a range. Examples: audio sound waves, thermometer readings, radio waves, voltage from a microphone.
Definition
Digital Signal
A signal that takes only discrete, finite values — typically 0 and 1 (binary). Examples: computer data, CD audio, digital thermometer output, USB data.
| Property | Analog | Digital |
|---|---|---|
| Signal type | Continuous (infinite values) | Discrete (finite values, 0 & 1) |
| Representation | Any value in a range | Only 0 or 1 (binary) |
| Noise immunity | Poor — noise degrades the signal | Excellent — noise easily filtered |
| Accuracy | Limited by noise and component tolerances | High for given bit-width; limited by quantization error |
| Storage | Difficult, degrades over time | Easy, lossless (hard disk, RAM) |
| Processing | Requires analog circuits | Programmable, flexible |
| Bandwidth | Efficient — transmits signal directly | Requires more bandwidth than analog equivalent |
| Cost | Lower for simple circuits | Decreasing rapidly (VLSI) |
| Examples | AM/FM radio, vinyl records | CDs, DVDs, computers, phones |
📝 Note
🎯 Exam Focus
1.2 Analog and Digital Systems
Definition
Digital System
A system that processes, stores, or transmits information using discrete binary values (0 and 1). The physical realization uses transistors operating as switches (ON = 1, OFF = 0).
Advantages of Digital Systems over Analog Systems:
Noise Immunity
Digital signals can be regenerated perfectly. Even if noise distorts the signal, a threshold circuit restores clean 0 or 1.
Easy Storage
Digital data stored in RAM, ROM, flash memory without degradation. Analog recordings degrade over time.
Reproducibility
Digital copies are perfect — 1000 copies of a digital song are identical to the original.
Programmability
The same digital hardware can perform different tasks by changing software (program).
Speed
Modern digital circuits operate at GHz frequencies. Billions of operations per second.
Integration (VLSI)
Billions of transistors on a single chip. Impossible with analog circuits at this density.
Security
Digital data can be encrypted using well-established algorithms (AES, RSA). Analog encryption exists but is far less practical and widely used.
Compatibility
Digital systems from different manufacturers can communicate using standard protocols (USB, Ethernet).
💡 Remember
Number Systems & Conversions
1.3 Number System Representation
A positional number system represents values using symbols (digits), where each symbol's value depends on its position(place value) within the number. The base (or radix) determines how many unique digits the system uses and what the place values are.
📐 Formula
Value = dn×rn + dn-1×rn-1 + ... + d1×r1 + d0×r0
The Four Number Systems
| System | Base (Radix) | Digits | Example | Prefix/Suffix |
|---|---|---|---|---|
| Binary | 2 | 0, 1 | (1010)₂ = 10₁₀ | Subscript ₂ or prefix 0b |
| Octal | 8 | 0 – 7 | (17)₈ = 15₁₀ | Subscript ₈ or prefix 0o |
| Decimal | 10 | 0 – 9 | (255)₁₀ | No prefix (default) |
| Hexadecimal | 16 | 0–9, A–F | (FF)₁₆ = 255₁₀ | Subscript ₁₆ or prefix 0x |
🎯 Exam Focus
1.4 Number System Conversions
1.4.1 Binary Number System (Base 2)
Binary uses only two digits: 0 and 1. Each position is a power of 2. The rightmost position is 2⁰, next is 2¹, then 2², and so on.
1.4.2 Octal Number System (Base 8)
Octal uses digits 0–7. Each octal digit corresponds to exactly 3 binary digits. This makes Binary ↔ Octal conversion trivially easy — just group bits in threes.
💡 Remember
Group binary digits in sets of 3 from the right. Replace each group with its octal equivalent.
Binary ↔ Octal Quick Reference
1.4.4 Hexadecimal Number System (Base 16)
Hexadecimal uses 16 symbols: 0–9 and A–F. Each hex digit represents exactly 4 binary digits — making it the preferred way to represent binary data in a compact, readable form.
Hexadecimal Reference Table
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dec | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 4-bit | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
💡 Remember
Group binary digits in sets of 4 from the right. Replace each group with its hex equivalent.
Interactive Number Converter
Convert between Binary, Octal, Decimal & Hex — with step-by-step working
BIN — Base 2
101010₂
OCT — Base 8
52₈
DEC — Base 10
42₁₀
inputHEX — Base 16
2A₁₆
⚠️ Common Mistake
- Forgetting to read remainders bottom-to-top in division method
- Reading multiplication results top-to-bottom (correct) vs bottom-to-top (wrong)
- Confusing groups of 3 (Binary↔Octal) with groups of 4 (Binary↔Hex)
- Not padding to correct group size when converting (e.g., only 2 bits left — pad to 3 with leading zeros)
- Writing hex letters in lowercase (use uppercase: A not a)
Signed Numbers & IEEE 754
1.5 Representation of Signed Numbers
Unsigned binary can only represent positive numbers. To represent both positive and negative, computers use one of three conventions — all using the most significant bit (MSB)as a sign indicator (0 = positive, 1 = negative).
Sign-Magnitude
MSB = sign bit. Remaining bits = magnitude.
✓ Pros:
- • Simple concept
- • Easy to read magnitude
✗ Cons:
- • +0 and −0 both exist
- • Arithmetic is complex
1's Complement
MSB = sign bit. Negative = flip all bits of positive.
✓ Pros:
- • Easier addition than sign-mag
✗ Cons:
- • +0 (0000) and −0 (1111) still exist
- • End-around carry in addition
2's Complement
MSB = sign bit. Negative = 1's comp + 1. STANDARD method.
✓ Pros:
- • Unique zero (only 0000)
- • Addition and subtraction work directly
- • Used in ALL modern CPUs
✗ Cons:
- • Asymmetric range: −8 to +7 (4-bit)
Signed Number Explorer
Toggle the bits to see how the representation changes.
Click to toggle bits
Unsigned
5
Sign-Magnitude
5
1's Complement
5
2's Complement
5
Comparison: Representing −5 through −8 in 4-bit
| Decimal | Unsigned (4-bit) | Sign-Magnitude | 1's Complement | 2's Complement |
|---|---|---|---|---|
| +7 | 0111 | 0111 | 0111 | 0111 |
| +6 | 0110 | 0110 | 0110 | 0110 |
| +5 | 0101 | 0101 | 0101 | 0101 |
| +4 | 0100 | 0100 | 0100 | 0100 |
| +3 | 0011 | 0011 | 0011 | 0011 |
| +2 | 0010 | 0010 | 0010 | 0010 |
| +1 | 0001 | 0001 | 0001 | 0001 |
| +0 | 0000 | 0000 | 0000 | 0000 |
| −0 | — | 1000 | 1111 | — |
| −1 | — | 1001 | 1110 | 1111 |
| −2 | — | 1010 | 1101 | 1110 |
| −3 | — | 1011 | 1100 | 1101 |
| −4 | — | 1100 | 1011 | 1100 |
| −5 | — | 1101 | 1010 | 1011 |
| −6 | — | 1110 | 1001 | 1010 |
| −7 | — | 1111 | 1000 | 1001 |
| −8 | — | — | — | 1000 |
🎯 Exam Focus
1.5 (continued) IEEE 754 Floating-Point ✦ Exam practice
✦ Note on Syllabus Scope
IEEE 754 is not explicitly listed in the official TU BCA CACS 103 syllabus, but it has appeared in TU past papers (2022, 2023, 2025). It is included here for exam preparation. Prioritise signed-number representations and complement arithmetic from the core syllabus first.
The IEEE 754 standard defines how floating-point numbers (numbers with a decimal point) are stored in binary. It uses a format inspired by scientific notation: value = (−1)^S × 1.M × 2^(E−Bias).
IEEE 754 Formats
| Property | Single Precision (32-bit) | Double Precision (64-bit) |
|---|---|---|
| Total bits | 32 | 64 |
| Sign bit (S) | 1 bit | 1 bit |
| Exponent (E) | 8 bits | 11 bits |
| Mantissa (M) | 23 bits | 52 bits |
| Bias | 127 | 1023 |
| Exponent range | −126 to +127 | −1022 to +1023 |
| Decimal range | ±3.4 × 10³⁸ | ±1.8 × 10³⁰⁸ |
| Precision | ~7 decimal digits | ~15 decimal digits |
Single-Precision 32-bit Layout
Sign bit
−23.375 is negative, so S = 1
Convert magnitude to binary
23 = (10111)₂ | 0.375: 0.375×2=0.75(0), 0.75×2=1.5(1), 0.5×2=1.0(1) → 0.375 = (.011)₂ So 23.375 = (10111.011)₂
Normalize
10111.011 = 1.0111011 × 2⁴ (shift decimal 4 places left to get 1.XXXXX form)
Biased exponent
Actual exponent = 4 Biased exponent = 4 + 127 = 131 = (10000011)₂
Mantissa (23 bits, drop implicit 1)
0111011 → pad to 23 bits → 01110110000000000000000
Assemble 32-bit word
S=1 | Exp=10000011 | Mantissa=01110110000000000000000 = 1 10000011 01110110000000000000000 Hex = 0xC1BB0000
🎯 Exam Focus
IEEE 754 Single-Precision Converter
32-bit floating point — 1 sign + 8 exponent + 23 mantissa
32-bit IEEE 754 Layout
Hex
0xC1BB0000
Normalized form
−1.01110110000000000000000 × 24
IEEE 754 Quick Reference
Single (32-bit)
1 sign + 8 exponent + 23 mantissa | Bias = 127
Double (64-bit)
1 sign + 11 exponent + 52 mantissa | Bias = 1023
Formula: (−1)^S × 1.M × 2^(E−Bias)
Complements
1.6 Complements
Complements are used to simplify subtraction — instead of building subtractor hardware, computers add the complement of a number. There are two types of complements for a number system with radix (base) r:
Definition
(r−1)'s Complement
For a base-r number with n digits, the (r−1)'s complement is (rn − 1) − N. For binary (r=2): flip all bits. For decimal (r=10): subtract each digit from 9.
Definition
r's Complement
For a base-r number with n digits, the r's complement is rn − N. Equivalently: (r−1)'s complement + 1. For binary: flip bits + 1. For decimal: 9's complement + 1.
(r−1)'s Complement Formula
(r^n − 1) − N
n = number of digits; r = base (radix)
r's Complement Formula
r^n − N = (r−1)'s comp + 1
OR: find (r−1)'s complement, then add 1
🎯 Exam Focus
Decimal (Base-10) Complements
9's Complement (Base 10, r−1)
Subtract each digit from 9.
Formula: (10n − 1) − N
Example: 9's complement of 52520
Digit by digit: 9−0=9, 9−5=4, 9−2=7, 9−5=4, 9−2=7, 9−0=9
10's Complement (Base 10, r)
9's complement + 1. Or: leave trailing zeros, subtract first non-zero digit from 10, subtract remaining digits from 9.
Formula: 10n − N
Example: 10's complement of 52520
Verify: 52520 + 947480 = 1,000,000 = 106 ✓
Decimal Complement Quick Reference
| N (4-digit) | 9's Complement | 10's Complement |
|---|---|---|
| 0000 | 9999 | 0000 (special: 10's comp of 0 = 0) |
| 1234 | 8765 | 8766 |
| 5000 | 4999 | 5000 |
| 9875 | 0124 | 0125 |
| 0001 | 9998 | 9999 |
Binary Complements
1's Complement (r−1 for binary)
Flip every bit: 0 → 1, 1 → 0
Formula: (2n − 1) − N
Example: 1's complement of (1010 1100)₂
10101100 → 01010011 (each bit flipped)
💡 Remember
2's Complement (r for binary)
1's complement + 1
Formula: 2n − N
Example: 2's complement of (1010 1100)₂
01010011 + 1 = 01010100
💡 Remember
Example: 10101100 → copy 00, then copy 1 → 01010100
Complement Calculator
1's complement · 2's complement · Subtraction via complement
= (77)₁₀ — 8-bit unsigned
Original
(01001101)₂ = 77₁₀
1's Complement — flip every bit
Rule: 0 → 1, 1 → 0
(10110010)₂ = 178₁₀ (unsigned) | represents -77₁₀
2's Complement — 1's complement + 1
Step 1: 1's comp = (10110010)₂ → Step 2: add 1
(10110011)₂ represents -77₁₀ in 2's complement
🎯 Exam Focus
Subtraction Using Complements
Instead of building subtractor circuits, digital computers compute A − B by adding the complement of B to A. This is why complement arithmetic is so important in digital logic.
Algorithm: A − B using r's Complement
- Find the r's complement of B (subtrahend)
- Add r's complement of B to A (minuend)
- If carry out of MSB occurs: discard the carry → result is positive (A ≥ B)
- If NO carry out of MSB: result is in complement form → take r's complement of the result and attach a − sign (A < B)
Binary Subtraction Examples
Complement Types — Summary
| Type | Base | Formula | Shortcut |
|---|---|---|---|
| 9's complement | 10 | (10ⁿ − 1) − N | Subtract each digit from 9 |
| 10's complement | 10 | 10ⁿ − N | 9's comp + 1 |
| 1's complement | 2 | (2ⁿ − 1) − N | Flip all bits (0↔1) |
| 2's complement | 2 | 2ⁿ − N | 1's comp + 1 (or copy from LSB to first 1, then flip) |
⚠️ Common Mistake
Mistake 2: When there is no carry (negative result), students forget to take the complement of the result and just report the raw sum as the answer.
Binary Arithmetic
1.7 Binary Arithmetic
Binary Addition
Binary addition follows the same column-by-column process as decimal addition, but with only two digits (0 and 1). When the sum of a column exceeds 1, a carry is propagated to the next column.
Four Basic Rules
Rule 4: 1 + 1 = 10₂ → write 0, carry 1 (just like decimal: 9 + 1 = 10, write 0, carry 1)
Worked Examples
Interactive Arithmetic Solver
Watch addition carries and subtraction borrows propagate in real time.
= 11₁₀
= 6₁₀
Result: 00010001₂ = 17₁₀
Binary Subtraction
Direct subtraction uses borrow logic. In practice, digital systems use the 2's complement method (convert to addition) instead.
Direct Subtraction Rules
Rule 2: 0 − 1: borrow from left. Borrowed bit = 2₁₀, so 2 − 1 = 1. The left column loses 1 due to the borrow.
Binary Multiplication
Binary multiplication uses the same long multiplication process as decimal, but is much simpler because each partial product is either 0 (if multiplier bit = 0) or the multiplicand itself (if multiplier bit = 1). Partial products are shifted left and summed.
Four Basic Rules
💡 Remember
Binary Division
Binary division mirrors decimal long division. Since only two digits exist, at each step you ask: "Can the divisor fit into the current dividend portion?" If yes → quotient bit = 1, subtract. If no → quotient bit = 0, bring down next bit.
🎯 Exam Focus
Overflow in Binary Arithmetic
Unsigned Overflow
Occurs when the result of an addition is too large for the available bits. Detected by a carry out of the most-significant bit (MSB).
8-bit max unsigned: 255. If result > 255 → overflow.
Signed Overflow (2's complement)
Occurs when adding two numbers of the same sign gives a result of the opposite sign. Detected when: carry into MSB ≠ carry out of MSB.
8-bit 2's comp range: −128 to +127. Result outside this range → overflow.
Signed Overflow Detection Rules
| Operation | Overflow occurs when... | Example (8-bit) |
|---|---|---|
| + + + | Two positive numbers → negative result | 01100100 + 01100100 = 11001000 (−56 instead of +200) |
| − + − | Two negative numbers → positive result | 11000000 + 11000000 = 10000000 (wrong sign) |
| + + − | Never — mixed signs cannot overflow | 01111111 + 10000001 = 00000000 (fine, = 0) |
Binary Arithmetic — Quick Summary
Addition
Column-by-column; carry propagates left; 1+1=10₂
Subtraction
Direct (borrow method) or 2's complement (preferred)
Multiplication
Partial products (shift + copy/zero); add all rows
Division
Long division; quotient bit = 1 if divisor fits, else 0
⚠️ Common Mistake
Mistake 2: Writing the wrong number of bits in the result. If multiplying two 4-bit numbers, the product can require up to 8 bits. Don't truncate the result prematurely.
Binary Codes
1.8 Binary Codes
Digital systems use binary codes to represent letters, numbers, symbols, and instructions. Different codes are designed for different purposes: some optimize for human readability, some minimize errors during transmission, and some detect/correct transmission errors.
BCD (8421)
Decimal digits in binary — used in calculators, digital meters
Excess-3
Self-complementing code — used in older arithmetic circuits
Gray Code
Only 1 bit changes between consecutive values — used in encoders, error reduction
ASCII
7-bit code for text characters — standard for computers
Parity
Error detection — adds 1 check bit to detect single-bit errors
Hamming Code
Error correction — can detect and correct single-bit errors
Live Code Converter
Convert between Decimal, BCD, Excess-3, and Gray code.
BCD (8421)
Excess-3 (XS-3)
BCD Code (Binary Coded Decimal)
Definition
BCD (8421 Code)
Each decimal digit (0–9) is encoded separately as a 4-bit binary group. The weights of the bits are 8, 4, 2, 1 (hence "8421 code"). Valid BCD digits: 0000 to 1001. Codes 1010 to 1111 are invalid in BCD.
BCD Code Table (0–9)
| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|---|
| BCD | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 |
⚠️ Common Mistake
Excess-3 Code (XS-3)
Definition
Excess-3 (XS-3) Code
An unweighted code derived by adding 3 (= 0011₂) to each BCD digit. Excess-3 is a self-complementing code: the 9's complement of any digit equals the 1's complement of its Excess-3 representation — useful for decimal arithmetic in older hardware.
Conversion Rule
XS-3 = BCD + 0011₂ = Decimal + 3 (then convert to 4-bit binary)
Excess-3 Code Table
| Decimal | BCD (4-bit) | +3 | XS-3 |
|---|---|---|---|
| 0 | 0000 | +3 = 3 | 0011 |
| 1 | 0001 | +3 = 4 | 0100 |
| 2 | 0010 | +3 = 5 | 0101 |
| 3 | 0011 | +3 = 6 | 0110 |
| 4 | 0100 | +3 = 7 | 0111 |
| 5 | 0101 | +3 = 8 | 1000 |
| 6 | 0110 | +3 = 9 | 1001 |
| 7 | 0111 | +3 = 10 | 1010 |
| 8 | 1000 | +3 = 11 | 1011 |
| 9 | 1001 | +3 = 12 | 1100 |
💡 Remember
Gray Code (Reflected Binary Code)
Definition
Gray Code
A binary code where only one bit changes between any two consecutive values. This minimizes errors in physical systems (encoders, A/D converters) where multiple bits changing simultaneously could cause transient errors.
Binary → Gray
- MSB of Gray = MSB of Binary (copy)
- Each subsequent Gray bit = XOR of current and next binary bit
G[n] = B[n] (MSB)
G[i] = B[i+1] ⊕ B[i] (for i < n)
Gray → Binary
- MSB of Binary = MSB of Gray (copy)
- Each subsequent Binary bit = XOR of previous binary bit and current Gray bit
B[n] = G[n] (MSB)
B[i] = B[i+1] ⊕ G[i]
4-bit Gray Code Table (0–15)
| Decimal | Binary | Gray | Bit changed |
|---|---|---|---|
| 0 | 0000 | 0000 | - |
| 1 | 0001 | 0001 | bit 0 |
| 2 | 0010 | 0011 | bit 1 |
| 3 | 0011 | 0010 | bit 0 |
| 4 | 0100 | 0110 | bit 2 |
| 5 | 0101 | 0111 | bit 0 |
| 6 | 0110 | 0101 | bit 1 |
| 7 | 0111 | 0100 | bit 0 |
| 8 | 1000 | 1100 | bit 3 |
| 9 | 1001 | 1101 | bit 0 |
| 10 | 1010 | 1111 | bit 1 |
| 11 | 1011 | 1110 | bit 0 |
| 12 | 1100 | 1010 | bit 2 |
| 13 | 1101 | 1011 | bit 0 |
| 14 | 1110 | 1001 | bit 1 |
| 15 | 1111 | 1000 | bit 0 |
ASCII Code
Definition
ASCII (American Standard Code for Information Interchange)
A 7-bit code that represents 128 characters including uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), punctuation, and control characters. Extended ASCII uses 8 bits (256 characters) for additional symbols.
Important ASCII Values (Must Memorize for Exams)
| Character | Decimal | Hex | Binary (7-bit) |
|---|---|---|---|
| NUL (null) | 0 | 00 | 000 0000 |
| Space | 32 | 20 | 010 0000 |
| '0' | 48 | 30 | 011 0000 |
| '9' | 57 | 39 | 011 1001 |
| 'A' | 65 | 41 | 100 0001 |
| 'Z' | 90 | 5A | 101 1010 |
| 'a' | 97 | 61 | 110 0001 |
| 'z' | 122 | 7A | 111 1010 |
| DEL | 127 | 7F | 111 1111 |
💡 Remember
- 'A' = 65 (41H), 'a' = 97 (61H) → lowercase = uppercase + 32 (set bit 5)
- '0' = 48 (30H) → digit '0'–'9' = 48–57
- Space = 32, which is less than all printable characters
Parity Bit (Error Detection)
Definition
Parity Bit
An extra bit added to a binary word to make the total number of 1s either even (even parity) or odd (odd parity). A parity bit can detect (but not correct) a single-bit error.
Even Parity
The parity bit is chosen so the total number of 1s (including parity bit) is even.
Odd Parity
The parity bit is chosen so the total number of 1s (including parity bit) is odd.
🎯 Exam Focus
Hamming Code (Error Correction)
Definition
Hamming Code
An error-correcting code that adds multiple parity bits (check bits) at positions that are powers of 2 (1, 2, 4, 8...). It can detect up to 2-bit errors and correct single-bit errors by identifying the exact position of the error.
Number of Check Bits Required
For m data bits, the number of check bits r must satisfy: 2r ≥ m + r + 1
| Data bits (m) | Check bits (r) | Total bits (m+r) |
|---|---|---|
| 1 | 2 | 3 |
| 2 | 3 | 5 |
| 3 | 3 | 6 |
| 4 | 3 | 7 |
| 5 | 4 | 9 |
| 6 | 4 | 10 |
| 7 | 4 | 11 |
| 8 | 4 | 12 |
🎯 Exam Focus
Code Comparison Table
| Code | Bits | Weighted? | Primary Use | Key Feature |
|---|---|---|---|---|
| BCD (8421) | 4/digit | Yes (8,4,2,1) | Decimal display | Invalid codes 1010–1111 |
| Excess-3 | 4/digit | No (unweighted) | Arithmetic circuits | Self-complementing |
| Gray | Variable | No | Encoders, A/D converters | Only 1 bit changes per step |
| ASCII | 7 (or 8) | No | Text in computers | 128 characters; 'A'=65 |
| Even Parity | 1 extra | No | Error detection | Detects odd-number of errors |
| Hamming | r extra | No | Error correction | Corrects 1-bit errors |
Practice & Self-Assessment
Active Recall Questions
Try to answer each question from memory before revealing the answer. This is the most effective study technique for long-term retention.
What is the difference between an analog signal and a digital signal?
Convert (11010110)₂ to hexadecimal. Show your method.
Find the 2's complement of (10110100)₂. Explain the method used.
What are the 4 advantages of digital systems over analog systems? Give one example for each.
Explain BCD code. Why is it different from binary? Convert 937₁₀ to BCD.
Exam-Style Questions
These questions match the style and marks distribution of TU BCA (BCA 103) past papers. Attempt each question before revealing the full solution.
Q1. Convert 165.625₁₀ to binary. [4 marks]
4 marksQ2. Subtract (10110)₂ − (01101)₂ using 2's complement method. [5 marks]
5 marksQ3. Find the IEEE 754 single-precision representation of −12.5₁₀. [6 marks]
6 marksQ4. What is Gray code? Convert 14₁₀ to Gray code. [4 marks]
4 marksQ5. Explain signed number representation. Write the range of 8-bit 2's complement numbers. [5 marks]
5 marksMini-Test
8 multiple-choice questions covering all of Unit 1. Answer all questions, then submit to see your score and explanations.
1. What is the decimal value of (1010.01)₂?
2. The 2's complement of 11010 is:
3. Which number is INVALID in BCD?
4. In Excess-3 code, the decimal digit 6 is represented as:
5. Gray code is preferred over binary in position encoders because:
6. The bias in IEEE 754 single-precision floating point is:
7. How many check bits (parity bits) are needed for a Hamming code protecting 11 data bits?
8. Subtract 12 − 9 using 4-bit 2's complement. The result is:
How to Remember Unit 1
How to Remember Unit 1
Unit 1 is dense with procedures and tables. Here are proven memory shortcuts — mnemonics, visual anchors, and algorithmic patterns — that make recall effortless in exams.
Mnemonics
Advantages of Digital Systems
NRIPSCSC
Number Bases Mnemonic
BOHD
Signed Number Representations
S-1-2
IEEE 754 Field Sizes (Single)
1-8-23
Procedural Memory Tricks
Integer → Binary (Division Method)
Divide repeatedly by 2. Collect remainders. READ THEM BOTTOM TO TOP (like reading up a ladder).
Fraction → Binary (Multiplication Method)
Multiply repeatedly by 2. Collect integer parts. READ THEM TOP TO BOTTOM (like reading down a list).
2's Complement Shortcut
Scan from LSB (right). Copy all bits UP TO AND INCLUDING the first 1. Then FLIP all remaining bits to the left.
Binary ↔ Hex: Groups of 4
Group binary digits in sets of 4 from the right. Each group = one hex digit. For fractions, group from the radix point leftward and rightward.
Binary ↔ Octal: Groups of 3
Group binary digits in sets of 3 from the right. Each group = one octal digit.
9's Complement of Decimal
Subtract each digit from 9. No carrying needed — it's always digit-by-digit.
Code Memory Shortcuts
BCD Rule
BCD = each decimal digit gets its own 4-bit binary code. Only 0000–1001 are valid. Think: 'decode each digit separately, never cross digits.'
Excess-3 = BCD + 3
Always add 3 to the decimal digit, then convert to 4-bit binary. For decoding: subtract 3 from the binary value.
Gray Code: XOR Down the Column
MSB copies directly. Every other bit = XOR of the two binary bits above the gap. For reverse: MSB copies, then XOR previous binary with current gray.
ASCII Key Values
Remember: 'A'=65, 'a'=97 (lowercase = uppercase + 32), '0'=48. Space=32 (lowest printable). All fit in 7 bits (0–127).
Visual Memory Anchors
Binary Place Values — Powers of 2
Remember this row of powers:
Trick: start at 1 (right) and double leftward: 1, 2, 4, 8, 16, 32, 64, 128
Hex Digit Values
The letter digits A–F:
Trick: A=10 (think: A is the 10th letter if we count from 1). Then B=11, C=12... F=15.
Quick Revision Summary
Before the Exam: Unit 1 Checklist