Lecture 3 Flashcards
What is a machine instruction?
Machine instruction: An instruction (or command) encoded as a bit pattern recognizable by the CPU.
What is machine code?
Machine code is the only code that the processor understands and is:
Written in 1s and 0s (binary)
Very hard for humans to understand
Very hard to spot mistakes and to make changes
Specific to a processor
why will most programmers use a high level language to write their code ?
Written in English-like language
Easy to learn
Easy to understand, make changes and spot mistakes
Can be transferred between different types of computer
BUT processors do not understand high level languages
To solve the problem of processors not understanding high level languages, a program called a translator is used.
What is a translator?
A translator is used to convert a high level language into machine code (low level language).
What is an interpreter?
Translates one line at a time
Gives accurate error messages where the error occurs
Easier to spot/edit mistakes
BUT every time code is run you must use the interpreter
What is a compiler?
Compiles whole code in one go therefore faster than interpreter
Only needs to be compiled once and produces object code
Can be harder to spot/edit mistakes
Interpreter vs Compiler?
An interpreter is used for program development as it is easier to debug and partially test the code. Once the program is error free and complete, the program should then be compiled, as compiling only needs to be done once.
The 3 features of the Machine Cycle
Fetch
Decode
Execute
Describe the machine cycle?
1) Retrieve the next instruction from memory(as indicated by the PC) and then increment the PC
2) Decode the bit pattern in the instruction register
3) Perform the action required by the instruction in the instruction register
Types of communication?
Parallel Communication: Several communication paths transfer bits simultaneously.
Serial Communication: Bits are transferred one after the other over a single communication path.
Data communication rates?
Measurement units Bps: Bits per second Kbps: Kilo-bps (1,000 bps) Mbps: Mega-bps (1,000,000 bps) Gbps: Giga-bps (1,000,000,000 bps) Bandwidth: Maximum available rate
What is pipelining?
Pipelining: Overlap steps of the machine cycle
What is parallel Processing?
Parallel Processing: Use multiple processors simultaneously (I: instruction, D: data)
SISD: No parallel processing
MIMD: Different programs, different data
SIMD: Same program, different data