0% found this document useful (0 votes)
25 views17 pages

Detailed Revision Guide

ooof

Uploaded by

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

Detailed Revision Guide

ooof

Uploaded by

17adarao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

COMPUTER SCIENCE

REVISION GUIDE
Component Description
Coordinates the activities of all other components and sends control
Control Unit
signals.
Arithmetic-Logic Performs arithmetic operations (addition, subtraction) and logical
Unit (ALU) operations (AND, OR, NOT).
Small, fast storage locations within the CPU used to hold temporary
Registers
data and instructions.
A communication system that transfers data between components of
System Bus
a computer.
Key Registers

Register Description
Holds the memory address of the next instruction to be
Program Counter (PC)
executed.
Current Instruction Holds the current instruction being executed, split into opcode
Register (CIR) and operand.
Memory Address Register Holds the address in memory where data is to be fetched or
(MAR) stored.
Memory Data Register Temporarily holds data moving between the processor and
(MDR) main memory.
Accumulator Holds intermediate results of arithmetic and logic operations.
Key Processes in the Fetch-Execute Cycle

Sta
Steps
ge
Fet 1. Copy address from PC to MAR. 2. Copy instruction from memory to MDR. 3.
ch Increment PC. 4. Copy MDR to CIR.
De
5. Decode instruction in CIR. 6. Split into opcode and operand. 7. Fetch additional
cod
data if needed.
e
Ex
ecu 8. Execute the instruction and store the result in the accumulator or memory.
te
Key Functions of Control Signals

 Memory Read: Transfers data from RAM to the data bus.


 Memory Write: Writes data from the data bus to RAM.
 Bus Request: Indicates a device is requesting access to the data bus.
 Bus Grant: Indicates the CPU has granted access to the data bus.
 Clock: Synchronizes operations within the CPU.
Facts to Memorize

 ALU operations: Add, Subtract, Multiply, Divide


 Logical operations: AND, OR, NOT, XOR
 Fetch-Execute cycle steps: Fetch (1-4), Decode (5-7), Execute (8)
 Key registers: Program Counter (PC), Current Instruction Register (CIR), Memory
Address Register (MAR), Memory Data Register (MDR), Accumulator
Reference Information

 Control Unit: Coordinates the activities of all components


 System Bus: Composed of control, address, and data buses
 Buses: Typically consist of 8, 16, 32, or 64 lines
Problem-Solving Steps
To understand the Fetch-Execute cycle, follow these steps:

1. Fetch: Copy the address of the next instruction from the Program Counter (PC)
to the Memory Address Register (MAR).
2. Read: Retrieve the instruction from memory into the Memory Data Register
(MDR).
3. Increment: Increment the Program Counter (PC) to point to the next instruction.
4. Load: Copy the instruction from the MDR to the Current Instruction Register
(CIR).
5. Decode: Decode the instruction in the CIR to determine the opcode and operand.
6. Fetch Data: If needed, fetch additional data from memory using the MAR.
7. Execute: Perform the operation specified by the opcode, storing the result in the
Accumulator or memory.
Tips: Ensure to keep track of the state of the registers at each step to avoid confusion.
Key Terms/Concepts

 Central Processing Unit (CPU): The main component of a computer that


performs most of the processing inside a computer.
 Control Unit: The part of the CPU that directs the operation of the processor and
coordinates the activities of all other components.
 Arithmetic-Logic Unit (ALU): The component of the CPU that performs
arithmetic and logical operations.
 Fetch-Execute Cycle: The process by which the CPU retrieves an instruction
from memory, decodes it, and executes it.

Key Factors Affecting CPU Performance

Factor Description
Clock Determines how quickly instructions are fetched, decoded, and executed.
Speed Higher speeds lead to better performance.
Number More cores enable simultaneous processing of multiple instructions,
of Cores enhancing multitasking capabilities.

2
Cache Larger and faster cache memory reduces the need to fetch data from slower
Memory RAM, improving overall speed.
Key Components of a Computer

 Address Bus: The width of the address bus determines the maximum number of
