FSc Computer Science Formulas
All FSc Computer Science formulas, chapter by chapter, with search and a printable layout.
This page covers both years of FSc/ICS. The formulas are listed by chapter and are not split into Part-I and Part-II.
Number Systems (19)
| 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) |
| Decimal to BCD | convert each decimal digit separately into its 4-bit binary equivalent |
| Hexadecimal Addition (concept) | add digit by digit in base 16, carrying 1 whenever a column sum reaches 16 |
| Fixed-Point vs Floating-Point (concept) | fixed-point has a set number of digits after the decimal; floating-point uses a mantissa and exponent for a wider range |
| Overflow in Signed Addition (concept) | occurs when adding two numbers of the same sign produces a result of the opposite sign |
Boolean Algebra & Logic Gates (20)
| 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) |
| Number of Rows in Truth Table | Rows = 2ⁿ, for n input variables |
| Sum of Products (SOP) | Boolean expression written as OR of AND terms (minterms) |
| Product of Sums (POS) | Boolean expression written as AND of OR terms (maxterms) |
| Karnaugh Map (K-Map) (concept) | graphical method to simplify Boolean expressions by grouping adjacent 1s |
| Half Adder Sum | Sum = A ⊕ B, Carry = A · B |
| Full Adder Sum | Sum = A ⊕ B ⊕ Cin, Cout = AB + Cin(A ⊕ B) |
| Multiplexer Output Lines | A 2ⁿ:1 MUX has n select lines |
Programming Fundamentals (12)
| Formula | Expression |
|---|---|
| Order of Operator Precedence (concept) | () → unary(!,++,--) → *,/,% → +,- → relational → equality → && → || → = |
| Modulus Operator | a % b = remainder after dividing a by b |
| Increment/Decrement (concept) | x++ uses value then adds 1 (post); ++x adds 1 then uses value (pre) |
| Array Index Range (0-based) | Valid indices = 0 to (Size − 1) |
| Array Memory Address (1-D) | Address(A[i]) = Base + i × Size_of_element |
| Array Memory Address (2-D, Row-Major) | Address(A[i][j]) = Base + (i × Cols + j) × Size_of_element |
| Array Memory Address (2-D, Column-Major) | Address(A[i][j]) = Base + (j × Rows + i) × Size_of_element |
| For Loop Iteration Count | Iterations = ⌈(End − Start)/Step⌉ |
| String Length (concept) | number of characters before the null terminator (\0) in a C-string |
| Function Call Stack (concept) | each function call pushes a stack frame; return pops it |
| Recursion Base Case (concept) | the condition that stops recursive calls and prevents infinite recursion |
| Type Casting (concept) | explicit conversion of a value from one data type to another |
OOP with C++ (5)
| Formula | Expression |
|---|---|
| Class vs Object (concept) | a class is a blueprint; an object is an instance created from that class |
| Four Pillars of OOP (concept) | Encapsulation, Abstraction, Inheritance, Polymorphism |
| Constructor (concept) | special member function, same name as class, runs automatically on object creation |
| Function Overloading (concept) | same function name with different parameter lists (compile-time polymorphism) |
| Virtual Function (concept) | enables runtime polymorphism by resolving the call to the derived class method |
Data Structures (7)
| Formula | Expression |
|---|---|
| Stack (LIFO) (concept) | Last In, First Out — push/pop only at the top |
| Queue (FIFO) (concept) | First In, First Out — insert at rear, remove from front |
| Stack Overflow Condition | Top = Max_Size − 1 and a push is attempted |
| Stack Underflow Condition | Top = −1 and a pop is attempted |
| Circular Queue Rear (Insert) | Rear = (Rear + 1) mod Size |
| Linked List Node (concept) | a node stores data plus a pointer/reference to the next node |
| Singly vs Doubly Linked List (concept) | singly stores next pointer only; doubly stores next and previous pointers |
Algorithm Complexity (7)
| Formula | Expression |
|---|---|
| Big-O Notation (concept) | O(g(n)) describes the worst-case upper bound of an algorithm's growth rate |
| Constant Time | O(1) |
| Logarithmic Time | O(log n) |
| Linear Time | O(n) |
| Linearithmic Time | O(n log n) |
| Quadratic Time | O(n²) |
| Exponential Time | O(2ⁿ) |
Computer Networks (9)
| Formula | Expression |
|---|---|
| OSI Model Layers (concept) | Physical, Data Link, Network, Transport, Session, Presentation, Application |
| TCP/IP Model Layers (concept) | Network Access, Internet, Transport, Application |
| IPv4 Address Format | 32 bits, written as 4 octets, e.g. 192.168.1.1 |
| IPv6 Address Format | 128 bits, written as 8 groups of hexadecimal, e.g. 2001:0db8::1 |
| Number of Hosts per Subnet | Usable Hosts = 2^(32−prefix) − 2 |
| Number of Subnets | Subnets = 2^(borrowed bits) |
| Default Subnet Mask (Class A) | 255.0.0.0 (/8) |
| Default Subnet Mask (Class B) | 255.255.0.0 (/16) |
| Default Subnet Mask (Class C) | 255.255.255.0 (/24) |
Cybersecurity & Cryptography (2)
| Formula | Expression |
|---|---|
| Caesar Cipher Encryption | Cipher = (Plain + Shift) mod 26 |
| Caesar Cipher Decryption | Plain = (Cipher − Shift) mod 26 |
Digital Logic — Number Codes (5)
| Formula | Expression |
|---|---|
| Gray Code Property (concept) | only one bit changes between two successive values |
| Binary to Gray Code | G₀ = B₀, Gᵢ = Bᵢ ⊕ Bᵢ₋₁ |
| Excess-3 Code | Excess-3 = BCD code + 0011 (adds 3 to each decimal digit before converting) |
| Parity Bit (Even Parity) | added bit makes the total number of 1s in the word even |
| Parity Bit (Odd Parity) | added bit makes the total number of 1s in the word odd |
Web Development (8)
| Formula | Expression |
|---|---|
| HTTP Status Codes (concept) | 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error |
| HTTP GET vs POST (concept) | GET requests data and appends parameters to the URL; POST sends data in the request body |
| Client-Server Model (concept) | clients send requests to a server, which processes them and returns responses |
| Frontend vs Backend (concept) | frontend handles what the user sees (HTML/CSS/JS); backend handles server logic, data, and APIs |
| Cookies vs Sessions (concept) | cookies are stored on the client; sessions are stored on the server and referenced by a session ID |
| REST API (concept) | an architectural style using HTTP methods (GET, POST, PUT, DELETE) to access and manipulate resources |
| DOM (Document Object Model) (concept) | a tree-structured representation of an HTML page that JavaScript can read and modify |
| Responsive Web Design (concept) | layouts that adapt to different screen sizes using flexible grids and media queries |
Version Control (5)
| Formula | Expression |
|---|---|
| Git Repository (concept) | a folder tracked by Git that stores the full history of changes to its files |
| Git Commit (concept) | a saved snapshot of changes in the repository at a point in time |
| Git Branch (concept) | an independent line of development that can be merged back into the main codebase |
| Merge Conflict (concept) | occurs when two branches change the same lines of a file differently and Git cannot auto-merge |
| Push vs Pull (concept) | push uploads local commits to a remote repository; pull downloads and merges remote changes locally |
Mobile & Embedded Systems (8)
| Formula | Expression |
|---|---|
| Embedded System (concept) | a combination of hardware and software designed to perform a specific dedicated function |
| Microcontroller vs Microprocessor (concept) | a microcontroller integrates CPU, memory, and I/O on one chip; a microprocessor needs external memory/I/O chips |
| Real-Time Operating System (RTOS) (concept) | an OS designed to process data and respond within a guaranteed, strict time constraint |
| Native vs Cross-Platform Apps (concept) | native apps are built for one OS using its own SDK; cross-platform apps share one codebase across OSes |
| Battery Life Estimate | Battery Life (hours) = Battery Capacity (mAh)/Average Current Draw (mA) |
| IoT (Internet of Things) (concept) | a network of physical devices embedded with sensors that collect and exchange data over the internet |
| Sensor vs Actuator (concept) | a sensor detects/measures a physical property; an actuator produces physical motion or action in response |
| Sampling Rate (Sensors) | Sampling Rate (Hz) = Number of Samples/Time (seconds) |
Regular Expressions & Pattern Matching (8)
| Formula | Expression |
|---|---|
| Regex — Any Character | . matches any single character except a newline |
| Regex — Zero or More | * matches zero or more occurrences of the preceding element |
| Regex — One or More | + matches one or more occurrences of the preceding element |
| Regex — Zero or One | ? matches zero or one occurrence of the preceding element |
| Regex — Character Class | [abc] matches any single character among a, b, or c |
| Regex — Anchors | ^ matches the start of a string, $ matches the end of a string |
| Regex — Quantifier Range | {n,m} matches between n and m occurrences of the preceding element |
| String Matching — Naive Approach Complexity | O(n×m), n = text length, m = pattern length |
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 |
More class-wise formulas
Formulas are for revision. Always follow the notation and rounding used in your own textbook and board papers.
FAQ
How many FSc Computer Science formulas are on this page?
121 formulas in 14 chapters.
Can I print the FSc Computer Science formulas?
Yes. Press Print / Save as PDF. The page switches to a clean black-on-white layout without menus.
How do I find one formula quickly?
Type a word such as velocity, area or mole in the search box. Only matching formulas stay visible.
Do the formulas follow my board syllabus?
They follow the usual school and intermediate syllabus, but chapter lists differ between boards. Check your own syllabus for what is included in your exam.