Docsity

Understanding Software Types: Systems, Applications, and Translators, Summaries of Computer science

Toggle sidebar
bg1
1.2.2 Applications Generation
Nature of applications
Software can either be categorized as applications software or systems software.
-Applications software
Application software is designed to be used by the end-user (the person using the computer)
to directly interact with and perform specific tasks such as creating documents
- Application software requires systems software in order to run.
Examples: desktop publishing, word processing, spreadsheets , web browsers.
-Systems software
Systems software is low level software responsible for running the computer system smoothly ,
interacting with hardware and generally providing a platform for applications software to run.
- Examples: library programs, utility programs, operating system, device drivers.
Categories of Software
1. Systems Software
○Operating Systems: Manages hardware, provides a user interface, and runs application software.
○Utility Programs: Perform maintenance tasks (e.g., backup, compression, antivirus).
○Library Programs: Provide commonly used functions to other programs.
○Translators: Convert high-level code to machine code (e.g., compilers, interpreters, assemblers).
2. Applications Software
○Off-the-Shelf: Ready-made software, widely available, often cheaper.
○Custom-Written: Tailored to specific needs, usually more costly.
○Proprietary: Closed-source, licensed, user cannot modify.
○Open Source: Code available for public modification and redistribution.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Understanding Software Types: Systems, Applications, and Translators and more Summaries Computer science in PDF only on Docsity!

1.2.2 Applications Generation

Nature of applications

Software can either be categorized as applications software or systems software.

  • Applications software Application software is designed to be used by the end-user (the person using the computer) to directly interact with and perform specific tasks such as creating documents
  • Application software requires systems software in order to run. Examples: desktop publishing, word processing, spreadsheets , web browsers.
  • Systems software Systems software is low level software responsible for running the computer system smoothly, interacting with hardware and generally providing a platform for applications software to run.
  • Examples: library programs, utility programs, operating system, device drivers. Categories of Software
  1. Systems Software ○ Operating Systems : Manages hardware, provides a user interface, and runs application software. ○ Utility Programs : Perform maintenance tasks (e.g., backup, compression, antivirus). ○ Library Programs : Provide commonly used functions to other programs. ○ Translators : Convert high-level code to machine code (e.g., compilers, interpreters, assemblers).
  2. Applications Software ○ Off-the-Shelf : Ready-made software, widely available, often cheaper. ○ Custom-Written : Tailored to specific needs, usually more costly. ○ Proprietary : Closed-source, licensed, user cannot modify. ○ Open Source : Code available for public modification and redistribution.

Utilities

  • Utilities are a key piece of system software integral to ensuring the consistent, high performance of the operating system.
  • Each utility program has a specific function linked to the maintenance of the operating system. Examples include:
  • Compression Operating systems provide utilities that enable files to compressed and decompressed. This is used when compressing large files to be transmitted across the Internet and is commonly used to compress scanned files.
  • Disk defragmentation As the hard disk becomes full, read/write times slow down. This is because files become fragmented as they are stored in different parts of memory. The disk defragmenter utility rearranges the contents of the hard drive so they can be accessed faster, thus improving performance.
  • Antivirus Antivirus is responsible for detecting potential threats to the computer, alerting the user and removing these threats.
  • Automatic updating This utility ensures the operating system is kept up to date, with any updates being automatically installed when the computer is restarted. Updates tackle bugs or security flaws so this ensures the system is less vulnerable to malware and hacking threats.
  • Backup The backup utility automatically creates routine copies of specific files selected by the user.

● 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

  1. General-Purpose Software : Versatile for many tasks (e.g., word processors, spreadsheets).
  2. Special-Purpose Software : Designed for a specific task (e.g., payroll, booking systems).
  3. Off-the-Shelf vs. Bespoke ○ Off-the-Shelf : Less costly, immediately available, tested and documented. ○ Bespoke : Tailored to user needs, costly, takes longer to develop.

Open source vs closed source

  • Source code is written by a programmer and refers to object code before it has been compiled.
  • When software is described to be ‘open source’ or ‘closed source’, this refers to whether or not the source code is accessible to the public.

○ 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

  1. Define open source software and closed source software. What is the primary difference between the two in terms of availability and distribution?** ● Open Source Software: Software that is freely available to the public, with its source code open for anyone to view, modify, and distribute. Examples include Linux, Apache, and Mozilla Firefox. ● Closed Source Software: Software that is proprietary and restricted, with its source code kept secret by the developers. Users must purchase licenses to use the software, and they are not allowed to modify or distribute it. Examples include Microsoft Windows, Adobe Photoshop, and Microsoft Office. ● Primary Difference: Open source software is freely available with source code, allowing modification and redistribution, while closed source software is proprietary, with restricted access to its source code and usage 2) Discuss the advantages of using open source software for both developers and users. Provide examples to support your points. ● Advantages for Developers: Access to source code allows for learning, modification, and improvement of software. It encourages collaboration and innovation. For example, the Linux community continuously contributes to the development and improvement of the Linux kernel.

● 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.

  1. What are the advantages of closed source software for developers and users? Provide examples to illustrate your points. ○ Advantages for Developers: Closed source software can generate revenue through licensing and sales. It allows developers to control the software’s distribution and maintain intellectual property rights. For example, Microsoft generates significant revenue through the sale of Microsoft Office licenses. ○ Advantages for Users: Closed source software often comes with dedicated support and regular updates from the developer. It is generally perceived as being more polished and user-friendly, as the development process is controlled and guided by a single entity. Translators
  • A translator is a program that converts high-level source code into low-level object code, which is then ready to be executed by a computer.
  • There are three types of translator that convert different types of code and work in different ways

1) Compiler

  • Compilers translate high-level code into machine code all at once, after carrying out a number of checks and reporting back any errors.
  • This initial compilation process is longer than using an interpreter or an assembler.
  • If changes need to be made, the whole program must be recompiled, Once code has been compiled to produce machine code, it can only be executed on
  • Each line of assembly code is equivalent to almost one line of machine code so code is translated on almost a one-to-one basis. **QUESTIONS:
  1. Define the three main types of translators used in computer systems: compilers, interpreters, and assemblers. What is the primary function of each?** Compilers: Translate the entire high-level source code into machine code before execution. The output is an executable file that can be run independently of the source code. Interpreters:Translate and execute high-level code line-by-line at runtime. They do not produce an independent executable file and must retranslate the code each time it is run. Assemblers: Translate assembly language code into machine code. Each assembly language instruction corresponds to a specific machine code instruction. 2) Explain the role of assembly language in low-level programming. How does an assembler convert assembly code into machine code?

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.

Bytecode

● 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.

Stages of Compilation

The compilation process includes several stages:

  1. Lexical Analysis
  2. Syntax Analysis
  3. **Code Generation and Optimisation Here is a detailed summary of the content on the pages you provided, covering the stages of compilation, symbol table, syntax and semantic analysis, code generation and optimisation, linkers and loaders, and library usage. This summary is structured for your A-Level OCR Computer Science revision and aims to provide clarity on each concept. Stages of Compilation The compilation process includes several stages:
  4. Lexical Analysis
  5. Syntax Analysis**

3. Code Generation and Optimisation

1. Lexical Analysis

Purpose: The first stage of compilation, which prepares the source code by breaking it down

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

Definition : A data structure used to store information about variables, constants, and

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.

2) High-Level Language

● Definition : An imperative high-level language is closer to human language and

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.