memory addresses. An 8-bit address bus can address 256 memory locations.
 Data Bus: A bi-directional bus that carries data between the CPU and memory.
Its width affects how much data can be transferred at once.
 Fetch-Execute Cycle: The process by which a CPU retrieves an instruction from
memory, decodes it, and executes it.
Key Concepts in Assembly Language

 Machine Code: The lowest-level programming language, consisting of binary


instructions that the CPU can execute directly.
 Assembly Language: A low-level programming language that is closely related
to machine code, using mnemonics to represent machine instructions.
Key Techniques for Improving CPU Efficiency

 Pipelining: Allows multiple instructions to be processed at different stages


simultaneously, increasing throughput.
 Parallel Processing: Utilizes multiple cores to perform different tasks
concurrently, improving performance for suitable applications.
Facts to Memorize

 Clock speed: 4 GHz = 4 billion cycles per second


 Maximum memory addresses with an 8-bit address bus: 256
 Average PC memory capacity: 4 GiB = 2^32 bytes
 Word lengths: 8, 16, 32, or 64 bits
Reference Information

 Level 1 cache: Fastest, split into instruction and data cache


 Level 2 cache: Larger but slower than Level 1
 Dual-core: 2 processors; Quad-core: 4 processors
 Pipelining: Technique to improve performance by overlapping instruction stages
Problem-Solving Steps
To calculate the memory capacity in bytes of a machine with an 8-line address bus and a word length
of 8 bits:

1. Determine the number of memory addresses: 2^8 = 256.


2. Calculate the total memory capacity: 256 addresses * 8 bits = 2048 bits.
3. Convert bits to bytes: 2048 bits / 8 = 256 bytes.
Tips: Always remember to convert bits to bytes by dividing by 8. Common pitfalls include forgetting
to account for the word length when calculating total memory.
Key Terms/Concepts

 Clock Speed: The speed at which a processor can execute instructions,


measured in GHz. A higher clock speed means more instructions can be
processed per second.

3
 Number of Cores: Refers to the number of independent processing units within
a CPU. More cores allow for better multitasking and parallel processing.
 Cache Memory: A small amount of high-speed memory located on the CPU that
stores frequently accessed data and instructions to speed up processing.
 Pipelining: A technique that allows multiple instruction stages to overlap in
execution, improving CPU efficiency by processing several instructions
simultaneously.

Fundamental Theories

 Stored Program Concept: A fundamental principle where a program must be


loaded into main memory to be executed by the processor, with instructions
fetched, decoded, and executed sequentially.
Key People

 John von Neumann: Mathematician and computer scientist who proposed the
stored program concept and developed the von Neumann architecture.
 Alan Turing: Pioneer of computer science who contributed to the development of
theoretical foundations for computing.
Key Features of Processor Architectures

Feature Von Neumann Architecture Harvard Architecture


Memory Single shared memory for data and Separate memories for data and
Structure instructions instructions
Multiple buses for data and
Bus System Single bus for data and instructions
instructions
Specialized embedded systems
Use Cases General-purpose computing
and DSP
More complex design, higher
Complexity Simpler design, cost-effective
speed
Key Systems

 Multi-core Processors: Processors that have multiple cores to distribute


workload and perform tasks in parallel, enhancing performance.
 Co-processor Systems: Additional processors that supplement the primary CPU
to perform specific functions like graphics processing or floating-point arithmetic.
Facts to Memorize

 Von Neumann architecture: Instructions and data share the same memory.
 Harvard architecture: Instructions and data are stored in separate memories.
 CISC: Complex Instruction Set Computers use a large instruction set.
 RISC: Reduced Instruction Set Computers use a minimal number of simple
instructions.
 GPU: Graphics Processing Unit, specialized for parallel processing of graphics.
Reference Information

4
 Von Neumann architecture is the most common architecture for general-purpose
computers.
 Harvard architecture is often used in embedded systems and digital signal
processing.
 Multi-core processors can significantly improve performance by executing
multiple tasks simultaneously.
Concept Comparisons

Feature Von Neumann Architecture Harvard Architecture


