computer orgnization rabie a. ramadan lecture 6. datapath

26
Computer Orgnization Rabie A. Ramadan Lecture 6

Upload: cornelius-wilkins

Post on 05-Jan-2016

226 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Computer Orgnization

Rabie A. Ramadan

Lecture 6

Page 2: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

DataPath

Page 3: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Execute Simple Arithmetic Operation

Show the steps executing the following instruction on One-Bus , Two-Bus, and Three-Bus Organizations:

Add R1, R2, R0

(Add R1 to R2 and save the results in R0)

Page 4: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

One-Bus Organization

Add R1, R2, R0

Page 5: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer

Page 6: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Two-Bus Organization

Add R1, R2, R0

Page 7: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer

Page 8: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Two-Bus Organization

Add R1, R2, R0

Page 9: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer

Page 10: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Three-Bus Organization

Add R1, R2, R0

Page 11: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer

Page 12: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

CPU INSTRUCTION CYCLE

Get the instruction from the memory Increment the PC Decode the Instruction Execute it during execution is there any interrupt (ex. Keyboard input)? Handling the interrupt or continue executing the instruction is left to the code designer

Page 13: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Interrupt Handling

Interrupt• An asynchronous signal from hardware indicating the need for

attention.

• A synchronous event in software indicating the need for a change in execution

Ex. • Input from the Keyboard

• Incoming message from the network card

Page 14: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

How the control unit can manage to execute such instructions?

Page 15: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Control Unit

Page 16: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Control Unit Controls the flow of data

• CPU and external units (memory, I/O)

Control Bus

• Carry the signal between the control unit and other components.

Decoder

• Decode the instruction (Op-code)

Page 17: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Control Unit Clock Signal

• Used to synchronize instructions execution

Control Signal Generator • Controlled by :

• Decoder signal

• Enabled time signal

• Other inputs (eg. Interrupt signal)

Page 18: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Put All Together

Page 19: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Example

Using one-Bus organization, show the control sequence needed to execute the following instruction:

Add R1, R2, R0

Page 20: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer

Page 21: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Answer (Cont.) Control Unit Signals

Page 22: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Types of Control Units Microprogrammed

• Flexible

• Can be reprogrammed with new instructions using microprogram • Microprogram

• Program stored in memory that generates all the control signals required to execute the instruction set correctly

Wired• Inflexible

• Once the control unit of a hard-wired computer is designed and built, it is virtually impossible to alter its architecture and instruction set.

Page 23: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Hardwired Control Unit

Needs logic circuit designer

Input A Input B Output Q

0 0 0

0 1 1

1 0 1

1 1 1

Input A Input B Output Q

0 0 1

0 1 1

1 0 1

1 1 0

Page 24: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

Example Design a control unit that has 3 instruction sets

inst-x, inst-y, inst-z and A,B,C,D,E,F and G control lines The lines that have to be activitied based on the time signals are :

(e.g. if t0 =1 and inst-x =1 lines D,B, E must equal 1 )

A,B,…..,F

Page 25: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

The Design

A= inst-x.t1 + inst-z.t1 = t1.(inst-x+inst-z)

B = inst-x.t0 + inst-y.t2

C = inst-x . t1 + inst-x. t2 + inst-y.t2 + inst-z. t1 = t1. (inst-x + inst-z) + (inst-x + inst-y). t2 = A + (inst-x + inst-y). t2 E =...

Page 26: Computer Orgnization Rabie A. Ramadan Lecture 6. DataPath

The Final Design