Computer Orgnization Rabie A Ramadan Lecture 6 Data
Computer Orgnization Rabie A. Ramadan Lecture 6
Data. Path
Execute Simple Arithmetic Operation l Show the steps executing the following instruction on One-Bus , Two-Bus, and Three-Bus Organizations: Add R 1, R 2, R 0 (Add R 1 to R 2 and save the results in R 0) l
One-Bus Organization l Add R 1, R 2, R 0
Answer
Two-Bus Organization l Add R 1, R 2, R 0
Answer
Two-Bus Organization l Add R 1, R 2, R 0
Answer
Three-Bus Organization l Add R 1, R 2, R 0
Answer
CPU INSTRUCTION CYCLE l l l 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 l Interrupt • An asynchronous signal from hardware indicating • l 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
l How the control unit can manage to execute such instructions?
Control Unit
Control Unit l Controls the flow of data • CPU and external units (memory, I/O) l Control Bus • Carry the signal between the control unit and other components. l Decoder • Decode the instruction (Op-code)
Control Unit l Clock Signal • Used to synchronize instructions execution l Control Signal Generator • Controlled by : • Decoder signal • Enabled time signal • Other inputs (eg. Interrupt signal)
Put All Together
Example l l Using one-Bus organization, show the control sequence needed to execute the following instruction: Add R 1, R 2, R 0
Answer
Answer (Cont. ) l Control Unit Signals
Types of Control Units l l 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 l Needs logic circuit designer Input A Input B Output Q 0 0 1 1 0 1 1 1
Example l l 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 t 0 =1 and inst-x =1 lines D, B, E must equal 1 ) A, B, …. . , F
The Design l A= inst-x. t 1 + inst-z. t 1 = t 1. (inst-x+inst-z) l B = inst-x. t 0 + inst-y. t 2 l C = inst-x. t 1 + inst-x. t 2 + inst-y. t 2 + inst-z. t 1 = t 1. (inst-x + inst-z) + (inst-x + inst-y). t 2 = A + (inst-x + inst-y). t 2 E =. . . l l l
The Final Design
- Slides: 26