Memory Single shared memory for data and Separate memories for data and
Structure instructions instructions
Separate buses for data and
Bus System Single bus for data and instructions
instructions
Use Cases General-purpose computing Embedded systems, DSP
More complex design, potentially
Complexity Simpler design, more cost-effective
faster
Problem-Solving Steps
To understand the differences between CISC and RISC:

1. Identify the instruction set size: CISC has a large set, RISC has a small set.
2. Analyze the instruction complexity: CISC instructions can perform multiple
operations, while RISC instructions are simple and perform one operation.
3. Consider execution time: CISC may take multiple cycles for complex instructions,
while RISC aims for one cycle per instruction.
4. Evaluate the impact on performance: RISC can lead to higher performance
through pipelining due to its simplicity.

Key Input Devices

Device Description
Used for manual data entry; specialist keypads are used in specific
Keyboard/Keypad
applications.
Pointing Devices Includes mice and trackballs; trackballs require less desk space.
Touchscreens Used in tablets and mobile devices for direct interaction.
Interactive
Used for presentations; allows for annotations and saving of notes.
Whiteboards
Scans barcodes for data entry; includes UPC-A and Code 128
Barcode Readers
types.
Key Types of Sensors

Sensor Type Functionality


Gas Sensors Detects gases like oxygen and carbon dioxide.
Infra-red Sensors Detects motion or heat sources.

5
Light Sensors Measures light intensity.
Temperature Sensors Measures temperature changes.
Pressure Sensors Monitors pressure levels.
Key Applications of Input Devices

 QR Codes: Used for quick access to information via smartphones; common in


advertising and ticketing.
 2D Scanners: Converts physical documents into digital formats for sharing.
 3D Scanners: Used in industrial and medical fields for creating 3D models.
Key Monitoring and Control Examples

 Intruder Detection Systems: Utilize pressure, infra-red, and acoustic sensors to


monitor for unauthorized access.
 Pollution Monitoring: Sensors measure pollution levels in rivers, sending data
to a computer for analysis and alerts.
Facts to Memorize

 Types of input devices: Manual (keyboards, pointing devices) and automatic


(scanners, sensors).
 Common barcode types: UPC-A (numeric only) and Code 128 (alphanumeric).
 Key sensor types: Gas, Infra-red, Light, Temperature, Pressure, pH, Magnetic
field, Moisture/humidity, Acoustic.
Reference Information

 Interactive whiteboards allow for annotations and saving of notes.


 3D scanners use Tomography to create detailed images from thin slices.
 QR codes can link to websites or provide information.
Concept Comparisons

Input Device
Description Examples
Type
Manual Input Keyboards, Pointing
Require human intervention to input data.
Devices devices
Automatic Automatically capture data from the
Scanners, Sensors
Input Devices environment without human input.
Barcode UPC-A, Code 128, QR
Used for tracking and identifying products.
Systems codes
Monitoring Systems that report values without altering Temperature
Systems processes. monitoring, Pollution
Control Systems that can alter processes based on Intruder alarms,
Systems input data. Environmental control
Problem-Solving Steps
To analyze data from sensors in a monitoring system:

1. Data Collection: Sensors gather data (e.g., temperature, pressure).

6
2. Data Conversion: Use an ADC (Analog to Digital Converter) to convert analogue
data to digital.
3. Data Analysis: The computer checks the data against pre-set thresholds.
4. Alerting: If thresholds are exceeded, the system triggers alerts (e.g., alarms,
notifications).
5. Continuous Monitoring: The system continues to monitor until deactivated.

Key Devices

Device
Description
Type
Uses liquid ink, available in various models, often low initial cost but high
Inkjet Printer
ink costs.
Uses toner, fast and reliable, excellent print quality, commonly used in
Laser Printer
businesses.
Dot Matrix Impact printer that uses an inked ribbon to print, useful for multi-part
Printer stationery.
Creates solid objects from various materials, used in medicine and
3D Printer
manufacturing.
RFID Uses transponders and receivers for identification and tracking, can be
System passive or active.
Key Applications

 Medicine: 3D printers are used to create prosthetic limbs and surgical models,
