What is pipelining
Process of completing the fetch decide and execute cycle of three separate instructions separately, holding appropriate data in a buffer in close proximity to the CPU until its required
What is the aim of pipelining
Reduce the amount of time the CPU is kept idle
What is instruction pipelining
Separating out the instruction into fetching, decoding and executing
What is arithmetic pipelining
Breaking down the arithmetic operations and overlapping them as they are performed
What is a GPU
Graphics processing unit
Works with the CPU to increase the throughput of data and the number of concurrent calculations with an application
Co processor
Difference between a CPU and a GPU
GPUs have a massive parallel architecture
GPUs consists of thousands of smaller more efficient core designed for handling multiple tasks simultaneously
CPU consists of fewer cores and coordinates a wide range of tasks
Describe some real world uses for a GPU
Graphic design
CAD/CAM
CGI
Cryptography
Data science
AI and machine learning
What are the stages of compilation
Lexical analysis
Syntactic analysis
Code generation
What is each parse in the stages of compilation designed for
Designed to carry out tasks and prepare the code for the next parse
What tasks happen in lexical analysis
Uses a lexer to read source code character by character
Unneeded spaces removed
Comments removed
Symbol table made
What is a symbol table (stages of compilation)
Code is analysed with keywords, names of variables and constants.
These are replaced with tokens and information about the token, which is stored
What tasks happen in syntax analysis
Tokens received
Checks for correct syntax and flags errors (incomplete brackets and undeclared variables)
Semantic analysis to detect logic mistakes
Creates abstract syntax tree
What is an abstract syntax tree
Representation of the source code in the form of a tree that uses post order traversal
What happens in code generation
Final action of the compiler
Result of previous stages is stored as an object file
Variables and constants are allocated memory
What is code optimisation
Attempt to reduce execution time of the object program
Redundant parts of the code are detected and removed
Repeated sections of the code may be grouped together and replaced with more efficient code
Can increase compilation time and produce unexpected results
Leg) speed optimisation and memory optimisation
What is a library?
Ready compiled and tested programs that can be run when needed. They can be incorporated with static or dynamic links.
What are advantages of libraries
Easy to implement
Pre tested
Pre compiled and therefore optimised
Prevent programmers having to code commonly used functions
What are disadvantages of libraries
Making specific tweaks can be difficult or impossible
Trust developers will maintain them
Outputs may not match outputs you want
What is a loader
Part of the Os
Load executable program file into memory
Loads required libraries in dynamic linking
When a file is executed the loader retrieves the library or subroutine from the memory location
What are linkers
Piece of software responsible for linking external modules and libraries included within the code
Put an appropriate machine address in the external call and return instructions
Created a final executable file that contains all the source code
What is static linking
Library code is included directly to the machine code to create the executable file (large file size)
What is dynamic linking
Compiled version of libraries stored on host computer
Os links required code from library as program is running
If libraries change referencing should change
Addresses of modules and libraries are included
No need to rewrite code