computer orgnization rabie a. ramadan lecture 6. datapath

Post on 05-Jan-2016

229 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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)

One-Bus Organization

Add R1, R2, R0

Answer

Two-Bus Organization

Add R1, R2, R0

Answer

Two-Bus Organization

Add R1, R2, R0

Answer

Three-Bus Organization

Add R1, R2, R0

Answer

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

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

How the control unit can manage to execute such instructions?

Control Unit

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)

Control Unit Clock Signal

• Used to synchronize instructions execution

Control Signal Generator • Controlled by :

• Decoder signal

• Enabled time signal

• Other inputs (eg. Interrupt signal)

Put All Together

Example

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

Add R1, R2, R0

Answer

Answer (Cont.) Control Unit Signals

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.

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

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

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 =...

The Final Design

top related