improving accuracy and reducing costs.
 Manufacturing: 3D printing allows for the production of parts for old cars and
rapid prototyping in design.
 Security: RFID technology is used for tracking goods and people, enhancing
security measures in various industries.
Key Features of Output Devices

 Inkjet Printers: Can print in color, but may not function if a color cartridge is
empty.
 Laser Printers: Known for high-speed printing and excellent quality, suitable for
bulk printing tasks.
 3D Printers: Capable of producing intricate designs and functional objects, with
potential future applications in organ printing.
Key Advantages of LED Technology

 Brightness: LEDs reach maximum brightness quickly and provide sharper


images.
 Energy Efficiency: Consume less power and produce less heat compared to
CCFLs.
 Longevity: LEDs have a longer lifespan, making them more reliable for various
applications.
Facts to Memorize

7
 Common output devices: printers, screens, loudspeakers, multimedia projectors.
 Inkjet printers can use up to 10 different colors.
 Laser printers use dry powdered ink called toner.
 Dot matrix printers are also known as impact printers.
 3D printers can print using various materials including plastic filament and metal
powder.
 RFID systems consist of a transponder and a receiver.
Reference Information

 Inkjet printers are often sold at or below production cost, while ink cartridges are
marked up.
 Laser printers are preferred in businesses for their speed and reliability.
 OLED screens are thinner and lighter than traditional LCD or LED screens.
Concept Comparisons

Featur
Inkjet Printers Laser Printers Dot Matrix Printers
e
Print Good for photos, can Excellent, sharp text and Poor, noisy, and less
Quality smear images detailed
Fast, suitable for high
Speed Slower than laser Slow, similar to typewriter
volume
Low initial cost, high Higher initial cost, low High initial cost, low
Cost
ink cost running cost running cost
Use Home use, photo Business documents, Multi-part stationery,
Cases printing labels rugged use
Problem-Solving Steps
To determine the best output device for a specific application:

1. Identify the primary use case (e.g., printing documents, creating prototypes).
2. Consider the required print quality (e.g., high-quality images vs. standard text).
3. Evaluate the speed needed for the task (e.g., fast printing for business vs. slower
for home use).
4. Assess the budget for both initial purchase and ongoing costs (e.g., ink or toner).
5. Research the durability and reliability of the device in the intended environment.

Key Storage Devices

Device
Description
Type
Hard Disk A magnetic storage device with high capacity, fast read/write speeds, and
Drive relatively low cost.
Solid State A non-volatile storage device using flash memory, known for durability,
Drive speed, and portability.
USB Flash A portable storage device that can store up to 128GB of data, useful for
Drive transferring files.

8
Optical Includes CDs, DVDs, and BluRay, used for software distribution and media
Disks storage.
Key Advantages/Disadvantages

Storag
Advantages Disadvantages
e Type
High capacity, low cost per TB, good for Slower than SSDs, more prone to
HDD
large data storage. physical damage.
Faster access speeds, more durable, Higher cost, typically less storage
SSD
consumes less power. capacity.
Optical Cheap to manufacture, lightweight, Limited capacity compared to
Disks robust during transport. HDDs and SSDs.
Key Uses of Storage Devices

 RAM: Used for running applications and temporarily storing data for quick
access.
 ROM: Stores firmware and boot instructions necessary for starting the computer.
 HDD: Ideal for long-term data storage and backups.
 SSD: Preferred for operating systems and applications requiring fast load times.
 USB Flash Drive: Convenient for transferring files between computers.
 Optical Disks: Used for software distribution and media playback.
Key Characteristics of Storage Technologies

Durabilit Portabilit
Storage Type Read/Write Speed Capacity Cost
y y
HDD Moderate Moderate High Low Low
SSD High High Moderate Moderate High
Optical Disks High Low Low High Low
Facts to Memorize

 RAM is volatile memory, meaning it loses its data when power is off.
 ROM is non-volatile memory, retaining data even without power.
 Typical hard disk speeds range from 3,600 to 7,200 RPM.
 USB flash drives can store up to 128GB of data.
 CD-ROM, CD-R, and CD-RW are different formats of optical disks with varying
