Computer Structure Flashcards
Explain what a translator does.
A translator converts the high level program (source code) e.g python into binary (machine code).
Name the 2 diffrent types of translators
Interpreters and Compilers
Describe how an interpreter works
Interpreters translate the code line by line, if it find a error in the program it will stop running
Describe how a complier works
A compiler translates all of your high level code (source code) into machine code all at once
What is the advantage of using an interpreter
Errors are flagged after each line has been interpreted making debugging easier
What are the disadvantages of using an interpreter
Can be slow to run code as the processor needs to run the translator software and the interpreted code
You will always need the interpreter to run the code, which may not be good for software you wish to distribute.
Anyone can see (and copy!) your source code.
What are the advantages of using a complier
A program will run without needing translated any more which is good for distributing software.
A program will run much more quickly as the processor is not needing to translate the code any more.
Compiled code is difficult to reverse-engineer, so your competitors cannot just copy your source code!
What are the disadvantages of using a compiler
Debugging can be complex as errors are not reported immediately.
You will need to re-compile your code every time an error is found and corrected. This may take time with a long program.
Which type of translator is better for debugging/troubleshooting code
Interpreter
Which type of translator should be used prior to the release a program for sale
Complier
Give 2 reasons why it is benifical to compile program before release
Translator does not need to be
present to run the code
The program runs/executes faster as
it does not require further
translation
The compiled version of the program
requires less memory (RAM) to run.
It is difficult to reverse engineer the program
Name the 3 areas of the processor:
Arithmetic and Logic Unit;
Control unit;
Registers.
Describe the role of the Arithmetic and Logic Unit (ALU)
All calculations and logical decisions are handled by the ALU.
It performs all calculations
It performs comparisons on numeric values
It makes decisions based on logic (AND, OR, NOT)
Describe the role of the Control Unit (CU)
The control unit is responsible for coordinating all the activities happening in the computer that require some of the processors time. This includes:
- fetching instructions and data from the main memory;
- decoding instructions (sending them to the correct part of the processor);
- executing instructions;
- the clock signal to keep actions in time with each other;
- responding to peripherals sending/receiving data.
Which part of the processor performs all calculations
It performs comparisons on numeric values
It makes decisions based on logic (AND, OR, NOT)
Arithmetic and Logic Unit (ALU)
Which part of the processor performs comparisons on numeric values
Arithmetic and Logic Unit (ALU)
Which part of the processor makes decisions based on logic (AND, OR, NOT)
Arithmetic and Logic Unit (ALU)
Which part of the processor is responsible for fetching instructions and data from the main memory;
Control Unit (CU)
Which part of the processor is responsible for decoding instructions (sending them to the correct part of the processor);
Control Unit (CU)
Which part of the processor is responsible for executing instructions
Control Unit (CU)
Which part of the processor is responsible for f the clock signal to keep actions in time with each other
Control Unit (CU)
Which part of the processor is responsible for responding to peripherals sending/receiving data.
Control Unit (CU)
Describe the registers
Registers are fast temporary storage locations on the processor, they store data, intructions or addresses being used by the CPU
Which part of the processor is a fast temporary storage location
The registers
Which part of the processor stores information going to be used buy the CPU
Registers
What part of the process stores instructions to be processed by the CPU
The registers
Describe Memory/RAM in a computer system
RAM is a block of storage locations connected to the processor by the data bus and address bus
It is used to store data, programs and the operating system
It is volatile meaning its contents are cleared when it has no power i.e. the computer is switched off
Describe how memory is organised so information can be easily be retrived
every storage location in memory, has a unique binary address that can be used when reading data
Describe memory is organised so a new data can be added
very storage location in memory, has a unique binary address that can be used when writing data
What is the role of the Buses in a computer system
Buses are used to allow communication to take place between the processor and memory
Name the 2 types of Buses
Data Bus and Address Bus
Describe the address bus
The address bus is uni-directional (one way) it tells memory which memory location is being read from/written to
Describe the Data Bus
The data bus is is bi-directional it carries data from memory to be used by the processor and carries data from the processor to be stored in memory
Explain why the address bus is uni-directional
The address bus is uni-directional(one way) because the address is always sent from the processor (by the CU) to memory
Explain why the data bus is bi-directional
Data travels in both directions, data is sent from the processor to memory and visa versa