Radford ITEC 352 - Principles of Computer Architecture

Unformatted text preview:

Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 3: ArithmeticChapter ContentsComputer ArithmeticNumber Circle for 3-Bit Two’s Complement NumbersOverflowRipple Carry AdderConstructing Larger AddersFull SubtractorRipple-Borrow SubtractorCombined Adder/SubtractorOne’s Complement AdditionNumber Circle (Revisited)End-Around Carry for FractionsMultiplication ExampleA Serial MultiplierExample of Multiplication Using Serial MultiplierExample of Base 2 DivisionSerial DividerDivision Example Using Serial DividerMultiplication of Signed IntegersCarry-Lookahead AdditionCarry Lookahead AdderFloating Point ArithmeticFloating Point Multiplication/DivisionThe Booth AlgorithmA Worst Case Booth ExampleBit-Pair Recoding (Modified Booth Algorithm)Coding of Bit PairsParallel Pipelined Array MultiplierNewton’s Iteration for Zero FindingResidue ArithmeticExamples of Addition and Multiplication in the Residue Number System16-bit Group Carry Lookahead Adder16-Bit Group Carry Lookahead AdderHP 9100 Series Desktop CalculatorAddition Example Using BCDSubtraction Example Using BCDExcess 3 Encoding of BCD DigitsA BCD Full AdderTen’s Complement SubtractionBCD Floating Point RepresentationBCD Floating Point Arithmetic16-bit Group Carry Lookahead Adder3-1Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer ArchitectureMiles Murdocca and Vincent HeuringChapter 3: Arithmetic3-2Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Chapter Contents3.1 Overview3.2 Fixed Point Addition and Subtraction3.3 Fixed Point Multiplication and Division3.4 Floating Point Arithmetic3.5 High Performance Arithmetic3.6 Case Study: Calculator Arithmetic Using Binary Coded Decimal3-3Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Computer Arithmetic• Using number representations from Chapter 2, we will explore four basic arithmetic operations: addition, subtraction, multiplication, division. • Significant issues include: fixed point vs. floating point arithmetic, overflow and underflow, handling of signed numbers, and performance.• We look first at fixed point arithmetic, and then at floating point arithmetic.3-4Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Number Circle for 3-Bit Two’sComplement Numbers• Numbers can be added or subtracted by traversing the number circle clockwise for addition and counterclockwise for subtraction. • Overflow occurs when a transition is made from +3 to -4 while proceeding around the number circle when adding, or from -4 to +3 while subtracting.3-5Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Overflow• Overflow occurs when adding two positive numbers produces a negative result, or when adding two negative numbers produces a positive result. Adding operands of unlike signs never produces an overflow. • Notice that discarding the carry out of the most significant bit during two’s complement addition is a normal occurrence, and does not by itself indicate overflow.• As an example of overflow, consider adding (80 + 80 = 160)10, which produces a result of -9610in an 8-bit two’s complement format:01010000 = 80+ 01010000 = 80----------10100000 = -96 (not 160 because the sign bit is 1.)3-6Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Ripple Carry Adder• Two binary numbers A and B are added from right to left, creating a sum and a carry at the outputs of each full adder foreach bit position.3-7Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Constructing Larger Adders• A 16-bit adder can be made up of a cascade of four 4-bit ripple-carry adders.3-8Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Full Subtractor• Truth table and schematic symbol for a ripple-borrow subtractor:3-9Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Ripple-Borrow Subtractor• A ripple-borrow subtractor can be composed of a cascade of full subtractors.• Two binary numbers A and B are subtracted from right to left, creating a difference and a borrow at the outputs of each full subtractor for each bit position.3-10Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Combined Adder/Subtractor• A single ripple-carry adder can perform both addition and subtraction, by forming the two’s complement negative for B when subtracting. (Note that +1 is added at c0for two’s complement.)3-11Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization One’s Complement Addition• An example of one’s complement integer addition with an end-around carry:• An example of one’s complement integer addition with an end-around carry:3-12Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Number Circle (Revisited)• Number circle for a three-bit signed one’s complement representation. Notice the two representations for 0.3-13Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization End-Around Carry for Fractions• The end-around carry complicates one’s complement addition for non-integers, and is generally not used for this situation.• The issue is that the distance between the two representations of 0 is 1.0, whereas the rightmost fraction position is less than 1.3-14Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization Multiplication Example• Multiplication of two 4-bit unsigned binary integers produces an 8-bit result.• Multiplication of two 4-bit signed binary integers produces only a 7-bit result (each operand reduces to a sign bit and a 3-bit magnitude for each operand, producing a sign-bit and a 6-bit result).3-15Chapter 3 - ArithmeticDepartment of Information Technology, Radford University ITEC 352 Computer Organization A Serial Multiplier3-16Chapter 3 - ArithmeticDepartment of Information Technology,


View Full Document

Radford ITEC 352 - Principles of Computer Architecture

Download Principles of Computer Architecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Principles of Computer Architecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Principles of Computer Architecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?