CMOS Gate Array Design Exercise 2000

Design Specification


Versatile Multiply Unit Controller


Introduction

This year's exercise is to design a controller for a simple multi-cycle multipler. The controller should be versatile enough to cope with both signed and unsigned multiplications and variable precision arithmetic.

Multiplication & Multipliers

The simplest algorithm for multiplication involves repeated shift and add operations. In the figure below, the register A is initially loaded with the multiplicand and the register B is initially loaded with the multiplier while P which will contain the partial product is initially zero.

In the first cycle A is added to P if the least significant bit of B is '1'. A is shifted left while B is shifted right.

This process is repeated for N cycles where N is the number of bits in the operands. i.e. 8 times if A and B are 8 bit values.

The technique is simply one of long multiplication. Below you can see the long multiplication of two 8 bit values to produce a 16 bit result.

 Multiplicand         01010111              87
 Multiplier           00100101 x            37 x
                      --------             ---
                      01010111             609
                     00000000             261
                    01010111              ----
                   00000000               3219
                  00000000
                 01010111
                00000000
               00000000
              ----------------
 Product      0000110010010011

Signed Numbers

Dealing with a signed multiplicand is simply a question of sign extension of the value loaded into the A register:

 Multiplicand         11010111             -41
 Multiplier           00100101 x            37 x
                      --------             ---
              1111111111010111            -287
              000000000000000            -123
              11111111010111             -----
              0000000000000              -1517
              000000000000
              11111010111
              0000000000
              000000000
              ----------------
 Product      1111101000010011

Where the multiplier is negative it is necessary to perform a subtraction rather than an addition for the most significant (sign) bit:

 Multiplicand         11010111             -41
 Multiplier           10100101 x           -91 x
                      --------             ---
              1111111111010111              41
              000000000000000  +          369
              11111111010111   +         -----
              0000000000000    +          3731
              000000000000     +
              11111010111      +
              0000000000       +
              ----------------
              1111101000010011 
              111010111        -
              ----------------
 Product      0000000010010011

Multiply Unit Datapath

In a real system the multiply unit is likely to be just one of a number of units sharing one or more common data buses. The following diagram shows the datapath of a multi-cycle multiply unit suitable for connection to a single system data bus:

Note that in this datapath there is no AND gate to control the input to the Add/Subtract unit. Instead the UpdateP signal allows the output of the Add/Subtract unit to be ignored.

Sequence for Unsigned 8 bit Multiplication

With this real hardware we need three extra cycles to complete the multiplication.

The following diagram shows a suitable sequence of control signals for the unsigned 8 bit multiplication:

The multiplication is triggered by a Start signal external to the multiply unit. On the diagram you can trace the operation of the unit from the single cycle Start pulse, through the loading of A and B to the calculation and finally the output of P. Note that the system data bus is shown high impedance when it is not being used by the unit - this allows the bus to be used by other units as required.

The control signals generated by the controller are UpdateA, UpdateB, UpdateP, Shift, ZeroP, Subtract & EnableP.

LsbB is the feedback signal from the datapath to the control unit enabling the control unit to decide whether P should be updated with the result of the addition.

Versatile Multiply Unit Controller

Your controller will generate the UpdateA, UpdateB, UpdateP, Shift, ZeroP, Subtract & EnableP control signals based on the Start input and the LsbB feedback signal.

In addition to these inputs there is an input Signed which tells the controller whether the operands are signed (i.e. whether the most significant bit of each operand is a sign bit - it does not tell us whether an operand is negative). The controller uses this information to decide when to set the Subtract signal to '1' which causes the Add/Subtract unit to perform a subtraction rather than an addition.

To cope with different widths of operand and different widths of datapath, the controller is also provided with two mode inputs Mode0 and Mode1. The following table shows how these signals effect the operation:

Mode1 Mode0 Operation
00 0 A and B are 8 bit values
10 1 A and B are 16 bit values
21 0 A and B are 32 bit values
31 1 In this mode the numbers of bits in A and B are unknown. Instead two more feedback signals are provided EmptyB & FullB. These signals allow the controller to detect when it has dealt with all the useful addition stages so that it can terminate the multiplication early.

Detailed Specification

Your design for the frame synchronization unit must satisfy the following specification:

Suggested Division into Modules

The only suggestion for this year is to include a programmable down counter as a separately testable module with a trigger input that goes high for one cycle to load the counter and a zero output to tell the rest of the system when the count is finished.

With the exception of the common inputs CLOCK, nRESET, Mode1 and Mode0 this block can easily be isolated from the rest of the system thus improving modularity and testability.

Remember that it is important to include as much testability as possible in order to get the best results out of the testing exercise next semester (many circuit breaks to improve observability and controllability and many test outputs to improve observability only).

During the testing stage, any separate blocks will be reconnected to give the originally specified functionality. With careful choice of signal names, this split circuit will simulate as if it was reconnected thereby assisting with design verification.

Flexibility in Specification

To cope with teams of differing capabilities, there are a number of ways in which the specification may be relaxed:

Making an informed choice

The choice of a circuit for implementation will be one of your most important design decisions for this exercise. In the initial stages you may like to produce outline designs for a number of different options. It is certainly possible that one or more of your initial designs will need more than the 67 available gate sites.

In choosing between designs, the key points to consider are:

  1. Although an elegant design which fully meets the spec will get most marks, a simple functional design will get more marks than an ambitious design that doesn't quite work or is not completed on time.
  2. As you use more of the Gate Array the wiring becomes harder. Thus a design which uses all 67 available gate sites may take twice as long to route as one that uses only 57.

Note that if you chose to relax the specification such as described above you must document this in both your interim and your final reports.


Iain McNally

19-10-2000