0% found this document useful (0 votes)
2 views9 pages

The. AMP Computer Science Notes

The document is a comprehensive study guide for computer science, covering key topics such as computer fundamentals, number systems, algorithms, programming concepts, operating systems, computer security, networks, and data structures. It includes detailed explanations of internal components, memory types, input/output devices, and various algorithms and data structures. Additionally, it provides expected questions and high-probability multiple-choice questions for exam preparation.

Uploaded by

adnanpara71
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

The. AMP Computer Science Notes

The document is a comprehensive study guide for computer science, covering key topics such as computer fundamentals, number systems, algorithms, programming concepts, operating systems, computer security, networks, and data structures. It includes detailed explanations of internal components, memory types, input/output devices, and various algorithms and data structures. Additionally, it provides expected questions and high-probability multiple-choice questions for exam preparation.

Uploaded by

adnanpara71
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Science Comprehensive Study

Notes
Complete Unit-wise Master Guide with 5-Mark Expected Questions & High-Probability MCQs

PREPARED BY: THE AMP

UNIT 1: Computer Fundamentals

1. Internal Components of a Computer System


The internal hardware components reside inside the computer cabinet (system unit) and work together to

E
process data:

• Central Processing Unit (CPU): Known as the brain of the computer. It executes instructions and

H
processes data. It consists of the Arithmetic Logic Unit (ALU) for calculations, the Control Unit (CU) for
directing operations, and Registers for temporary data storage.

T
• Motherboard: The main circuit board connecting all internal components via pathways called buses.
• Primary Memory (RAM & ROM): Working memory that holds active data and instructions for the CPU.
• Storage Drives (HDD / SSD): Non-volatile storage for permanent data and software installation.

components.

M P
• Power Supply Unit (PSU): Converts AC power from the wall outlet into regulated DC power for internal

• Graphics Processing Unit (GPU): Dedicated processor for rendering images, videos, and 3D graphics.

A
2. Primary Memory vs. Secondary Memory

Feature Primary Memory (RAM / ROM) Secondary Memory (HDD / SSD / USB)

Mainly Volatile (RAM loses data on power Non-Volatile (Retains data permanently without
Volatility
off). power).

Speed Extremely fast access speeds. Slower compared to primary memory.

Limited capacity (e.g., 8 GB, 16 GB, 32


Capacity Very large capacity (e.g., 512 GB, 1 TB, 4 TB).
GB).

Cost per
Very expensive. Economical / Low cost per byte.
Byte

CPU Access Directly accessed by the CPU. Accessed via I/O channels / device drivers.

THE AMP — Computer Science Comprehensive Study Notes Page 1 of 9


3. Cache Memory and its Advantages
Cache Memory is an extremely fast, small-capacity volatile semiconductor memory located physically close
to or inside the CPU chip. It bridges the speed gap between the ultra-fast CPU and the slower main memory
(RAM).

Advantages of Cache Memory:


• High Speed: Operates at CPU speeds, significantly reducing instruction fetch time.
• Locality of Reference: Stores frequently accessed data and instructions (temporal and spatial locality).
• Reduced Bus Traffic: Decreases system bus congestion by serving repeated requests locally.
• Overall Performance Boost: Maximizes CPU utilization and system throughput.

4. Overview of Memory Types


• RAM (Random Access Memory): Volatile, read-write memory holding currently running programs and
operating system data.

E
• ROM (Read-Only Memory): Non-volatile memory containing boot firmware (BIOS/UEFI) that cannot be
easily modified.

H
• Cache Memory: Ultra-fast buffer memory sitting between CPU and RAM.
• Secondary Storage: Bulk long-term storage media like Hard Disk Drives (HDD) and Solid State Drives

T
(SSD).

5. Input and Output Devices

M P
• Input Devices: Hardware used to feed data and control signals into the computer.
Examples: Keyboard, Mouse, Scanner, Microphone, Barcode Reader.
• Output Devices: Hardware that presents processed data back to the user or another system.
Examples: Monitor, Printer, Speaker, Projector.

UNIT 2: Number System

1. Overview of Number Systems


A
• Decimal (Base 10): Digits 0-9. Used in everyday human arithmetic.
• Binary (Base 2): Digits 0, 1. Fundamental language of digital computers.
• Octal (Base 8): Digits 0-7. Compact representation of binary numbers (groups of 3 bits).
• Hexadecimal (Base 16): Digits 0-9, A-F (A=10, B=11, C=12, D=13, E=14, F=15). Used in memory
addresses and color codes (groups of 4 bits).

