entire comp sci flashcards
main job cpu
The Fetch-Decode-Execute cycle is the main job of the CPU.
instructions in fde cycle
In a program, each machine code instruction takes up a slot in the main memory. These memory locations each have a unique memory address. The program counter stores the address of each instruction and tells the CPU in what order they should be executed.
what does cpu do to execute program
To execute a program, the program code is copied from secondary storage into the main memory. The CPU’s program counter is set to the memory location where the first instruction in the program has been stored, and execution begins.
process of fde
The CPU checks the program counter to see the next instruction to execute.
The program counter gives a memory address to where the next instruction is
The CPU fetches the instruction from this memory address
The instruction is decoded and executed.
The program counter increments by 1
The cycle is repeated indefinitely
job alu
Arithmetic calculations
Logical operations
Comparisons between values
job cu
The control unit organises the fetch decode execute cycle, including managing the other components in the processor.
also controls flow of data inside and outside cpu
registers
Small amounts of high-speed memory in the CPU used to store small amounts of data needed for processing
Includes the address of the current instruction, the next instruction to be executed, and the results of calculations
job cache
A small amount of high-speed memory physically inside the CPU.
Temporarily holds small amounts of data which the CPU will reuse often.
Speeds up the system - does not have to wait for some data in memory to be fetched
Level 1, 2, 3 cache - 1 is the fastest, most expensive, and has the lowest amount of storage, likewise, 3 is the slowest, least expensive but contains the most amount of storage
what does von neumann arch state
Data and instructions are stored as binary
Data and instructions are both stored in primary storage
Instructions are fetched from memory one at a time and in order
The processor decodes and executes an instruction, and then does the same for the next instruction
This will continue until there are no more instructions
5 registers in von neumann arch
the program counter (PC)
the memory address register (MAR)
the memory data register (MDR)
the current instruction register (CIR)
the accumulator
program counter
the program counter (PC) holds the memory address of the next instruction to be fetched from primary storage
mar
the memory address register (MAR) holds memory address about to be used by CPU
cir
the current instruction register (CIR) holds the instruction that is currently being decoded and executed
mdr
the memory data register (MDR) holds data/instruction fetched from memory, or data about to be written to memory (primary)
accumulator
the accumulator (ACC) is a special purpose register and is used by the arithmetic logic unit (ALU) to hold the data being processed and the results of its calculations
clock spd
The clock speed is measured in gigahertz (GHz) and represents how many fetch-decode-execute cycles happen per second. 1 GHz = 1 billion cycles.
too highclock spd
However, a CPU which cannot keep up with its clock will corrupt its data. A very fast clock speed will cause the CPU to overheat and thermal throttle, reducing its performance to stop it from melting
why cache is there
Transferring data in and out of memory takes much longer than from cache. Therefore, placing frequently accessed data in the cache results in everything using that function being executed much faster. The more cache there is, the more data can be stored closer to the CPU.
l1 l2 l3 cache
L1 is usually part of the CPU chip and is both the smallest and the fastest to access. L2 and L3 caches are bigger than L1. They are extra caches built between the CPU and the RAM. Sometimes L2 is built into the CPU with L1.
L2 and L3 caches take slightly longer to access than L1.
cons of cache
However, cache is very expensive (L1 costs ~£1 per kilobyte), is limited by the space of the CPU, and is very small, so cannot be a full replacement for memory.
num cores
A CPU has multiple cores on it. CPUs with multiple cores have more power to run multiple programs at the same time.
However, doubling cores does not double clock speed. Some headroom is needed to communicate between each core.
embedded system
An embedded system is a small computer inside of a larger system.
Embedded systems have one specific function which they run.
prim storge
Primary storage consists of RAM (random access memory) and ROM (read-only memory).
general process comps
General process computers are designed to access the Internet, play games, play videos, and write programs. These all require applications to run. Tablets, phones and consoles are now increasingly classed as general process, as they now can run several applications.