P2 T2 L10 - Processor performance and programming languages Flashcards
What are the factors affecting processor performance?
6 factors
- multiple cores
- cache memory
- clock speed
- word length
- address bus width
- data bus width
How do multiple cores affect processor performance?
2 points
- The ‘cores’ enable instructions to be fetched and executed.
- More cores means more instructions can be fetched and executed.
Most computer systems have _ processor(s), to speed up processing you could use _____ _____ __.
1
more than 1
For convenience multiple processors can be incorporated into 1 chip known as a _____-_____ processor.
multi-core
How does cache affect processor performance?
2 points
- The cache speeds up processing by storing frequently used data or instructions in its high-speed temporary memory.
- More cache means more instructions/data can be stored in this high speed memory.
What is clock speed? (1 point) and how does clock speed affect performance? (1 point)
- Clock speed indicates how fast each instruction will be executed.
- If you increase the clock speed you increase the speed at which the processor executes instructions.
What is word length?
1 point
- A word is a collection of bits that can be addressed and manipulated as a single unit.
If a system has a word length of 32 bits it indicates that 32 bits of data can be handled in each clock pulse, increasing this to 64 bits doubles the amount of ____ that can be handed at one time.
bits
Word length and bus width are closely linked as a 64 bit system needs ___ ___ ______.
64 bit buses.
What is bus width?
1 point
- the number of bits that can be sent down a bus in one go
Increasing the ________ _____ ________ increases the amount of memory which can be ________, meaning more ______ can be installed and utilised on the computer.
address bus width
addressed
memory
Increasing the ______ _____ _______ means more bits can be sent in each clock pulse, meaning more ______ can be processed within a given time frame.
data bus width
data
Give 3 factors that could affect the performance of your PC as a whole
- USB port speeds
- RAM
- Graphics card
Name 2 low level programming languages
- Machine code
2. Assembly code
(Machine code)
All instructions given to the computer must be in _____
As everything entered as ____ there is a high risks of making a mistake
____er to track down errors in the coding
Programs can be used directly by the processor so _______very quickly
Processor will do exactly what you want it to do
binary
bits
harder
execute
(Assembly code)
Write using ______
Assembly code is essentially machine code with ____
Number of _____ you can use is generally small
Each command translates directly into ______ machine code command
Needs to be converted into machine code with an _________
words (small strings)
words
words (instruction sets)
one
assembler
Give 3 ADVANTAGES of machine-code and assembly language programming compared with high-level language programming
- Can be executed quickly
- Program code is relatively compact
- Allows direct manipulation of registers on the processor, giving you more control
Give 3 DISADVANTAGES of machine-code and assembly language programming compared with high-level language programming
- High risks of making a mistake
- Harder to track down errors
- Can be harder to code in
Give 3 types of high level programming languages
- Imperative/procedural
- Declarative
- Object oriented
Imperative/procedural high level language, describe it. (4 things about it)
- You tell the computer exactly what to do, instruction by instruction
- Uses a series of commands to describe how a problem should be solved
- A program is built from one or more procedures (also known assubroutinesorfunctions)
- Uses variables, sequence, selection, iteration (FOR, WHILE, REPEAT), procedures
Declarative high level language, describe it. (3 things about it)
- Uses a series of facts and rules in a knowledge base
- The ‘program’ is an Inference Engine, which can backtrack, looks for a goal in the knowledge base
- Programmer states a problem but does not describe how the problem is solved
Object oriented high level language, describe it. (4 things about it)
- It is a modular approach (using objects like in Java)
- It is an attempt to simulate the real world by means of objects that have characteristics and functions
- Each object has its own methods (functions and procedures)
- Objects can inherit methods from other objects
(Low level language)
Assembly language code needs to be converted to machine code, this is carried out by an _________.
The ________ converts the _______ code to ______ code.
Based on one processor type so generally ___ portable
assembler
assembler
source
object
not
(High level language)
Two types of translator used, either a _______ or a _________.
Translators read a statement of code and immediately perform the action (may be line by line or one routine at a time)
Compilers convert the whole _______ code to _______ code before the program is executed
compiler interpreter
source object
(High level)
_______ – you can use the code on other machines
Can be ____ to compile if it is a large program
____ to check for errors
______ to code larger programs in
Portable
Slow
Easy
Easier
(Low level)
_________– usually written for a specific processor so can’t run it on other machines without mass errors
Very ______ to execute
_____ to check for errors
______ to write/more likely to make errors
Non-portable
quick
hard
harder