1 / 7

Addition and Subtraction with Signed-Magnitude Data (Mano, Section 10-2)

Addition and Subtraction with Signed-Magnitude Data (Mano, Section 10-2). Basics Seminar, CSc 8215 High Performance Computing (2005 Fall) Mary R. Hudachek-Buswell. Sign-magnitude number.

Télécharger la présentation

Addition and Subtraction with Signed-Magnitude Data (Mano, Section 10-2)

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. Addition and Subtraction with Signed-Magnitude Data (Mano, Section 10-2) Basics Seminar, CSc 8215 High Performance Computing (2005 Fall) Mary R. Hudachek-Buswell

  2. Sign-magnitude number A sign-magnitude number Z can be represented as (As, A) where As is the sign of Z and A is the magnitude of Z. The leftmost position, As, is the sign bit. The sign bit is either positive = 0 or negative = 1

  3. Eight Conditions for Signed-Magnitude Addition/Subtraction

  4. Example of adding two magnitudes when the result is the sign of both operands: +3 0 011 + +2 0 010 +5 0 101 Examples -3 1 011 + +2 0 010 -( +3 011 - +2) 010 - 1 1 001 Example of adding two magnitudes when the result is the sign of the larger magnitude:

  5. Start Subtraction Start Addition Bs = Bs’ As = Bs A > B Ar = A + B Ars = As A = B Ar = A – B Ars = As Ar = 0 Ars = 0 Done Flowchart of Addition and Subtraction with Signed-Magnitude Data Ar = B – A Ars = Bs

  6. The signs use an exclusive OR gate where if the output is 0, then the signs are the same. Hence, add the magnitudes of the same signed numbers. If the sum is an overflow, then a carry is stored in E where E = 1 and transferred to the flip-flop AVF, add-overflow. Otherwise, the signs are opposite and subtraction is initiated and stored in A. No overflow can occur with subtraction so the AVF is cleared. If E = 1, then A > B. However, if A = 0, then A = B and the sign is made positive. If E = 0, then A < B and sign for A is complemented. Summary of Addition and Subtraction with Signed-Magnitude Data

  7. Addition and Subtraction with Signed-Magnitude Data Hardware Design B register Bs Mode Control Complementer AVF M Parallel Adder E Input Carry Output Carry S A register As Load Sum

More Related