write capabilities.
Reference Information

 Virtual memory is part of the hard drive used as an extension to RAM.


 Solid state drives (SSD) are faster and more durable than hard disk drives
(HDD).
 Optical disks can be categorized into read-only, recordable, and re-writable
formats.
Concept Comparisons

Feature RAM ROM

9
Volatility Volatile (data lost when off) Non-volatile (data retained)
Read/Write Capability Read and write Read only
Speed Very fast Slower than RAM
Usage Temporary data storage Permanent instructions
Problem-Solving Steps
To determine the best storage solution for a specific need:

1. Identify the data type and size requirements.


2. Assess the speed needed for data access and transfer.
3. Consider the durability and portability of the storage device.
4. Evaluate the cost-effectiveness of the storage options.
5. Make a decision based on the analysis of the above factors.

Key Functions of an Operating System

Function Description
Provides a way for users to interact with the computer, hiding hardware
User Interface
complexity.
Memory
Allocates and manages RAM for different programs and processes.
Management
Interrupt Manages interrupts from hardware and software, allowing the CPU to
Handling respond to events.
Processor Determines the order and time each process can use the CPU,
Scheduling enabling multitasking.
Key Scheduling Algorithms

Algorithm Description
Round Robin Each job is given a fixed time slice in a cyclic order.
First Come First Served
The first job to arrive is executed until completion.
(FCFS)
Shortest Remaining Time The job with the shortest remaining time is executed next.
The job with the smallest total execution time is executed
Shortest Job First (SJF)
next.
Multi-Level Feedback Multiple queues with different priority levels, allowing dynamic
Queues adjustment.
Key People

 David Patterson: Known for his work on computer architecture and operating
systems.
 Andrew S. Tanenbaum: Author of 'Operating Systems: Design and
Implementation', a foundational text in OS education.
Key Concepts in Interrupt Handling

10
Concept Description
Interrupt Service
A special routine that the CPU executes in response to an interrupt.
Routine
Determines the order in which interrupts are processed based on
Interrupt Priority
their importance.
The CPU uses a stack to save the state of the current process when
Stack Usage
an interrupt occurs.
Facts to Memorize

 The boot loader in ROM loads the Operating System (OS) into RAM.
 The CPU processes jobs according to a scheduling algorithm.
 A stack is a LIFO (Last In, First Out) data structure.
Reference Information

 Types of scheduling algorithms: Round Robin, First Come First Served, Shortest
Job First, Shortest Remaining Time, Multi-Level Feedback Queues.
 Memory management techniques: Paging, Segmentation, Virtual Memory.
Problem-Solving Steps
To understand how to manage memory in an operating system, follow these steps:

1. Identify the memory requirements of the processes that need to run.


2. Choose a memory management technique (paging, segmentation, or virtual
memory).
3. Allocate memory based on the chosen technique:
a. For paging, divide memory into pages and allocate non-contiguous pages as
needed.
b. For segmentation, allocate segments based on the logical structure of the
program.
c. For virtual memory, ensure that the hard disk is set up to handle overflow from
RAM.
4. Monitor memory usage to prevent thrashing and ensure efficient operation.
5. Adjust allocations as processes start and stop to optimize performance.
Key Terms/Concepts

 Operating System (OS): Software that manages computer hardware and


provides an interface for users and application software.
 Memory Management: The process of controlling and coordinating computer
memory, including allocation and deallocation of memory spaces.
 Paging: A memory management scheme that eliminates the need for contiguous
allocation of physical memory and divides memory into fixed-size pages.
 Segmentation: A memory management technique that divides memory into
segments of variable lengths, often corresponding to logical divisions of a
program.
 Virtual Memory: A memory management capability that allows the execution of
processes that may not be completely in memory, using disk space as an
extension of RAM.

11
Fundamental Theories

Theory/
Description
Model
Virtual Software that emulates hardware, allowing one OS to run inside another or to
Machine execute intermediate code.
Device Programs that provide an interface for the OS to interact with hardware,
Drivers specific to both the device and OS.
Key Events

 Therac-25 Incident (1980s): A case study involving a radiation therapy machine


