Binary addition binary multiplication
This presentation is the property of its rightful owner.
Sponsored Links
1 / 26

Binary Addition Binary Multiplication PowerPoint PPT Presentation


  • 168 Views
  • Uploaded on
  • Presentation posted in: General

Binary Addition Binary Multiplication. Section 4.5 and 4.7 . Topics. Calculations Examples Signed Binary Number Unsigned Binary Number Hardware Implementation Overflow Condition Multiplication. Unsigned Number. (2-bit example). Unsigned Addition. 1+2=. Unsigned Addition. 1+3=.

Download Presentation

Binary Addition Binary Multiplication

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Binary addition binary multiplication

Binary AdditionBinary Multiplication

Section 4.5 and 4.7


Topics

Topics

  • Calculations Examples

    • Signed Binary Number

    • Unsigned Binary Number

  • Hardware Implementation

  • Overflow Condition

  • Multiplication


Unsigned number

Unsigned Number

(2-bit example)


Unsigned addition

Unsigned Addition

  • 1+2=


Unsigned addition1

Unsigned Addition

  • 1+3=

(Indicates Overflow)

(Carry Out)


Unsigned subtraction 1

Unsigned Subtraction (1)

  • 1-2=

(1’s complement)

(2’s complement)


Unsigned subtraction 2

Unsigned Subtraction (2)

  • 2-1=


Summary for unsigned addition subtraction

Summary for Unsigned Addition/Subtraction

  • Overflow can be an issue in unsigned addition

  • Unsigned Subtraction (M-N)

    • If M≥N, and end carry will be produced. The end carry is discarded.

    • If M<N,

      • Take the 2’s complement of the sum

      • Place a negative sign in front


Signed binary numbers

Signed Binary Numbers

  • 4-bit binary number

    • 1 bit is used as a signed bit

    • -8 to +7

    • 2’s complement


Signed addition 70 80

Signed Addition (70+80)

(Indicates a negative number)

70=21+22+26=2+4+64

80=24+26=16+64

10010110→01101001 →01101010

21+23+25+26=2+8+32+64=106

10010110↔-106

010010110

010010110↔ 21+22+24+27=2+4+16+128=150

Conclusion: There is a problem of overflow

Fix: Use the end carry as the sign bit, and let b7 be

the extra bit.


Signed subtraction 70 80

Signed Subtraction (70-80)

(Indicates a negative number)

70=21+22+26=2+4+64

80=24+26=16+64

11110110→00001001 →00001010

21+23=10

11110110↔-10

(No Problem)


Signed subtraction 70 801

Signed Subtraction (-70-80)

(Indicates a positive number! A negative number expected.)

70=21+22+26=2+4+64

80=24+26=16+64

101101010 →010010101 → 010010110

010010110 ↔21+22+24+27=2+4+16+128=150

101101010 ↔-150

Conclusion: There is a problem of overflow

Fix: Use the end carry as the sign bit, and let b7 be

the extra bit.


Observations

Observations

  • Given the similarity between addition and subtraction, same hardware can be used.

  • Overflow is an issue that needs to be addressed in the hardware implementation

  • A signed number is not processed any different from an unsigned number. The programmer must interpret the results of addition and subtraction appropriately.


Four bit adder subtractor

Four-Bit Adder-Subtractor


The mode input 1

The Mode Input (1)

If M=0, =

If M=1, =

B0


The mode input 2

The Mode Input (2)

If M=0,

If M=1,


Binary addition binary multiplication

M=0

B3

B2

B0

B1

0


Binary addition binary multiplication

M=1

1

2’s complement is generated of B is generated!


Unsigned addition2

Unsigned Addition

When two unsigned numbers are added,

an overflow is detected from the end carry.


Detect overflow in signed addition

Detect Overflow in Signed Addition

Observe

The cary into the sign bit

The carry out of the sign bit

If they are not equal,

they indicate an overflow.


Two bit binary multiplier

Two-Bit Binary Multiplier

(multiplicand)

(multiplier)


Binary addition binary multiplication

Use an AND gate to multiply A0 and B0


Hardware correlation

Hardware Correlation


A four bit adder

A Four-Bit Adder


Four bit by three bit binary multiplier

Four-bit by three-bit Binary Multiplier

S10=A0B1+A1B0

S11=A0B2+A1B1+C1

S12=A0B3+A1B2+C2

S13=0+A1B3+C3

(S1X, where 1 is the first 4-bit adder)


Four bit by three bit binary multiplier1

Four-bit by three-bit Binary Multiplier


  • Login