Hardware and Communication Flashcards
What is the role of the Control Unit?
=> Coordinates all activities of the CPU.
=> Directs flow of data between the CPU and other devices (including memory).
=> Accepts the next instruction, decodes it, handles the execution, and stores the resulting data back in memory or registers.
=> Send memory read and memory write requests to main memory on the control bus as well as other command and control signals such as bus requests, bus grants, interrupt requests etc.
=> Makes extensive use of status register and clock.
=> Coordinates and communicates with all parts of the CPU.
What is the role of the Status Register?
=> Contains information about the state of the processor.
=> Individual bits are implicitly or explicitly read and/or written by the machine code instructions executing on the processor.
=> These bits can be thought of as “flags” which are set on and off as appropriate.
=> These flags can be checked at any point.
What is the role of the clock?
=> The “clock” is the electronic unit that synchronises related components by generating pulses at a constant rate.
=> Measured in Hertz.
=> The clock speed is the frequency at which the internal clock generates pulses.
=> The higher the clock rate, the faster the computer may work.
What is the role of the Arithmetic Logic Unit?
=> Performs arithmetic and logical operations on data.
=> Arithmetic operations on fixed and floating point numbers: ADD, SUBTRACT, MULTIPLY, DIVIDE.
=> Bite-wise shift operations left and right.
=> Boolean Logic Operations: Comparison, AND, OR, NOT, XOR.
=> Often uses general purpose registers to temporarily hold the results of calculations.
What is the purpose of General Purpose Registers?
=> Tiny areas of extremely fast memory located in the processor
=> Normally designed for a specific purpose.
=> Data or control information is often stored here temporarily.
=> A CPU may have many general purpose registers for storing temporary data while instructions/calculations are being carried out.
=> Typically the more general purpose registers a processor has, the faster it may operate.
What is the purpose of a Program Counter?
=> Holds the address of the next instruction to be executed.
=> E.g., the next instruction in a sequence of instructions or, if the current instruction is a command to jump or branch, it would be the address to which to jump. This would be copied from the current instruction register.
=> Has a very close relationship with the memory address register. At the start of every new F-D-E cycle the address held in the PC is copied to the MAR.
What is the purpose of the Memory Address Register?
=> Holds the addresses of memory locations from which data or instructions are to be fetched, or to which data is to be written.
=> Sends these addresses to memory down the address bus.
What is the purpose of the Memory Buffer Register?
=> Used to temporarily store the data which is read-from or written-to memory.
=> Sometimes known as the Memory Data Register (MDR) and often nicknamed the “Gateway to the processor”.
=> All data to and from memory must travel down the data bus and pass through the MBR.
What is the purpose of the Current Instruction Register?
=> Holds the current instruction being executed.
=> The contents of the MBR are copied to the CIR if it is an instruction.
=> Contains the operator + operand(s) of the current instruction.
=> Instruction = operator + operand(s).
=> E.g., a machine language instruction to load the contents of location 1000 into the ALU might look something like: LDA 1000.
What is the role of the Accumulator?
=> Used by any instruction that performs a calculation
=> Many instructions operate on, or update, the accumulator (ACC)
=> Calculations take a step-by-step approach, so the result of the last calculation is part of the next calculation
=> In a certain computer system, a set instruction may use the ACC as part of the calculation
=> Only one value needs to be given in the data part of the instruction
Describe a CPU with Von Neumann Architecture.
=> Shared memory space for instructions and data.
=> Instructions and data are stored in the same format.
=> A single control unit or processor follows a linear fetch, decode, execute cycle.
=> One instruction at a time.
=> Registers are used as fast access to instructions and data.
Describe a CPU with Harvard Architecture.
=> Instructions and data stored in separate memory units.
=> Both data and instructions have their own buses.
=> Reading and writing data can be done at the same time as fetching an instruction.
=> Used by RISC processors.
What is the Von Neumann Bottleneck?
Time and clock cycles are wasted because the speed mismatch between the processor and the memory.
How can the problem of the Von Neumann Bottleneck be overcome?
By using cache memory which acts as the ‘middle man’ between the processor and the memory.
How does cache memory operate within a CPU?
=> Data and instructions that are used regularly are copied into the cache memory, so that when the processor needs this information it can be retrieved much faster than if it were stored in RAM.
=> The processor always tries to load data from the cache, and in the event that the data is not in cache memory, the data is instead copied from RAM.
=> If cache memory is full, the least used data is discarded and replaced with new data.
How is it ensured that the most regularly accessed data is stored in cache memory?
=> Many algorithms can be used.
=> Programs tend to spend a lot of their time spent in a loop of some description, meaning that a lot of their execution time will be spent working on the same instructions.
=> 80/20 rule; states that 80% of a program’s execution time is spent in only 20% of the code, and proves to be fairly accurate in most cases.
What is a cache miss?
When a processor requests data that is not in the cache.