2. Binary to Decimal Conversion (with Examples)


Multiply each binary digit by 2 raised to the power of its position index, starting from 0 on the right.

THE AMP — Computer Science Comprehensive Study Notes Page 2 of 9


Example: Convert 1101_2 to Decimal
1101_2 = (1 imes 2^3) + (1 imes 2^2) + (0 imes 2^1) + (1 imes 2^0)

= (1 imes 8) + (1 imes 4) + (0 imes 2) + (1 imes 1) = 8 + 4 + 0 + 1 = 13_{10}

3. Decimal to Binary Conversion (with Examples)


Divide the decimal number successively by 2, recording the remainders until the quotient becomes 0. Read
remainders from bottom to top (LSB to MSB).

Example: Convert 25_{10} to Binary


• 25 \div 2 = 12 remainder 1 (LSB)
• 12 \div 2 = 6 remainder 0
• 6 \div 2 = 3 remainder 0
• 3 \div 2 = 1 remainder 1

E
• 1 \div 2 = 0 remainder 1 (MSB)

Result: 11001_2

UNIT 3: Problem Solving

T H
1. Algorithm and Characteristics

P
An Algorithm is a step-by-step finite sequence of unambiguous instructions designed to solve a specific
problem.

M
A
Characteristics of a Good Algorithm:
• Input: Zero or more well-defined inputs.
• Output: At least one well-defined output.
• Definiteness: Each step must be clear, precise, and unambiguous.
• Finiteness: The algorithm must terminate after a finite number of steps.
• Effectiveness: Each instruction must be basic enough to be executed easily.

2. Flowchart and Symbols


A Flowchart is a pictorial or graphical representation of an algorithm using standardized geometric symbols
connected by flow lines.

• Oval (Terminal): Start / End of program.


• Parallelogram (Input/Output): Reading input or displaying output.
• Rectangle (Process): Arithmetic or assignment operations.

THE AMP — Computer Science Comprehensive Study Notes Page 3 of 9


• Diamond (Decision): Conditional branching (Yes/No or True/False).
• Arrows (Flow Lines): Direction of execution flow.

3. Algorithm vs. Flowchart

Algorithm Flowchart

Step-by-step written logic using natural language or Graphical/diagrammatic representation of logic using
pseudo-code. standard symbols.

Easier to write for complex mathematical logic. Easier to visualize program flow and spot logical errors.

Visual debugging makes tracking execution paths


Debugging text lines can be time-consuming.
straightforward.

UNIT 4: Programming Concepts

H E
1. Language Translators: Compiler, Interpreter, Assembler
• Compiler: Translates the entire high-level source code into machine code all at once, generating an
executable file and error report.

T
Example: GCC for C/C++.
• Interpreter: Translates and executes high-level source code line-by-line. Stops execution immediately

P
upon encountering an error.
Example: Python Interpreter.
• Assembler: Translates low-level assembly language mnemonics into machine-understandable binary

M
code.
Example: NASM, TASM.

High-Level Language (HLL)


A
2. High-Level vs. Low-Level Programming Languages

Human-readable, English-like syntax (e.g., Python, Java, C+


+).
Low-Level Language (LLL)

Machine-oriented, binary code or symbolic


assembly.

Machine dependent (tied to specific CPU


Machine independent (portable across architectures).
architecture).

Requires compiler or interpreter for execution. Requires assembler or runs directly on hardware.

THE AMP — Computer Science Comprehensive Study Notes Page 4 of 9


UNIT 5: Operating System

1. Definition and Functions of an Operating System


An Operating System (OS) is system software that acts as an intermediary between computer hardware and
the user/applications.

Core Functions of OS:


• Process Management: Scheduling, creation, and termination of processes.
• Memory Management: Allocation and deallocation of RAM space among active tasks.
• File System Management: Organization, storage, retrieval, and security of files.
• Device Management: Controlling hardware peripherals via device drivers.
• Security & Access Control: User authentication and authorization.

2. Types of Operating Systems

Server).

