21
IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Embed Size (px)

Citation preview

Page 1: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

IT253: Computer Organization

Lecture 10:Making a Processor:

Control Signals

Tonga Institute of Higher Education

Page 2: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Control of a Processor

• We have already looked at how to build the datapath of the processer.

• The datapath will provide a way to execute instructions and for data to travel inside the processor

• We also need a way to control what happens, for example: – What instructions that are fetched?– What ALU operations?– What Registers to use?– Other smaller control signals?

• Our goal is to find the signals needed to perform some operations

Page 3: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Instruction Fetching• The first step in executing an instruction is to fetch it from

memory.• It will be the same for all instructions. • We need an Instruction Fetch Unit to accomplish this

Page 4: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Single Cycle Datapath for Adding• With the instruction fetch unit made, we can look

at the what signals we need to use to control the processor for adding

Page 5: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Instruction Fetch at end of Add• How does the Instruction Fetch Unit

change after an add operation?

Page 6: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Datapath signals for Or Immediate

• How does the datapath signals, or the control, change when we do a function with an immediate value?

Page 7: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

The Datapath during Load

Page 8: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Datapath during Branch

Page 9: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Instruction Fetch and Branching• The instruction fetch unit needs extra circuits to

perform branching

Page 10: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Control Signals Table• We can summarize all the control signals in one

nice table.

Page 11: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Local Decoding• How does the processor know how to use these

signals? • It uses an process called "local decoding."• There is hardware that can determine what to do with

the right control signals

ALUop is usually two or three bits. It will be the code that determines what operation is happening (add, and, or, not). The func field helps choose between adding and subtracting. If you remember, add and sub use the same code, but just have an extra inverter for the subtract

Page 12: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Truth table for main control

• Just like the truth table for the ALUctr, we can make a truth table for all the control signals needed to perform any function

• This truth table is for the main control.

• It is complicated and requires you to study

Page 13: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Truth table for main control

Page 14: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Main Control Circuit Design

Page 15: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

We have a truth table, how does this help?

• We have a truth table for all the values that the processor needs to make things happen.

• We need to remember that once we have a truth table we can make circuits and gates that implement the truth table.

• We can make a big circuit that will decode any signal and that will implement functions needed to make a processor run

Page 16: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

ALUctr Truth Table

• How does ALUctr get set? • We can actually make a truth table that tells

what ALUctr will be.• Remember ALUctr are the 3 bits that

determines what function the ALU will do. • So there needs to be a lot of different controls

because there are many functions• We need to be careful of the difference

between the add used in a load word instruction and the add used to add two number together

Page 17: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

ALUctr Truth Table

Page 18: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Putting the pieces together

• If you can believe it, or understand it, we have built all the parts needed to make a single cycle processor

• Single-cycle, of course, means that it can only do one instruction per clock cycle.

• This chapter gave us the Main Control, the instruction fetch unit and the ALU control.

• Now we can put these circuits with the pieces we made in the last chapter and get the whole CPU

Page 19: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

A Single-Cycle processor

Page 20: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Problems with a Single Cycle Processor

• We have made a processor, even though it’s a simple processor.

• The ones that Intel makes are much more complicated

• The single cycle processor has a few drawbacks. That means there are things that make it so no one would want it in real life

• The biggest problem is that the processor needs to wait until an instruction is finished before it can start a new one

• Another problem is that it can only do one instruction at a time. Some instructions are very long to do (for example load word) and they make the overall system slower

Page 21: IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education

Summary• This concludes our section about

processors. • You should feel good about

yourselves, because hopefully you understand how a processor actually works.

• In theory, if you really wanted to, you could build a processor on your own. And it would be really, really slow.