1 / 34

Computer Architecture & Operations I

Instructor: Yaohang Li. Computer Architecture & Operations I. Review. Last Class 2’s Complement Addition and Subtraction This Class 1-bit ALU 32-bit ALU Fast Carry Lookahead Assignment 3 Next Class Computer Clock. Arithmetic Logic Unit. Arithmetic Logic Unit (ALU) Heart of a CPU

jamese
Télécharger la présentation

Computer Architecture & Operations I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Instructor: Yaohang Li Computer Architecture & Operations I

  2. Review • Last Class • 2’s Complement • Addition and Subtraction • This Class • 1-bit ALU • 32-bit ALU • Fast Carry Lookahead • Assignment 3 • Next Class • Computer Clock

  3. Arithmetic Logic Unit • Arithmetic Logic Unit (ALU) • Heart of a CPU • Operations • Arithmetic operations • Addition • Subtraction • Logical operations • NOT • AND • OR

  4. 1-bit Logical Unit for AND and OR • 1-bit logical unit for AND and OR

  5. 1-bit adder

  6. 1-bit adder truth table

  7. Simplifying 1-bit adder • If a and b and CarryIn are true, then the three other terms are true as well can be simplified as • Values when CarryOut is true

  8. Logic of CarryOut Bit

  9. Logic of Sum Bit

  10. Overall 1-bit ALU

  11. 32-bit ALU

  12. Subtraction • Subtraction can be done by adding a and b’s negate and 1

  13. NOR • Ainvert =1, Binvert =1, Operation =00

  14. Set on less than • Set on less than (slt) • For comparison of two integers a and b • Least significant bit • 1 if a < b • 0 otherwise • Other bits • 0

  15. Set on less than

  16. Handling Overflow

  17. 32-bit ALU • Bit 0-30: normal 1-bit ALU • Bit 31: 1-bit ALU with overflow detection

  18. Final 32-bit ALU • Bnegate • Every time we want the ALU to subtract, we set both CarryIn and Binvert to 1 • Otherwise, both CarryIn and Binvert are set to 0 • NOR operation: Binvert is 1, but CarryIn is Don’t Care • We can combine CarryIn and Binvert to a single line of Bnegate

  19. Test of Zero • We want to quickly test if two integers are equal • Design a single signal of Zero

  20. Final 32-bit ALU

  21. ALU Control Signals

  22. Symbol of ALU

  23. Faster Addition • Carry Lookahead • Speeding up addition • Determining the carry in to the high-order bits sooner • Key mechanism • Hardware executes in parallel

  24. Explanation of Carry Lookahead • Try to remember CarryOuti+1=CarryIni • Abbreviation of ci for CarryIni • Then c2 can be evaluated faster without waiting for c1 • How about c30? • Grows rapidly with the number of bits • Very complex

  25. Fast Carry Using the First Level of Abstraction • Consider • Generate (gi) and Propagate (pi) • Then

  26. Generates and Propagates • Why gi is called generate? • when gi is 1 • ci+1 is “generated” • Why pi is called propagate? • when gi is 0 and pi is 1 • ci+1 is “propagated” from ci

  27. 4-bit CarryIn

  28. A Plumbing Analog • Wrenches open and close valves • ci+1 will be full • if the nearest generate value gi is on • or pi is on there is water further upstream • c0 can result in a carry out without the help of any generates but the help of all propagates

  29. Second Level of Abstraction • Super Propagate • Super Generate • Carryin for 16-bit adder

  30. Four 4-bit ALUs with Carry Lookahead to form a 16-bit adder

  31. Example of Fast Carry Lookahead • Consider adding two 16-bit integers a and b • generate gi=ai·bi and propagate pi=ai+bi • Super generate and Super Propagate

  32. Example of Fast Carry Lookahead (cont.) • Finally • How many “steps”? • step 1: produce generate and propagate • step 2: produce super generate and super propagate • step 3: produce carryout • much faster than adder without fast carry lookahead

  33. Summary • 1-bit ALU • Logic Functions • Arithmetic Functions • 32-bit ALU • Set on less than • Test of Zero • Fast Carry Look ahead

  34. What I want you to do • Review Appendix C • Work on your assignment 3

More Related