3.6 computer systems Flashcards
hardware
electronic/mechanical components of a computer system
software
instructions / programs / code
software categories
application software
system software > operating systems - utility programs - library programs - translators
application software
carrying out specific tasks that are user-oriented / perform a function for the end-user
examples of application software
word processors, image editors, internet browsers, email clients
system software
controls/manages the operation of the system, required to operate a computer
operating system
controls computer’s hardware + software resources, allows software to interact with hardware - hides the complexities of the hardware
tasks of an operating system
- resource management
- processor scheduling
- memory management
- i/o management
- provision of a user interface / hiding complexities of the hardware from the user
resources that the os manages
- processors
- memory
- i/o devices
processor scheduling
determining order in which processes executed, allows for multi-tasking
utility programs
- analyse, configure, optimise or maintain a computer system
- perform additional common tasks needed by users
examples of utility programs
compression software, disk defrag software, anti-malware software, backup software, disk utilities, file repair, file manager
disk utilities
- management of secondary storage devices, such as hdd, ssd
- disk defrag software is an example of this utility
library programs
collection of pre-compiled routines that can be used across many programs, eg. math, random, turtle etc in python
virtual memory (VM)
- area on disk that is used as RAM if RAM insufficent to hold all data / instructions in a running process
- data copied from RAM to disk, while next block of data/code is loaded from VM
- allows many processes to be running at once, but noticeably slows down PC
why is VM less common
RAM cheaper and systems have more RAM than they did a decade ago
multitasking
execution of more than 1 task simultaneously, cpu processes only 1 task at a time but switches between processes so fast that it appears to be processing multiple processes at same time
multiprocessing
more than one processor being used, different parts of a task may be distribute among processors in separate CPUs, or a CPU may have 2+ processors
translators
software which translates between languages, includes compilers, assemblers and interpreters
machine code
- binary
- directly manipulates computer’s processor
mc cons
- very long + difficult to code
- prone to errors + difficult to debug
mc pros
- very powerful
- no constraints when coding
- no need to translate before execution so useful for embedded systems + real-time applications
assembly language
- mnemonics used in place of opcodes
- operands replaced by decimal or hex number
al pros
- more compact than mc
- less error prone
- easier to write and understand
why may a programmer write in al over high-level lang?
- no interpreter/compiler for the processors (as bespoke/new, also interpreter increases mem requirements)
- al requires less memory
- platform dependence not relevant (code specific to type of device)
al and mc
each al instruction has 1-to-1 correlation to mc instruction
operand
the quantity on which an operation is to be done. can be either an actual value or address in memory where value is held
opcode
instruction
operation
what instruction does
instruction set
all instructions that computer can understand + execute. if each instruction held in 8 bits, 4 bits for opcode, 4 bits for operand, computer can execute 16 different instructions
assembly lang con
must be translated into machine code via assembler
when is assembly code generally used?
when program needs to:
- execute asap
- occupy little space
- manipulate indiv bits/bytes
examples of uses of assembly code
include embedded systems, real-time systems, sensors, mobile phones, device drivers and interrupt handlers
high-level language platforms
not platform specific, must be translated into mc by a compiler/interpreter
high-level lang pros
- much easier to write/read/debug programs as features like indentation + named variables involved
- portability
- come with libraries of functions to be imported and used by programmer
portability (low-level)
- mc produced by a compiler for platform a cannot be run by platform b
- implementing software on diff platforms means recompiling source code
portability (high-level)
- can be compiled/translated to run on wide range of computer architectures
- not specific to particular instruction set
cons of high-level langs
- object code may run slower than mc or al
- may occupy more space in RAM, can be a problem in embedded systems with small amt memory
- mostly cannot manipulate individual bits (essential in some programs, like device drivers)
assemblers
AL to MC
- 1-to-1 correspondence > translation quick + straightforward
- platform specific > assembler specific to processor instruction set
- convert source code into object code
compilers
high-level to MC
- produces object code/mc > platform specific
- translates whole source code at once > compiler will not produce an executable file if error encountered
- do not need compiler or source code to execute compiled program > protects sc from extraction
interpreters
high-level to MC
- does not produce object code
- analyses source code line by line, will run program up until first error > useful in development
- executes slower than object code produce by compiler
- interpreter + source code always need to be present > more portable, not protected from extraction
intermediate languages
some compilers translate source code into an intermediate language (usually bytecode)
why are intermediate languages (ie bytecode) used
allows for platform independence / portability - target platform may not be known
how are bytecode programs executed after bytecode produced
virtual machine performs just in time compilation to convert bytecode to object code and execute it
example of assembly language
SUB1: ADD NUM1 * test subroutines
——— JSR SUB2
——— RTN
SUB2: ADD NUM1
——— JSR SUB3
——— RTN
SUB3: ADD NUM1
——— JSR SUB4
——— RTN
SUB4: ADD NUM1
——— RTN
START: LDA NUM1
———- JSR SUB1
———- STA NUM2
———- HLT
NUM1: 7
NUM2: 0