with a real-time embedded OS that malfunctioned due to programming errors,
leading to patient deaths from radiation overdoses.
Key Features of Operating Systems

 Multi-user, Multi-tasking: Systems that allow multiple users to access a


powerful mainframe while running multiple processes simultaneously.
 Mobile Operating Systems: OS designed for smartphones, such as iOS and
Android, which manage hardware and user interfaces.
Key Applications

 Household Devices: Many home appliances use embedded operating systems


with minimal features and simple user interfaces.
 Mainframe Systems: Used in universities and large businesses to manage
multiple users and processes efficiently.
Facts to Memorize

 BIOS stands for Basic Input Output System.


 Real-time Operating Systems are crucial in safety-critical environments.
 Android is an open-source operating system based on Linux.
 Device drivers are hardware dependent and OS specific.
Reference Information

 Distributed Operating Systems allow for resource sharing across multiple


computers.
 Multi-tasking systems can schedule processor time to appear to perform multiple
tasks simultaneously.
 Embedded Operating Systems are found in household devices and have minimal
features.
Problem-Solving Steps
To troubleshoot issues with an Operating System:

1. Identify the problem: Determine what is not functioning as expected.


2. Check hardware connections: Ensure all devices are properly connected.
3. Review error messages: Take note of any error codes or messages displayed.
4. Restart the system: A simple reboot can resolve many issues.

12
5. Update drivers: Ensure all device drivers are up to date.
6. Check for software conflicts: Look for any recently installed software that may be
causing issues.
7. Consult documentation: Refer to the OS documentation for specific
troubleshooting steps.
Key Terms/Concepts

 Distributed Operating System: An OS that coordinates processing across


multiple computers, allowing users to access resources as if they were on a
single machine.
 Multi-tasking System: An OS that allows a single processor to handle multiple
tasks by scheduling processor time effectively.
 Embedded Operating System: An OS designed for specific devices with
minimal features, often running simple programs.
 Real-time Operating System: An OS that must respond quickly to inputs, often
used in safety-critical environments.
 BIOS (Basic Input Output System): Firmware stored in ROM that initializes
hardware and loads the operating system at startup.

Key Utility Programs

Utility
Description
Program
Disk
Reorganizes fragmented files on a hard drive to improve access speed.
Defragmenter
Automatic Automates the process of backing up data to prevent loss, specifying
Backup where, when, and what to back up.
Automatic Detects and installs software updates automatically, enhancing features
Updating and fixing security issues.
Scans for viruses using known definitions and heuristics to identify
Virus Checker
potential threats.
Compression Reduces file sizes for easier transmission over the internet, with varying
Software effectiveness based on file type.
Key Categories of Applications Software

 General Purpose Software: Software designed to perform a wide range of tasks


(e.g., word processors, spreadsheets).
 Special Purpose Software: Software designed for a specific task (e.g.,
accounting software, graphic design tools).
 Bespoke Software: Custom software created for a specific user or organization,
often used by businesses.
Key Differences: Open Source vs Closed Source

Feature Open Source Software Closed Source Software

13
Source Code Source code is accessible and Source code is not accessible
Access modifiable by anyone. to users.
Cost Typically free to use. Requires payment for a license.
Users can modify and redistribute the Users cannot modify the
Modification
software. software.
Proprietary licenses with usage
Licensing Licensed under open source licenses.
restrictions.
Key Considerations for Selecting Applications

 Functionality: Does the application meet the required tasks?


 Hardware Compatibility: Will it run on the existing hardware?
 Availability: Is it already available or does it need to be specially written?
 Cost: What is the price of the application?
 Reliability: Has the application been tested and is it free of bugs?
Facts to Memorize

 Types of software: Systems software, Applications software, Utility programs,


Libraries, Translators.
 Key functions of an Operating System: User interface, Memory management,
Interrupt handling, Processor scheduling.
 Types of applications: General purpose, Special purpose, Bespoke.
 Differences between open source and closed source software.
Reference Information

 Examples of utility programs: Disk defragmenter, Automatic backup, Automatic


