2.1.1 Outline the architecture of the central processing unit (CPU) and the functions of the arithmetic logic unit (ALU) and the control unit (CU) and the registers within the CPU.
A computer is a machine that takes in, stores, transforms and displays data.
Data is normally in binary form and is processed according to program instructions
Computer Systems consist of hardware and software components that follows the concept of input, process, output and storage model.
A computer
Accepts data or instructions as input from an input device
Data or instructions are stored and processed by the computer system
It may be the case that other data or instructions, apart from the input, are necessary during processing.
The computer outputs the processed data into information that we can see and use using an output device
Von Neumann was the first to propose that both instructions and data should be stored in the same memory address space.
Memory Unit - holds both data and instructions
Processing Unit:
arithmetic/logic unit (ALU) - performs arithmetic and logic operations on data
control unit - acts as the stage manager to ensure that all the other components act in concert
I/O Mechanisms
Input unit - moves data from the outside world into the computer
Output unit - moves results from inside the computer to the outside world
Storage
Contains:
Arithmetic Logic Unit (ALU)
Control Unit (CU)
Memory Address Register (MAR)
Memory Data Register (MDR)
Figure 1.2 CPU Block Diagram
part of the processor that performs the arithmetic and logic operations (e.g. comparisons and arithmetic operations.)
specific operations:
Arithmetic operations: including bit addition and negation of binary numbers.
Logical operations: including AND, OR, NOT, XOR, NOR, NAND, etc.
Bit-shifting operations: shifting the positions of the bits by a certain number of places to the right or left.
part of processor which coordinates all activities in processor and all other parts within a computer;
obtains the data/instructions from the memory;
interprets/decodes them into commands/steps/signals;
controls transfer of data and instructions among other units of a CPU (for example, command to ALU for execution);
manages/coordinates all the units of the computer;
Contains various registers;
A register in general is a small storage location that can hold data;
Usually a multiple of 8 bits;
A 64 bit computer has 64 bit registers:
The size of the register in bytes is known its as a word;
A 64 bit register holds 64 bits = 8 * 8 bits, and since 1 byte is equal to 8 bits
64 bits = 8 bytes
A 64 bit computer system has a word size of 8 bytes
So each memory location will hold 64 bits or 8 bytes
The CU is made up of flip-flops, logic gates, digital circuits and encoder and decoder circuits that are wired in a specific and fixed way.
Thus changes cannot be made to the instruction set.
This type of control only has a small number of instructions with each being executed on a single clock cycle.
Are widely used in mobile devices because they produce less heat.
Reduced Instruction Set Computing (RISC) architecture.
Are stored in a special control memory on the CPU.
Each instruction executes a microprogram.
This takes several clock cycles but allows for a larger set of more complex instructions.
Complex Instruction Set Computing (CISC) architecture.
are fast stand-alone storage locations that hold data temporarily.
a small set of data memory that is a part of a CPU itself.
provides temporary storage for operands and results.
can be accessed quickly by the CPU when performing operations, without having to access main memory (a much slower operation).
may hold a computer instruction, a storage address, or any kind of data (a bit sequence or individual characters).
Holds the memory address of the data to be used by the ALU, so that the ALU can fetch the corresponding content from the memory and process it accordingly.
MAR is connected to the address bus
MAR is how the CPU communicates with the address bus
MAR can hold either an instruction address or a data address
used to temporarily store data that will be written to main memory, or has been retrieved from the memory location in the MAR.
MDR is connected to the data bus
Connection between the MDR and RAM is accomplished by the Data Bus
Data can go in both to and from memory
MDR can load its data from:
The data bus (for reading data)
One of the CPU registers (for storing data)
A register in the processor unit in which partial calculations are stored by the ALU. Without an ACC, it would be necessary to write the result of each calculation to main memory.
Stores instructions to be executed
Keeps track of the instruction currently being executed. After execution of the instruction, the counter is incremented to point to the address of the next instruction in memory. It contains the memory of the next instruction to be executed.
Controls sequential instruction execution (through the PC - Program Counter);
Interprets instructions (through the IR - Instruction Register);
Guides data flow through different computer areas (through the MAR and MDR);
Regulates and controls processor timing;
Sends and receives control signals from other computing devices;
Handles multiple tasks, such as fetching, decoding, execution handling and storing results.
Every computing device contains an internal clock that regulates the rate at which instructions are executed.
Also synchronizes the actions of all the various computer components.
Clock speed is the number of pulses per second generated by an oscillator that sets the tempo for the processor.
Indicates how fast the CPU can run.
Is measured in megahertz (mHz) or gigahertz (gHz) and corresponds with how many instruction cycles the CPU can deal with in a second.
A faster CPU uses more energy and creates more heat.
The motherboard is a circuit board that connects the CPU to the memory and all the other hardware.
The CPU sits on the motherboard, also called the logic board.
Buses are circuits on the motherboard that connect the CPU to other components.
There are many buses on the motherboard.
A bus moves instructions and data around the system.
The speed of a bus is measured in megahertz (mHz).
The faster the bus, the faster data is communicated.
The speed of the mother bus is defined by the bus speed.
Buses are limited by their width in bits. They are usually 8, 16, 32 or 64-bits wide.
The bus that connects the CPU to the main memory is called the Front-Side Bus (FSB). The FSB contains two types of buses:
This sends information about where data needs to go by sending an address to the memory. The address bus only sends data in one direction--from the CPU to RAM.
This sends data to the memory or receives data from the Memory.
Figure 1.3 - CPU, Memory and Buses Diagram
A CPU can contain one or more processing units.
Each unit is called a core.
A core contains an ALU, control unit and registers.
It is common for computers to have two (dual), four (quad), or even more cores.
CPUs with multiple cores have more power to run multiple programs at the same time.
However, doubling the number of cores will not necessarily double a computer’s speed.
CPU cores have to communicate with each other through channels. This uses up some of the extra speed.
Figure 1.4 CPU Cores