Information Technology Topic

The CPU: Control Unit and ALU

  1. Read notes
  2. Flashcards
  3. Quiz
  4. Confident

Study focus - 3 things

  1. The CPU (central processing unit, or processor) has two parts you must name: the control unit and the arithmetic-logic unit (ALU)
  2. The control unit directs the flow of operations and data and keeps order, while the ALU does the arithmetic and tests conditions (logic)
  3. Main memory is a separate part of the system: no processing happens in memory, because data is sent to the ALU, processed there and sent back

Visual notes

The CPU: control unit and ALU, with main memory
A block sketch. A large rounded box labelled CPU (the processor) contains two smaller boxes side by side. The left box is the Control unit, described as directing the work and keeping things in order. The right box is the ALU, described as doing arithmetic (plus, minus, times, divide) and logic (testing conditions). An arrow points from the control unit to the ALU. Below the CPU box, outside it, is a box labelled Main memory, which holds the program and data. A two-way arrow joins the CPU box and main memory, labelled instructions and data.

Inside the CPU the control unit directs and the ALU calculates and tests. Main memory sits outside the CPU and holds the program and data.

Section 1What the CPU is

The CPU (central processing unit) is the processor, often called the computer's 'brain'. It carries out the instructions that make up a program. A processor's speed tells you how quickly it carries out program instructions. In a microcomputer the CPU is a microprocessor: a CPU that fits on one small chip of silicon. In the syllabus, the CPU has two parts you must name: the control unit and the arithmetic-logic unit (ALU). Watch out: some older books, including the 1998 US Navy text this topic checks against, count main storage as a third section of the CPU. For CSEC, name control unit and ALU inside the CPU, and treat main memory as its own part.

Section 2The control unit

The control unit is the part that directs. It directs how operations and data move, keeps order in the computer and starts the execution of instructions. It reads each instruction of the program and uses it to switch the control lines that make the computer perform that operation. It decides how and when each operation takes place, and it starts the circuits that find the data in storage and move it to where it will be processed. Here's the trick: the control unit does not do the sums. Think of it as the teacher calling out 'now do this, now do that' while the class does the working.

Section 3The arithmetic-logic unit (ALU)

The ALU is the part that does the calculating. It carries out all the arithmetic: add, subtract, multiply and divide. Through its logic ability, the ALU also tests conditions and acts on the result. Is one number bigger than another? Are two values equal? This is how a program can decide that a mark of 52 is a pass. A school-level way to remember it: the control unit coordinates all activity in the CPU, and the ALU is where arithmetic calculations and logic operations are carried out.

Section 4How they work together

Programs are made of instructions. They move data, do arithmetic, do logic tests, or give commands to devices such as input and output units. Logic instructions are what let a computer choose between different paths in a program, based on the result of an earlier test. The control unit reads the instruction and starts the right circuits. Data travels from main memory to the ALU, is processed there, and the result goes back to main memory. Easy to mix up: no processing takes place in main memory itself. Memory holds the program and data, and the ALU does the working.

Section 5Following one instruction

Take the instruction 'add this item's price to the total' at a shop till in Mandeville. The control unit reads the instruction and starts the circuits that bring the price and the running total from memory to the ALU. The ALU adds them. The control unit then makes sure the new total is sent back to memory. Now take 'is the total at least the amount that earns a discount?' The ALU does the test, and its result decides which instruction the program follows next. In each case the control unit directs and the ALU calculates or tests.

Section 6Where the CPU fits in the cycle

Remember the four functions: input, processing, output and storage. The CPU is the part that carries out the processing function. Input devices send data in, main memory holds the program and the data being worked on, and the CPU works on it. Results then go out through output devices or to secondary storage. For CSEC, stay with functions: the control unit directs, the ALU calculates and tests.

Examples

A student is asked whether the control unit or the ALU does each job. Decide for each one. (a) Adding two prices together. (b) Keeping operations in the correct order. (c) Checking whether a mark is at least 50. (d) Starting the circuits that move data from storage to where it will be processed. (e) Multiplying hours worked by a rate of pay.

(a) ALU. Adding is arithmetic. (b) Control unit. It keeps order in the computer. (c) ALU. Testing a condition is the logic ability of the ALU. (d) Control unit. It starts the circuits that find data and move it. (e) ALU. Multiplying is arithmetic. Quick rule: if the job is directing or sequencing, it is the control unit. If it is calculating or testing, it is the ALU.

A small payroll program for a shop in Montego Bay has these steps: Step 1: Read the hours worked and the hourly rate. Step 2: Multiply the hours by the rate to get the pay. Step 3: If the pay is at least the tax threshold, take off tax. Step 4: Display the pay. (a) For steps 2 and 3, say what the ALU does. (b) For steps 1 to 4, say what the control unit does. (c) Explain why the program's data in main memory is not processed there.

(a) Step 2: the ALU does the arithmetic, multiplying hours by rate. Step 3: the ALU tests the condition 'pay at least the threshold'. If the test is true, the ALU also does the arithmetic of taking off the tax. (b) The control unit reads each instruction in order and starts the right circuits. In step 1 it starts the circuits that bring the values in and place them in memory. In steps 2 and 3 it starts the circuits that move the data to the ALU and the result back. In step 4 it sends the pay to the display. It also uses the result of the logic test to decide whether the tax step is carried out. (c) Main memory only holds the program and the data. Data is moved to the ALU, processed there, and moved back. No processing takes place in the memory itself.

Now let's water it

Session runs notes to flashcards to quiz back-to-back.

Where this comes from