4.6 - Fundamentals of data representation Flashcards
What are hardware and software and what is the relationship between them?
Hardware - the physical components that make up the computer
Software - programs that are run by the computer
Hardware needs software to run; software needs hardware to run on
Define ‘system software’.
Software that runs and manages the computer’s hardware and application programs eg. operating systems, utility programs and translators
Define ‘application software’ and outline the 3 types.
Software that allows the user to complete different tasks
Types:
General purpose
Special purpose
Bespoke
What is general purpose software?
Software that can be used for a variety of tasks e.g. word processors, presentation software
What is special-purpose software?
Software that can only be used for one particular task e.g. scientific calculator software - can only carry out calculations
What is bespoke software?
Software that is developed to meet the user’s specific requirements e.g. self-service touchscreen kiosks at fast food restaurants
Define ‘operating system’.
A collection of programs that controls the operation of computer hardware
What are the 5 functions of an operating system?
Processor management (processor scheduling) - determines the order in which processes will be executed, allowing for multi-tasking
Inputs, outputs, and interrupts (input/output device management) - ensures efficient communication with devices and manages functionality issues
Memory management - records how memory in the computer is divided and identified so that it is allocated efficiently between running processes
Secondary storage management - tracks where files and programs are stored, which parts are available for storage, and manages files and folders based on user permissions
Security - ensures that resources are protected from unauthorised access through the use of permissions and passwords
What are the 5 characteristics of low-level languages?
Machine-oriented/non-portable - defined by the processor they are designed to run
No built-in functions
Can access specific registers in the processor
A 1:1 relationship with processor instructions
Programs typically require less memory and execute faster than a high-level language program performing the same task
Define ‘opcode’ and ‘operand’.
Opcode - part of the instruction that specifies which operation the processor should perform
Operand - contains a value, or set of values, relevant to the opcode; can be an actual piece of data, or a reference to the memory location of the data for the opcode to act on
Define ‘immediate addressing’ and ‘direct addressing’.
Immediate - operand interpreted as a data value (01)
Direct - operand interpreted as a memory address (10)
What are the 2 advantages of low-level languages?
Allows programmers to:
- Create optimised programs
- More directly control how resources are used when they are limited
What are the 5 characteristics of high-level languages?
No 1:1 relationship with processor instructions - a single line of code can accomplish multiple tasks
Has to be translated into machine code for the computer to process
Offers development tools such as libraries and built-in functions
Problem-oriented rather thanmachine-oriented - typically designed to handle a particular problem
High levels of abstractions from the details of the computer - makes programming much more convenient and allows the programmer to write shorter, cleaner code
What are the 3 advantages of high-level languages?
Mucheasierto write programs in them - they use normal command words such asIF, ELSE AND FOR, so it is much easier for a human to make sense of the program
Portable - can be compiled or translated to run on a wide range of computer architectures; they are not specific to a particular instruction set
Libraries of functions - can be imported and used by the programmer, allowing them to take advantage ofpre-written code
Define ‘imperative language’.
A language used to write a list of instructions to solve a problem, where the programmer defines how the problem should be solved
Define ‘declarative language’.
A language used by the programmer to define what the problem to be solved is rather than how to solve the problem
Define ‘object-oriented language’.
A language that programmers use to define objects and classes that define the data and the instructions to manipulate it
How does a compiler translate code? (2 points)
Translates code into a form that can be executed but does not execute the code
Takes the source code as its set of instructions, which it then puts through a series of processes to produce executable code
What are the 3 advantages of using a compiler?
Produces executable code in a form that cannot be read by a human or readily reverse-engineered - advantageous to commercial developers who make money from their code
When the program has successfully compiled, the executable file will not need to be translated again (unless the source code is changed) - faster running times
User doesn’t need a translator (i.e. interpreter) to be installed on their computer as they will never need to translate the program themselves
What are the 2 disadvantages of using a compiler?
Any compilation errors are reported at the end of the compilation process
Compiled code can only be executedon a machine with the same processortype/instruction set
How does an interpreter translate code? (2 points)
Each program line, when run, is syntax-checked - program halts and reports errors it finds
Each line of source code is converted into its machine code equivalent and executed
What are the 3 advantages of using an interpreter?
Easier to debug during the testing stage of development - errors are reported and can be fixed when they occur
More portable - can be advantageous if the programmer does not know which platform will be used to run the code
Less memory than an executable file - only few lines of source code needed at any one time
What are the 3 disadvantages of using an interpreter?
Source code that is interpreted runs more slowly than compiled code - each time the program is run, it must be translated all over again
User must have the interpreter installed to be able to run the program
Doesn’t protect the source code