|
|
||
| You are here: | ||
|
3.2 Structure of the CPU
TIP: It's probably easier to memorize the CPU diagram and its annotations than all this text.
The cycle starts when the first program instruction is loaded into memory. After the instruction is fetched the CIR (program counter is incremented) decoding and executing the instruction may involve changing the program counter (a branch to another location). It may also involve transferring data between memory and accumulator. Not every instruction results in a store operation. There will be a special exit instruction indicating the end of the program has been reached. FE Cycle Demo |
On this page: [ the CPU | bits/bytes | storage terms | machine instruction cycle ] related: [ primary & secondary memory | microprocessor | peripherals | recent developments ] The Central Processing Unit - CPU In some texts the CPU only consists of the Control Unit (CU) and Arithmetic and Logic Unit (ALU) but in the IB description it is apparent that the primary memory (IAS or Immediate Access Store) and buses are also included. The CU and ALU form a single integrated circuit known as a microprocessor. They contain various registers, as described below.
The immediate access store contains instructions and data; these instructions are passed to the control unit via buses . Buses also carry data between primary memory and the the ALU. A bus is simply a collection of wires and is usually an even number of bytes ( see below). The main types of bus are the address bus and the data bus. In many designs there is a control bus which tells the data bus which way it is moving data (from primary store to ALU or vice versa). When a microprocessor is described as operating at 1500 MHz, for example, this means that 1500 million instructions can be carried out by the microprocessor in a second. The control unit decodes the program instructions and sends control signals to other parts of the computer. The arithmetic and logic unit makes logical comparisons and performs calculations. The smallest unit of storage in memory or on disc is the bit (symbol b) and this can store a zero or a one (or equivalent states anyway). The most common unit is 8 bits combined into a byte (symbol B):
Standard SI units use prefixes for size such as m for milli (as in mm or millimetre) and k for thousand (as in km or 1000 metres). The prefixes are:
Modern computers have masses of memory and disc space to store bytes of data and this is therefore measured in larger units as shown below:
Notice that the storage units are not in 1000's but in 1024's and this is because computer storage is measured in units of 2 10 (1024). A typical pc hard disc of 40 GB or so can thus store the equivalent of 42,949,672,960 characters, say about 5 billion words or 25 million pages of data. Words , registers and addresses A word is the number of units of memory that a CPU typically handles in one go. Typical sizes are 32, 64 or 128 bits. A register is a small amount of computer memory that can typically hold 1 word of data. Memory consists of a sequence of addresses, each one identified by a unique binary code, the number of bits allocated to the address determines the total number of address locations the CPU can address. As we have seen the CPU consists of the microprocessor and the Immediate Access Store (IAS). The microprocessor in turn consists of the Control Unit (CU) and the Arithmetic and Logic Unit (ALU). Inside the CU are two important registers the Current Instruction Register (CIR) and the Sequence Control Register (SCR or program counter). Inside the ALU is another important register known as the accumulator . These registers are important in the execution of a stored computer program. An additional register, the interrupt register is used to store information about processes waiting to catch the attention of the CPU. A typical CPU has many more registers than those described here but those are all you need to know about for the IB program. The Machine Instructional Cycle Sometimes known as the Fetch-Execute, Fetch-Execute-Decode or even the Fetch-Execute-Decode-Store cycle, it describes the main steps to be taken in the execution of machine language instructions and operates as follows:
Just before the next instruction in the cycle is loaded into memory, a special register called the interrupt register is examined to see if more important processes need the attention of the CPU. The next page deals with the structure of the IAS. related: [ Common core home | next: memories ] |
|
|
|
|||
|
Questions or problems related to this web site should be addressed to Richard Jones who asserts his right to be identified as the author and owner of these materials - unless otherwise indicated. Please feel free to use the material presented here and to create links to it for non-commercial purposes; an acknowledgement of the source is required by the Creative Commons licence. Use of materials from this site is conditional upon your having read the additional terms of use on the about page and the Creative Commons Licence. View privacy policy. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. © 2001 - 2009 Richard Jones, PO BOX 246, Cambridge, New Zealand; This page was last modified: May 31, 2009 |