













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














Software can either be categorized as applications software or systems software.
Utilities
● Incremental Backup: Backs up only the data that has changed since the last backup, saving time and storage space, but restoration requires access to the full chain of backups. 3) What are compression utilities, and why are they useful? Explain the difference between lossless and lossy compression with examples. Compression utilities reduce the size of files or folders, making them easier to store and transmit. ● Lossless Compression: Reduces file size without losing any data (e.g., ZIP, PNG), allowing the original data to be perfectly reconstructed. ● Lossy Compression: Reduces file size by permanently removing some data, which can degrade quality (e.g., JPEG, MP3). Compression Software ● Purpose : Reduces file size for easier storage and transmission. ● Examples : WinZip, WinRAR for compressing large files. ○ Lossless Compression : Compresses data without quality loss (e.g., ZIP). ○ Lossy Compression : Reduces quality to compress data more effectively (e.g., JPEG, MP3). Applications Software Types
Open source vs closed source
○ Proprietary, users need a license. ○ Source code hidden, cannot modify. ○ E.g., Microsoft Windows, Adobe Photoshop. Choosing Software Considerations : ● Functionality, ● availability (off-the-shelf or custom), ● cost, ● user support ● community backing. - tested **QUESTIONS
● Advantages for Users: Open source software is often free, reducing costs. It offers transparency and security, as the code can be audited for vulnerabilities. Users have control over the software, with the ability to customize it to meet specific needs.
Assembly language is a low-level programming language that uses mnemonics to represent machine code instructions, making it more human-readable. An assembler translates each assembly language instruction directly into its corresponding machine code instruction, producing an executable binary file that can be run on the computer.
● Definition : Bytecode is an intermediate code representation that is neither fully compiled nor purely interpreted. It sits between high-level source code and machine code. ● How It Works : Languages like Python and Java often compile their source code into bytecode. ● This bytecode can be executed by a bytecode interpreter. ○ In Java, bytecode is compiled once and runs on any system with a compatible interpreter. ○ In Python, bytecode may be recompiled every time there is a change in the source code. ● Advantages : ○ Platform Independence : Bytecode can run on any platform with the appropriate interpreter. For example, Java programs can run on any machine with a Java Virtual Machine (JVM) , which translates bytecode to machine code specific to that platform. ○ Security : Bytecode acts as a layer between the machine and untrusted code, adding security. In Java, running bytecode instead of source code can protect the system from potential malware.
○ Ease of Development : Interpreted code doesn’t require recompilation after each change, which speeds up development and debugging. ● Disadvantages : ○ Performance : Interpreted code generally runs slower because each line of code is translated and executed on the fly. ○ Loop Overheads : In interpreted programs, each line in a loop is re-interpreted every time the loop runs, leading to increased execution time for loops.
The compilation process includes several stages:
3. Code Generation and Optimisation
into tokens and performing initial checks. Main Functions: ● Removing Extra Spaces: Unnecessary spaces are removed to make code more compact. ● Comment Removal: All comments (e.g., lines starting with # or //) are discarded as they are only useful for human readers. ● Basic Error Checking: Detects some syntax errors, such as: ○ Illegal Identifiers: Invalid variable names like X&Y or ten$. ○ Invalid Constant Assignments: Flags errors when assigning incompatible values (e.g., assigning a string to an integer variable). ● Tokenization: Converts keywords, constants, and identifiers (such as variable names) into tokens, each representing a unique symbol. These tokens are stored in the symbol table.
2. Symbol Table
keywords in the program. Contents : ● Identifier or Keyword : Stores the name of variables, keywords, or constants. ● Kind of Item : Type of element, such as variable, array, procedure, or operator. ● Data Type : Specifies the data type (e.g., integer, real). ● Run-time Address or Value : Holds either the memory address (for variables) or value (for constants). ● Pointer : Points to additional information, such as array bounds or procedure parameters.
■ Removing Redundant Instructions : Eliminates unnecessary steps that do not affect the program's outcome. ■ Loop Optimisation : Detects repetitive operations that can be simplified. ○ Disadvantages : ■ May increase compilation time due to additional processing. ■ Can lead to unexpected results, especially if the code relies on exact timings or specific program behavior. Example of Optimisation : ● In a loop counting from 1 to 100000, an optimiser might detect that some operations can be performed once rather than repeatedly. Linkers and Loaders ● Linkers : ○ Purpose : After compiling, the linker combines all program components, including subroutines, external libraries, and other modules, into a single executable. ○ Function : The linker assigns correct addresses to all references in the program, ensuring that all parts connect correctly at runtime. ● Loaders : ○ Purpose : Loads the program into memory, preparing it for execution. ○ Relocating Loader : Allows code to be loaded into different parts of memory each time, provided it is in a relocatable format. Use of Libraries ● Definition : Libraries contain pre-written, tested, and compiled code (e.g., .dll files on Windows) that can be reused in multiple programs. ● Advantages : ○ Saves Time : Programmers can use established functions without needing to "reinvent the wheel." ○ Reliability : Libraries are typically tested and error-free, reducing the likelihood of bugs. ● Examples of Common Library Functions :
○ Mathematical Operations : Functions like sqrt(), sin(), etc. ○ Random Number Generation : Functions for creating random numbers within a specified range. ○ File I/O : Functions to read from and write to files. QUESTION:
● Complexity and Difficulty to Learn : Low-level languages are harder to learn and write because they require detailed knowledge of the hardware and instruction sets. ● Time-Consuming to Develop : Writing complex applications in assembly language can be very time-consuming and error-prone. ● Lack of Portability : Code written in assembly language is usually specific to a particular hardware architecture, making it hard to port to other systems. Translation Software: ● Assembler : An assembler translates assembly language code into machine code so that the CPU can execute it directly. Appropriate Situations: ● Embedded Systems : When developing software for embedded systems with limited memory or processing power, where efficiency and direct hardware control are critical. ● System-Level Programming : When writing device drivers or OS kernels, which need to communicate directly with hardware.
focuses on giving instructions to solve a problem. It abstracts away the complexities of the hardware, making programming simpler and more accessible. ● Example : C (another example could be Python or Java, but C is closer to hardware control). Advantages:
● Ease of Use and Readability : High-level languages are easier to learn and read, as they use a syntax closer to human language. ● Faster Development : High-level languages provide libraries and built-in functions, speeding up development. ● Portability : High-level languages are generally portable across multiple platforms with little to no modification. Disadvantages: ● Less Control Over Hardware : High-level languages abstract away hardware details, which can limit performance and fine-grained control. ● Performance Overhead : High-level languages can introduce overhead due to abstractions, making them less efficient compared to low-level languages. Translation Software: ● Compiler : A compiler (e.g., GCC for C) translates high-level language code into machine code for execution. ● Interpreter (if applicable, for languages like Python): An interpreter translates high-level language code into machine code line-by-line at runtime. Appropriate Situations: ● Application Development : When developing general-purpose applications where portability, maintainability, and development speed are more important than maximum efficiency. ● Business Software and Web Development : For projects that require rapid development and frequent updates, such as business applications or websites, where hardware control is less relevant.