updating, Virus checker, Compression software.
 Characteristics of off the shelf vs bespoke software.
Concept Comparisons

Feature Open Source Software Closed Source Software


Source Code
Available to everyone Not available to users
Access
Modification Can be modified and redistributed Cannot be modified by users
Cost Generally free Requires a paid license
Licensing Open source licensed Proprietary license
User Restrictions None May have restrictions on usage
Problem-Solving Steps
When selecting an application, consider the following steps:

1. Define the Purpose: Identify what you need the application to do.
2. Check Functionality: Ensure the application meets your requirements.
3. Assess Hardware Compatibility: Verify that the application can run on your
existing hardware.

14
4. Evaluate Availability: Determine if the application is already available or needs
to be custom developed.
5. Consider Cost: Analyze the cost of the application and whether it fits your
budget.
6. Check Reliability: Look for reviews or testing results to ensure the application is
stable and bug-free.

Key Stages of Compilation

Stage Description
Lexical Removes unnecessary spaces and comments, replacing keywords and
Analysis identifiers with tokens.
Syntax Checks the token stream against the language rules, parsing phrases and
Analysis recording errors if invalid.
Semantic Validates the meaning of the phrases, ensuring identifiers are declared
Analysis before use.
Code Generates machine code from the validated program, possibly in multiple
Generation passes for optimization.
Code
Improves the efficiency of the generated code by removing redundancies
Optimizatio
and replacing inefficient code.
n
Key People

 John von Neumann: A mathematician and computer scientist who contributed to


the architecture of modern computers, influencing programming languages and
compilers.
 Bjarne Stroustrup: The creator of C++, a widely used high-level programming
language that utilizes compilers.
Key Advantages of Compilers vs Interpreters

 Compilers: Produce faster executable code since the entire program is


translated at once, allowing for optimizations.
 Interpreters: Allow for easier debugging and testing since they execute code line
by line, providing immediate feedback.
Key Libraries

 Standard Libraries: Pre-written functions available in most programming


languages, such as math functions or data manipulation tools.
 Custom Libraries: Libraries created by programmers to encapsulate reusable
code, which can be called within programs to enhance functionality.
Facts to Memorize

 Assembler: Converts assembly code to machine code.


 Compiler: Translates high-level language to machine code in one go.
 Interpreter: Translates high-level language to machine code line by line.
 Bytecode: Intermediate code used by some languages like Java.

15
 Stages of Compilation: Lexical analysis, Syntax analysis, Semantic analysis,
Code generation, Code optimization.
Reference Information

 High-level languages examples: Visual Basic, C++, JavaScript, PHP.


 Common libraries: Math libraries, Random number generation libraries.
 Linker: Adjusts memory addresses for library functions.
 Loader: Copies executable code into main memory.
Concept Comparisons

Feature Compiler Interpreter


Translation
Translates entire program at once Translates line by line
Method
Output Produces object code Executes code directly
Speed of Slower due to line-by-line
Generally faster after compilation
Execution execution
Errors found after entire code is
Error Detection Errors found during execution
compiled
Suitable for scripting and small
Use Cases Suitable for large programs
programs
Problem-Solving Steps
To solve compilation issues, follow these steps:

1. Lexical Analysis: Remove unnecessary spaces and comments, and tokenize


the code.
2. Syntax Analysis: Check the tokenized code against the language rules; identify
syntax errors.
3. Semantic Analysis: Ensure that the syntax is meaningful; check for undeclared
identifiers.
4. Code Generation: Generate machine code from the validated tokens.
5. Code Optimization: Improve the efficiency of the generated code by removing
redundancies.

Introduction
This revision guide covers essential topics in computer science,
including the components of the CPU, key processes, input/output
devices, and fundamental concepts of operating systems. Use this
guide to solidify your understanding and prepare effectively for
assessments.

Study Tips

16
1. Create flashcards for key terms like ALU, Control Unit, and
registers.
2. Use diagrams to visualize processes like the fetch-execute cycle.
3. Practice explaining each concept aloud to check your
understanding.

17

You might also like