Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.

Similar presentations


Presentation on theme: "CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson."— Presentation transcript:

1 CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson & Hennessy, ©2005 Some slides and/or pictures in the following are adapted from: slides ©2008 UCB 18

2

3 What about overflow? Highest adder –C in, but no C out  A,B both > 0, overflow! –C out, but no C in  A,B both < 0, overflow! –C in, C out  no overflow! –no C in, no C out  no overflow! What op?

4 What are the values of the control lines and what operations do they correspond to?

5 Speed of Ripple Carry The carry propagates through every 1-bit box: each 1-bit box sequentially implements AND and OR – total delay is the time to go through 64 gates!

6 Faster Addition: Carry Lookahead Key to speeding up addition is determining the carry into the high-order bits sooner –We’ve already seen that any logic equation can be expressed as the sum of products – so it should be possible to compute the result by going through only 2 gates! (IN CLASS)

7 Faster Addition: Carry Lookahead Caveat: need many parallel gates and each gate may have a very large number of inputs – it is difficult to efficiently build such large gates, so we find a compromise: – moderate number of gates – moderate number of inputs to each gate – moderate number of sequential gates traversed

8 Processor Computer Control Datapath Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display, Printer Disk (where programs, data live when not running) Five Components of a Computer

9 Processor (CPU): the active part of the computer, which does all the work (data manipulation and decision-making) –Datapath: portion of the processor which contains hardware necessary to perform operations required by the processor (the brawn) –Control: portion of the processor (also in hardware) which tells the datapath what needs to be done (the brain) The CPU

10 Our implementation of the MIPS is simplified –memory-reference instructions: lw, sw –arithmetic-logical instructions: add, sub, and, or, slt –control flow instructions: beq, j Generic implementation –use the program counter (PC) to supply the instruction address and fetch the instruction from memory (and update the PC) –decode the instruction (and read registers) –execute the instruction All instructions (except j ) use the ALU after reading the registers Fetch PC = PC+4 DecodeExec

11 Fetching Instructions Fetching instructions involves –reading the instruction from the Instruction Memory –updating the PC to hold the address of the next instruction –PC is updated every cycle, so it does not need an explicit write control signal –Instruction Memory is read every cycle, so it doesn’t need an explicit read control signal Read Address Instruction Memory Add PC 4

12 Decoding Instructions Decoding instructions involves –sending the fetched instruction’s opcode and function field bits to the control unit –reading two values from the Register File Register File addresses are contained in the instruction Instruction Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 Control Unit

13 Executing R Format Operations R format operations ( add,sub,slt,and,or ) –perform the (op and funct) operation on values in rs and rt –store the result back into the Register File (into location rd) –The Register File is not written every cycle (e.g. sw ), so we need an explicit write control signal for the Register File R-type: 3125201550 oprsrtrdfunctshamt 10 Instruction Write Data Read Addr 1 Read Addr 2 Write Addr Register File Read Data 1 Read Data 2 ALU overflow zero ALU controlRegWrite


Download ppt "CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson."

Similar presentations


Ads by Google