H E
• Single-User OS: Designed for one user at a time (e.g., MS-DOS, early Windows).
• Multi-User OS: Allows multiple concurrent users to access system resources (e.g., Linux, UNIX, Windows

• Batch OS: Executes jobs in batches with similar needs without user interaction.

T
• Multiprogramming OS: Keeps multiple programs in main memory concurrently to maximize CPU
utilization.

P
• Real-Time OS (RTOS): Guarantees precise response times within strict time constraints (e.g., medical
equipment, aerospace control).

UNIT 6: Computer Security

1. Virus vs. Worm

Virus
A
Worm
M
Requires a host program or file to attach Stand-alone malware that self-replicates and spreads across
itself and replicate. networks without human intervention.

Spreads when infected files are shared or


Spreads by exploiting network vulnerabilities automatically.
executed.

2. Malware Types & Prevention


• Trojan Horse: Disguised as legitimate software to steal data or compromise systems.
• Ransomware: Encrypts user files and demands payment for the decryption key.
• Spyware: Secretly monitors user activity and steals sensitive data.

THE AMP — Computer Science Comprehensive Study Notes Page 5 of 9


• Preventive Measures: Install reputable antivirus software, keep OS and software updated, avoid
suspicious email attachments, use strong unique passwords, and backup data regularly.

UNIT 7: Computer Networks

1. Computer Networks & Scale (PAN, LAN, MAN, WAN)


A Computer Network is a collection of interconnected computing devices that share resources and data.

• PAN (Personal Area Network): Centered around an individual workspace (range ~10 meters). Example:
Bluetooth headphones connected to a phone.
• LAN (Local Area Network): Covers a single room, office building, or school. Example: Office Ethernet
network.
• MAN (Metropolitan Area Network): Spans across an entire city or town. Example: Cable television
network.
• WAN (Wide Area Network): Connects computers across countries or globally. Example: The Internet.

E
2. Networking Devices
• Hub: Dumb broadcast device that floods incoming packets to all ports.

T H
• Switch: Intelligent device that forwards data frames directly to the intended destination port using MAC
addresses.
• Router: Connects disparate networks together and routes packets based on IP addresses.
• Gateway: Protocol translator connecting two entirely different network architectures.

3. Network Topologies

M P
• Star: All nodes connect to a central hub/switch. Advantage: Easy troubleshooting; failure of one cable
doesn't break network. Disadvantage: Central switch failure brings down whole network.

A
• Bus: Single central cable (backbone) connects all devices. Advantage: Cost-effective and requires less
cable. Disadvantage: Backbone break halts entire network.
• Ring: Devices connected in a closed circular loop. Advantage: Equal access for all nodes. Disadvantage:
Single node failure breaks the ring.
• Mesh: Every device connected to multiple or all other devices. Advantage: High redundancy and fault
tolerance. Disadvantage: Extremely expensive and complex wiring.
• Hybrid: Combination of two or more distinct topologies (e.g., Star-Ring).

4. MAC Address
A Media Access Control (MAC) Address is a unique 48-bit physical identifier burned into a network
interface card (NIC) by the manufacturer. It ensures precise physical delivery of frames within a local network.

THE AMP — Computer Science Comprehensive Study Notes Page 6 of 9


UNIT 8: Data Structures

1. Definition and Classification


A Data Structure is a specialized format for organizing, processing, retrieving, and storing data efficiently in
computer memory.

• Primitive Data Structures: Basic data types supported directly by machine instructions (e.g., Integer,
Float, Character, Pointer).
• Non-Primitive Data Structures: Derived or composite structures built using primitive types (e.g., Arrays,
Stacks, Queues, Linked Lists, Trees, Graphs).

2. Stack and Queue


• Stack: Linear data structure operating on Last In, First Out (LIFO) principle.
Operations: push() (insert at top), pop() (remove from top), peek().
Applications: Function call management (recursion), expression evaluation, undo mechanisms.
• Queue: Linear data structure operating on First In, First Out (FIFO) principle.

E
Operations: enqueue() (insert at rear), dequeue() (remove from front).
Applications: Printer job queues, CPU scheduling, BFS graph traversal.

UNIT 9: Searching and Sorting

T
1. Linear Search vs. Binary Search
H
Linear Search

Scans elements sequentially from start to end.

M P
Binary Search

Repeatedly divides a sorted search space in half.

A
Works on both sorted and unsorted data. Requires data to be strictly sorted beforehand.

Time Complexity: O(n). Time Complexity: O(\log n).

2. Bubble Sort & Selection Sort


• Bubble Sort: Repeatedly compares adjacent elements and swaps them if they are in the wrong order,
causing larger elements to "bubble" to the end. Time Complexity: O(n^2).
• Selection Sort: Repeatedly finds the minimum element from the unsorted sublist and places it at the
beginning. Time Complexity: O(n^2).

THE AMP — Computer Science Comprehensive Study Notes Page 7 of 9


EXPECTED 5-MARK LONG ANSWER QUESTIONS & HIGH-
PROBABILITY MCQS

1. Explain the internal components of a computer system with memory and I/O devices.
Answer: A computer system is an integrated set of hardware and software components designed to accept
input, process data, store information, and produce meaningful output. The core internal components include:

• The CPU (Central Processing Unit): Comprising the ALU (performs arithmetic and logical comparisons),
CU (directs instruction execution flow), and Registers (ultra-fast storage locations).
• Memory Subsystem: Divided into Primary Memory (RAM for working execution, ROM for boot firmware)
and Cache Memory (high-speed buffer close to CPU).
• Secondary Storage: Non-volatile magnetic or solid-state drives (HDD/SSD) ensuring permanent data
retention.
• Input/Output (I/O) Devices: Input devices (keyboard, mouse) bridge human instructions into machine
signals, while output devices (monitors, printers) translate processed binary data into human-perceptible
formats.

H E
2. Explain Number Systems and solve binary-decimal conversions.
Answer: Number systems provide standardized mathematical frameworks for representing numerical values
using digits. Key systems include Decimal (Base-10), Binary (Base-2), Octal (Base-8), and Hexadecimal

T
(Base-16).

P
Solved Conversion Problem: Convert 10110_2 to Decimal
10110_2 = (1 imes 2^4) + (0 imes 2^3) + (1 imes 2^2) + (1 imes 2^1) + (0 imes 2^0)

M
= 16 + 0 + 4 + 2 + 0 = 22_{10}

A
3. Explain Computer Networks and Networking Devices.
Answer: A computer network connects multiple autonomous computing devices to enable resource sharing,
communication, and data exchange. Networks are classified by scale into PAN, LAN, MAN, and WAN.
Networking hardware includes Hubs (broadcast devices), Switches (MAC-based intelligent forwarders),
Routers (IP-based inter-network traffic directors), and Gateways (protocol translation gateways).

4. Explain Network Topologies with Suitable Descriptions.


Answer: Network topology refers to the geometric arrangement of nodes and communication links in a
computer network:

• Star Topology: All nodes connect to a central hub/switch. Easy to manage; single cable failure isolates
only that node.
• Bus Topology: Devices share a common communication backbone cable. Cost-effective, but backbone
damage halts the entire network.

THE AMP — Computer Science Comprehensive Study Notes Page 8 of 9


• Ring Topology: Devices form a closed loop where data travels in one direction. Equal access, but ring
breakage disrupts communication.
• Mesh Topology: Every device connects to multiple/all other devices, offering extreme fault tolerance and
redundancy at high cost.

5. Define Data Structure and explain Stack and Queue Operations.


Answer: Data structures organize and store data efficiently in memory. A Stack follows LIFO (Last In, First
Out) with push() and pop() operations, widely used in expression parsing and function calls. A Queue follows
FIFO (First In, First Out) with enqueue() and dequeue() operations, essential for task scheduling and printer
buffers.

6. High-Probability Examination MCQs (Quick Review)


1. Cache Memory: Sits between CPU and RAM to dramatically reduce data access latency.
2. Algorithm: A finite, step-by-step unambiguous procedure to solve a computational problem.
3. Flowchart: A graphical representation of program logic using standardized geometric symbols.

E
4. High-Level Language: Human-readable programming languages like Python and Java.
5. Operating System: System software managing computer hardware and software resources.

H
6. LAN and WAN: Local Area Network covers single buildings; Wide Area Network spans global distances.
7. Router: Layer-3 device directing data packets across different networks using IP addresses.

T
8. MAC Address: Unique 48-bit hardware identifier assigned to network interface cards.
9. Data Structure: Specialized format for organizing and storing data in memory.

P
10. Stack: Linear data structure operating on LIFO (Last In, First Out) principle.
11. Functions of OS: Process, memory, file, and device management.

M
12. Virus vs. Worm: Viruses require host programs to replicate; worms spread independently across
networks.
13. Linear vs. Binary Search: Linear search scans sequentially (O(n)); binary search halves sorted search
space (O(\log n)).

A
14. Compilers & Interpreters: Compilers translate entire source code at once; interpreters translate line-by-
line.

THE AMP — Computer Science Comprehensive Study Notes Page 9 of 9

You might also like