Lec15 Booth

download Lec15 Booth

of 40

Transcript of Lec15 Booth

  • 8/10/2019 Lec15 Booth

    1/40

    Booth encoding

    reduce amount of partial products for

    fast multiplication(Chap. 10)

    Lecture 15

  • 8/10/2019 Lec15 Booth

    2/40

    Core Problem reduce amount of partial products in multiplication

    *)

    +)

    partial products

  • 8/10/2019 Lec15 Booth

    3/40

  • 8/10/2019 Lec15 Booth

    4/40

    Question generate only twopartial products for this

    multiplication

    MD

    1 1 0 00 0 1 1*) MR

  • 8/10/2019 Lec15 Booth

    5/40

    In Class-Exercise (The Answer) generate only twopartial products for this

    multiplication

    MD

    1 1 0 00 0 1 1*) MR

    +MD+)

    -MD

  • 8/10/2019 Lec15 Booth

    6/40

    In Class-Exercise (The Answer) Q: the mathematical foundation?

    MD

    1 1 0 00 0 1 1*) MR

    +MD+)

    -MD

  • 8/10/2019 Lec15 Booth

    7/40

    Key idea of Booth encoding generate two partial products for each consecutive

    sequence of 1s in MR

    MD

    1 1 0 00 0 1 1*) MR

    +)

    +MD

    -MD

    1 1 0 00 0 0 1

    +MD

    -MD

  • 8/10/2019 Lec15 Booth

    8/40

    Key idea of Booth encoding generate two partial products for each consecutive

    sequence of 1s in MR

    MD

    1 1 0 00 0 1 1*) MR

    +)

    +MD

    -MD

    1 1 0 00 0 0 1

    +MD

    -MD

  • 8/10/2019 Lec15 Booth

    9/40

    How to implement the idea? its difficult to design a hardware to detect

    variable length of consecutive 1s

    => scan fixed number of bits (say 2 bits) in

    MR each time

  • 8/10/2019 Lec15 Booth

    10/40

    Deriving the Booth-2 encoding:

    the first trial

    an unsuccessful trial to identify the

    problem

  • 8/10/2019 Lec15 Booth

    11/40

    Goal of Booth-2 encoding

    generate only n/2 partial products for n-bitmultiplication

    *)

    +)

  • 8/10/2019 Lec15 Booth

    12/40

    A straight scheme

    generate a partial product per 2-bit of MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    13/40

    A straight scheme

    generate a partial product per 2-bit of MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    14/40

  • 8/10/2019 Lec15 Booth

    15/40

    A straight scheme

    generate a partial product per 2-bit of MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    16/40

  • 8/10/2019 Lec15 Booth

    17/40

    A straight scheme

    generate a partial product per 2-bit of MR

    *)

    +)

    2 bits

  • 8/10/2019 Lec15 Booth

    18/40

    Lets look for the encoding rule

    Its the MSB of a series of consecutive 1s

    *) 0 1

    +)

    +2MD

  • 8/10/2019 Lec15 Booth

    19/40

    Lets look for the encoding rule

    Its the LSB of a series of consecutive 1s

    *) 1 0

    +)

    -2MD

  • 8/10/2019 Lec15 Booth

    20/40

    Lets look for the encoding rule

    Q: What should I do?

    *) 1 1

    +)

    ???

  • 8/10/2019 Lec15 Booth

    21/40

    Lets look for the encoding rule

    You have to look for another bit in MR to determine

    *) 01 1

    +)

    -MD

  • 8/10/2019 Lec15 Booth

    22/40

    Lets look for the encoding rule

    You have to look for another bit in MR to determine

    *) 11 1

    +)

    0

  • 8/10/2019 Lec15 Booth

    23/40

    Lets look for the encoding rule

    Q: What should I do?

    *) 0 0

    +)

    ???

  • 8/10/2019 Lec15 Booth

    24/40

  • 8/10/2019 Lec15 Booth

    25/40

    Lets look for the encoding rule

    You have to look for another bit in MR to determine

    *) 10 0

    +)

    +MD

  • 8/10/2019 Lec15 Booth

    26/40

    Booth-2 encoding table

    the correct scheme

  • 8/10/2019 Lec15 Booth

    27/40

    Examining MR to generate

    partial product

    generate a partial product per 2-bit of MR

    but examine 3consecutive bits in MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    28/40

    Examining MR to generate

    partial product

    generate a partial product per 2-bit of MR

    but examine 3consecutive bits in MR

    *)

    +)

    0

  • 8/10/2019 Lec15 Booth

    29/40

  • 8/10/2019 Lec15 Booth

    30/40

    Examining MR to generate

    partial product

    generate a partial product per 2-bit of MR

    but examine 3consecutive bits in MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    31/40

    Examining MR to generate

    partial product

    generate a partial product per 2-bit of MR

    but examine 3consecutive bits in MR

    *)

    +)

  • 8/10/2019 Lec15 Booth

    32/40

  • 8/10/2019 Lec15 Booth

    33/40

    The Booth-2 encoding table

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 01 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD-MD

    -MD

    0

    MR[i+1:i-1] Partial Product

  • 8/10/2019 Lec15 Booth

    34/40

    Deriving the encoding table

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD

    -MD

    -MD

    0

    MR[i+1:i-1] Partial Product

    *) 10 1

    +)

    +2MD

    ending a series of consecutive ones

  • 8/10/2019 Lec15 Booth

    35/40

    Deriving the encoding table

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD

    -MD

    -MD

    0

    MR[i+1:i-1] Partial Product

    *) 01 1

    +)

    -MD

    beginning a series of consecutive ones

  • 8/10/2019 Lec15 Booth

    36/40

    In-Class Exercise (1)

    derive the remaining part of the table

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD

    -MD

    -MD

    0

    MR[i+1:i-1] Partial Product

  • 8/10/2019 Lec15 Booth

    37/40

    In-Class Exercise (2)

    apply Booth-2 encoding to generate partial products

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD

    -MD

    -MD

    0

    MR[i+1:i-1] Partial Product

    MD

    1 1 0 00 0 1 1*) MR1 1 0 00 0 0 1

  • 8/10/2019 Lec15 Booth

    38/40

    In-Class Exercise (3)

    apply Booth-2 encoding with actual number MD Q: How to deal with negative number?

    0 0 0

    0 0 1

    0 1 0

    0 1 1

    1 0 0

    1 0 1

    1 1 0

    1 1 1

    0

    MD

    MD

    2*MD

    -2*MD

    -MD

    -MD

    0

    MR[i+1:i-1] Partial Product

    MD

    1 1 0 00 0 1 1*) MR1 1 0 00 0 0 1

    1 1 0 00 1 0 0 0 1 0 01 0 1 1

  • 8/10/2019 Lec15 Booth

    39/40

    Coming Up

    fast multiplication in 1 cycle

    Chap. 8 & Chap. 11

    short encoding for negative partial products

    Chap. 11

  • 8/10/2019 Lec15 Booth

    40/40

    Lab 04

    Design a Booth-2 multiplier

    accepts two 16-bit unsigned numbers A and B

    come-out the 32-bit answer C=A*B after 9 cycles

    Feel difficult to design a multi-cycle hardware?

    Recall: RTL design in digital system course

    multiplierA16

    B16

    START

    32 C=A*B

    FINISH