You tap Send Money on your phone, type 1,000 and press Confirm. Your balance was 4,350 taka. Within a fraction of a second the processor takes 4,350, subtracts 1,000, and asks one question about the answer: is it below zero? If it is, the screen says the balance is not enough. If not, the program carries on and shows 3,350.
Look at what just happened. One part of the processor did the subtraction. It left a small note about the result, negative or not. Another part read that note and decided which instruction should run next. And a third thing, easy to forget, made it possible at all: before the subtraction the balance had to travel from memory into a register, the ALU had to be told to subtract and not to add, and afterwards the answer had to travel back. Somebody opened and closed those roads, in the right order, tick by tick.
This chapter opens the processor and looks at all of it. The calculator is the ALU, with its twin for decimal-point numbers, the FPU. The roads that carry values between registers, the ALU and memory are the datapath. The somebody who opens and closes the roads is the control unit. We meet the calculators first, then the roads inside a small CPU, then the datapath of a whole simple processor in its one-clock and many-clock forms, and finally the two ways of building the control unit.
By the end you will be able to describe what goes into and out of an ALU, set and read its flags, and choose the jump that matches signed or unsigned numbers. You will explain how the FPU adds and multiplies. You will write the register transfers of an instruction on a one-bus and a three-bus CPU. You will draw the single-cycle datapath, say what each multiplexer chooses, and compare it with the multi-cycle datapath by counting ticks. And you will explain hardwired and microprogrammed control, define control word and microinstruction, and work out how wide a microinstruction must be.