4.6 Fundamentals of computer systems Updated Flashcards
What is meant by hardware
Hardware describes the electrical or electro-mechanical parts of a computer system
What are the functions of OS
processor management
user management
memory management
file management
device management
What are the two low level languages
Machine code
Assembly language
Describe assembly code/language
Assembly language is a low-level programming language that uses human-readable mnemonics instead of binary machine code.
What is meant by software
Software comprises all of the programs that make the computer function
Explain what is meant by system software
Software used in the management of a computer system
What is meant by application software
computer programs designed to perform specific tasks for users.
What is the purpose of an OS ( 2)
To hide the complexities of the hardware from the user (i.e. provide a virtual machine)
Manages the hardware (resources) including the allocation of hardware resources (to processes)
What is utility software / utility programs
Utility software is software that performs a non-core, ancillary function for a computer
What are three examples of utility software
Defragment a disk
install/uninstall software
Virus checkers
Automatic backup and restore
File compression software
What is a library program
A library program is a collection of pre-compiled routines that can be used by other programs
What is machine code (2)
Machine code is a computer programming language consisting of binary or hexadecimal instructions
which a computer can respond to directly.
What is a translator
A translator is used to translate code written in assembly language or other high level code into machine-code
What are the three types of translators
Assembler
Compiler
Interpreter
What does an assembler do
translate assembly language into machine code
What does an interpreter do
An interpreter is a type of program that translates and executes code line by line rather than compiling the entire code at once. It converts high-level programming languages into machine code
What does a compiler do
translate high-level language programs into object code (machine code) which can be saved and run whenever needed, without the compiler having to be present (executable file)
What is general purpose software
General purpose softwares can be used for a range of generic tasks
What is special purpose software
Special-purpose software performs tasks for a single, specific job
What is off the shelf software (2)
Off-the-shelf software is software that can be purchased by lots of different customers -
they are all purchasing the same piece of specialised software
What is bespoke software
Bespoke software is software that has been developed by programmers specifically for a particular customer to meet their exact needs and requirements
What are the benefits and drawbacks of off the shelf software
Off-the-shelf software is readily available for anyone to use
The cost is usually lower because development costs are shared among all the buyers
You have little or no control over what features there are
It may not do exactly what you want
Definition of an API (2)
An application programming interface (API) is a way for two or more computer programs to communicate with each other.
It is a type of software interface, offering a service to other pieces of software.
What is the OS responsible for (4)
allocating processors to processes
allocating memory/RAM to processes
allocating I/O devices (input and output devices) to processes
allocating space on storage devices to files
What is meant by the scheduler
The scheduler is the operating system module responsible for ensuring that processor time is used as efficiently as possible
How does the OS control RAM (2)
The OS allocates memory to processes and moves data into and out of RAM
The OS ensures processes can only write to memory that they have been allocated
How does the OS carry out IO device managment (3)
Allocate I/O devices to processes
manages communication between processes and I/O devices
carrys out automatic installation of drivers for new I/O devices
How does the OS manage storage on a computer system (2)
The OS keeps track of where all files are stored on hard disk or external drives,
and where space is free to be used if the user performs a save operation
What two things does machine code consist of
In machine code, a typical instruction holds an operation code (opcode) in the first few bits
and an operand in the rest of the bits
What is meant by an instruction set of a computer
The instruction set of a computer is all the instructions that it can understand and execute
What is assembly language
is a low-level programming language that is a human-readable representation of machine code
What were the two major improvements made with assembly language
Each opcode was replaced by a mnemonic which gave a clue as to what the operation did
The operand was replaced by a decimal (or hexadecimal) number
Advantages and disadvantages of assembly language compared to machine code
It is much easier to write, understand and debug programs in assembly language
The assembly code has to be translated into machine code by an assembler
Advantages of using high level languages as opposed to low level(4)
Easier to read, write, and understand
Faster to write and debug due to simpler syntax
Provides abstraction from hardware details
Code runs on multiple platforms with little or no modification
What is meant by a low level language
A language that is close to the hardware
Advantages of low level languages (4)
Assembly language enables close manipulating of bits
Executes very quickly
Uses less memory than a comparable HLL version
To maintain historic coding
What is the difference between imperative and declarative high level language
An imperative high-level language consists of commands for the computer to perform
This is in contrast to a declarative language which focuses on what the program should do without listing the steps needed to achieve the result (eg SQL)
Explain why an intermediate language is produced at the final output by some compilers and how it is used
Instead of compiling directly to machine code (which is CPU-specific), the compiler generates an intermediate representation that can run on multiple architectures. Such as bytecode
What is meant by a imperative high level language
Imperative:
Instructions are executed in a programmer defined sequence
Instructions specify how to solve the problem
Executed line by line
HLL:
A language that uses English-like/more meaningful keywords
How are HLL easier to maintain and understand? (3)
HLL allows several machine code statements to be replaced by one high level statement
HLL program expressed in language that is human-oriented
Able to use meaningful identifier names
How is assembly code translated (3)
Assembly language is translated into machine code by a program called an assembler
Typically, one assembly code instruction is translated into one machine code instruction
Each type of processor has its own assembly code and assembler program
What is source code and object code in the context of an assembler (4)
The assembly code program is the input to the assembler
This is known as the source code
The output is the machine code instructions produced by the assembler, called the object code
The object code can be saved and run whenever needed
Why use assembly code and what are some of its uses (4)
Assembly code is used when a program needs to execute as fast as possible, occupy as little space as possible or manipulate individual bits and bytes
Typical uses include embedded systems, real-time systems, sensors, mobile phones, device drivers and interrupt handlers
Difference between assembly code and assembly language
There is none, they are interchangeable
Can every hardware platform use the same compiler explain your answer
No
Different hardware platforms need different compilers to translate the source code into the machine code that the computer understands
What are the the three different stages of the compilation process
lexical analysis, syntactic analysis, and semantic analysis, going through the whole program at each stage
Advantages of a compiler
The object code runs faster than interpreted code
The object code is more secure, as machine code cannot easily be read and copied by someone wishing to modify the code and sell it as their own product
Describe the operations of an interpreter (5)
Interpreter analyses program on a line-by-line basis
Interpreter calls subroutines within its own code to carry out commands
Interpreter translates/executes program until first error is encountered
Interpreter translates a program each time it is executed
Interpreter executes each line immediately after translating it
What is bytecode
Some compilers such as the Java compiler compile the source code into an intermediate form known as bytecode
What is different from bytecode and source code
The bytecode file is portable,
because each computer that can run Java has a JVM or Java Virtual Machine (which is itself a program)
that understands bytecode and converts it into the machine code required for that particular computer
What is the difference between source code
and object (executable) code.
source code: Human-readable code written by a programmer using a high-level language
object code: Machine-readable binary code generated by a compiler
How is bytecode translated into machine code (5)
Additional software is used to finish the translation process (on the computer running the program)
This is done by a virtual machine or a just-in-time (JIT) compiler
The virtual machine will translate the bytecode by calling functions within its own code to carry out the command
Each processor will have its own virtual machine
The JIT compiler compiles the bytecode into machine code for the processor it is being executed on
Why use bytecode (4)
Enables processor independence and enhances code portability.
only needs to Compile source code once; bytecode runs on multiple platforms.
Generates bytecode for a standardized virtual machine.
Virtual machine ensures security through pre-execution checks.
Describe the symbol for the OR Gate and its boolean notation
A curved shape similar to a rocket
A + B
Describe the symbol for the AND Gate and its boolean notation
A D-shaped symbol with a flat input side and a rounded output side.
A.B
Describe the symbol for the XOR Gate and its boolean notation
Similar to the OR gate but with an extra curved line on the input side.
Circle with a plus inside it
Describe the symbol for the NOT Gate and its boolean notation
A small triangle with a circle at the output.
A’
Describe the symbol for the NAND Gate
Similar to an AND gate but with a small circle (inversion bubble) on the output.
Describe the symbol for the NOR Gate
Similar to an OR gate but with a small circle at the output.
Advantages of NAND gates
Using only NAND gates to build a circuit can minimise cost of production
Using as few gates as possible can speed up processing
Describe DE morgans law
NOT A AND NOT B = NOT( A OR B)
Describe DE morgans 2nd law
Inverse of the first law
NOT( A OR B) = NOT A AND NOT B
Simplify X . 0
0
Simplify X . 1
X
Simplifty X.NOTX
0
What is the commutative law
States that
X.Y = Y.X
AND
Y + X = Y + X
What is the associative law
States that
X.(Y.Z) = Z.(X.Y)
What is the distributive law
States that
X.(Y+Z) = X.Y + X.Z
What is the absorption law
States that
X + (X.Y) = X
What is the order of precedence for booelan algebra
1-5
Brackets
NOT
XOR
AND
OR
What is a half adder and its boolean expression for the carry and sum
A half-adder is a circuit that performs the addition
of two bits
The Boolean expressions for a half adder are:
S=A⊕B (XOR gate)
C=A⋅B (AND gate)
What is a full adder
A combination of two half adders
What is a flip flop
A flip flop is an elemental sequential logic circuit that can store one bit and flip between two states, 0 and 1
What is a d type flip flop (2)
A D-type flip flop has one input called D, and two outputs Q and NOT Q
It also has a Clock signal input
Why is the clock needed in a d type flip flop
A clock is needed to synchronise the change of state of flip flop circuits
What are the uses of d type flip flops (3)
D-type flip-flops are used for creating registers and counters
They are used for the intermediate storage needed during arithmetic operations
Static RAM is also created using D-type flip-flops
Application software is made up of what two types of software
Special purpose
General purpose
Traits of low level languages (4)
hardware can be instructed directly
code is made from mnemonics
programmer works with the memory directly
one instruction translates to one machine code instruction
Describe how an operating system provides a platform for multi-tasking.
programs are loaded from secondary storage into memory
programs are held in a queue by the operating system
program at the front of the queue runs its code
the program stops running and is moved to the back of the queue
next program runs its code
cycle continues with new programs joining the back of the queue
multi-tasking is only possible if there is enough RAM to hold more than one program in memory at once
lexical analysis, syntactic analysis, and semantic analysis, What is meant by each of these
Lexical :This is the first stage of processing source code, where the program text is converted into meaningful symbols
syntactic: This stage checks if the sequence of symbols follows the grammatical rules of the programming language.
Semantic: This stage ensures that the program has meaningful logic and adheres to language rules beyond syntax.