You are on page 1of 11

CANONICAL SIGNED DIGIT REPRESENTATION

FOR FIR DIGITAL FILTERS


Reid M. Hewlitt

Earl S. Swartzlander, Jr.

Elec. and Comp. Engr. Dept.


University of Texas at Austin
Austin, TX 78712

Elec. and Comp. Engr. Dept.


University of Texas at Austin
Austin, TX 78712

Abstract - In this paper, it is shown that the use of a canonical signed digit (CSD)
representation of the filter coefficients can significantly reduce the complexity of the
hardware implementation of digital FIR filters. This paper presents an example filter
design that shows the error involved in limiting the number of allowable non-zero CSD
coefficients for a real FIR bandpass filter. If hot done carefully, brute force limiting
can lead to large errors in the frequency response. The error is evaluated for varying
numbers of non-zero CSD coefficients. Lastly, a system level architecture with a
multiplier utilizing the properties of the CSD number representation system is
proposed.

PROBLEM
Canonical signed digit (CSD) representation of filter coefficients can reduce
the complexity of the hardware required to realize a FIR digital filter to less than
the complexity of a 2s complement representation implementation. Often, only a
few non-zero CSD digits are allowed to represent each coefficient which may
introduce magnitude errors in the frequency response unless the filter coefficients
can be decomposed into a few powers-of-two or sums of powers-of-two. The
problem addressed in this paper is to determine the error in frequency response as
the number of non-zero CSD digits are,reduced from the maximum down to two
allowable digits. The magnitude response is only affected since FIR filter
coefficient quantization does not impact the phase response assuming a symmetric
filter kernel.

INTRODUCTION
In 1961, Avizienis [SI described the signed digit number system (used since
the 1950s [ 11) in order to improve speed in arithmetic computation. The Canonical
Signed Digit (CSD) number system is a signed digit number system that minimize
the number of non-zero digits and thus can reduce the number of partial product
additions in a hardware multiplier. The encoding scheme uses a digit set that is
ternary and each digit can be either -1, 0, or +l. Adjacent CSD digits are never
both non-zero, i.e., ci*ci-l= 0. This property implies that for an n-bit number, there
are at most Ld21 non-zero digits. For a 2s complement number, there can be n
non-zero digits for a n-bit number. It can also be shown that the probability of a

0-7803-6488-01001$10.00 0 2000 IEEE

416

digit being zero is roughly 2/3 for CSD and exactly 1/2 for 2s complement. The
following table shows an example for n = 3 where 1 represents -1. As can be seen
in Table 1 , for negative numbers the number of non-zero digits is less for the CSD
representation than the 2s complement representation, 9 versus 12.
Table 1 . Three Digit Canonical Signed Digit Numbers.

I)

3
2
1

1n

01 1
010
00 1

010

00 1

101

-4

101
100

100

CSD encoding is similar to Booth encoding and can be accomplished by analyzing


pairs of adjacent digits from the LSB end to the MSB+I end. If the number is
negative, the MSB+1 (x*,) is 1, otherwise, it is a 0. This can be implemented as a
copy of the MSB. Table 2 (from [l]) and the flow chart of Figure 1 provide a
method to convert 2s complement numbers to CSD numbers. This method was
used to create Table 1. The digits xi and xi+l are adjacent digits of the 2s
complement number and the digits, ci, are the CSD digits. The flow chart shows
the algorithm to convert 2s complement filter coefficients, X, to CSD
representation of the filter coefficient, C, where X = x*,x,.Ix,.2x,.3...x3xzxlxo and

c = C,.~C,.~C.~...C~C~C~C~.

Table 2. Conversion of 2s Complement Numbers to CSD Numbers

Digital FIR filters can take advantage of the CSD representation. FIR filters are
computationally more expensive than an equivalent IIR filter having the same set
of frequency response specifications, but FIR filters exhibit linear phase response
which is useful in many applications such as decimation filters for Delta-Sigma

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

417

oversampling analog-to-digital converters.


With CSD representation, the
multiplier reduces to only a few summations of partial products.

c=?

Start

carry = 0
x*.

= x..,

Figure 1. Conversion of 2s complement to CSD

APPROACH
A bandpass FIR filter was designed by using the Chebyshev approximation
criterion and implemented by means of the Remez exchange algorithm. This
passband filter is a three-band filter with passband edge frequencies of 0.2 and
0.35 and stopband frequencies of 0.1 and 0.425. The error weighting function is
selected as 10, 1, and 10 with desired response of 0, 1, and 0 for each band
respectively. Thus, the passband will have unity gain as shown in Figure 2. The
magnitude frequency response of the filter is shown in Figure 2. This is the
original filter with no coefficient digit reduction. The output of the filter is given
by the following equation.
0-7803-6488-0/00/$10.000 2000 IEEE

418

0.1

0.2

0.3

0.4

0.5

Normalized Frequency (cycles/sample)

Figure 2. Frequency Response of M = 32 FIR digital filter.


M-1

y ( k ) = C h ( i ) x ( k- i)

i=O

The filter coefficients are symmetrical (i.e., h(i) = h(31-i) for i = 0, 1, 2, ... 15).
Thus like terms can be grouped for efficient hardware utilization.

y(k) = h(O)[x(k)+ x(k-31)] + h(l)[x(k-I) + x(k-30)] + ..


+ h(16)[~(k-15)+ x(k-16)J.
The length or order of the filter is M = 32. The filter coefficients, h(k), as output
from the Remez exchange algorithm are shown in Tables 4a and 4b. The
coefficients are then scaled by multiplying each by lo5 and rounded to the nearest
integer. The scaling constant was chosen so that the largest coefficient is just less
than 215 -1, the largest, 16-bit, 2s complement number. For this scaling, the largest
coefficient is 30411. The 2s complement coefficients are then converted to CSD
coefficients. Tables 4a and 4b show the coefficients in 2s complement and CSD
representation. Also shown in Tables 4a and 4b are the total number of additions
which drops from 220 to 147. This amounts to a roughly 33% reduction in the
number of partial product additionshbtractions.
The filter can be realized by the architecture shown in Figure 3. This architecture
works for both 2s complement as well as CSD number representations; however,
the multiplier can be implemented in different ways. A design for the well-known
radix-4 Booth multiplier is shown in Figure 4 which performs the 2s complement
0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

419

multiplication. An alternate CSD multiplier is shown in Figure 5. This CSD


multiplier skips the zeros in the CSD coefficients. The selection and skip logic is
Table 3. Number of AdddSubtracts per Filter

Table 4a. Filter Coefficients and 2's Complement Number Representation

k l
I 0 I

h(k)

I
I

h(k)
Scaled

-0.0057534026

-575.34026

27
28
29
30
31

0.013960509
-0.0065141204
0.0075733471
0.00099026691
-0.0057534026

1396.0509
-65 1.41204
757.33471
99.026691
-575.34026

0-7803-6488-0/00/$10.00 0 2000 IEEE

420

h(k) I h(k) 16-bit, 2's ITotall


IRoundedl complement Adds
I -575 I 1111 1101 11000001 I 6

1396
-651
757
99
-575

0000010101110100
1111 1101 0111 0101
0000001011110101
0000 0000 01 10 001 1
1 1 1 1 1101 11000001
TOTAL ADDS

8
10
8
4
6
220

Table 4b. Filter Coefficients and CSD Number Representation

30 I0.00099026691 I
31 I -0.0057534026

-575

000000~l0'000101 I
0000001001000001 I
TOTAL ADDSlSUBS

2
1

3
147

governed by the CSD conversion process shown in Table 2 and Figure 1. The skip
logic signals a shift to the register and bypasses the addition process when a zero
CSD is encountered. The overall complexity of the CSD multiplier is lower than
the radix-4 modified Booth multiplier since only a 2:l multiplexer is required for
each bit position of the adder as opposed to a 5:l multiplexer for each bit position
of the Booth multiplier. The delay of the CSD multiplier can be less than the
radix-4 Booth multiplier if the maximum number of non-zero CSD digits for the
filter coefficients is limited. For the case where n = 16 with three allowable nonzero CSD digits, the CSD multiplier only requires three cycles to complete the
multiplication, whereas the radix-4 Booth multiplier requires eight cycles. This
leads to better than a 60% reduction in multiplier delay if the shift register delay is
ignored, i.e., when we skip the zero partial products in the CSD multiplier. See
Table 3 for a comparison between hardware multipliers and the

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

421

Figure 3. Architecture of M=32 FIR Filter

Selection 7
Logic
I

+
Figure 4. Radix-4 Modified Booth Multiplier
l-----l

Selection
& Skip Logic

Figure 5. CSD Multiplier

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

422

Carry-in

Potential delay savings realized by a CSD digit-limited implementation. A


spreadsheet was used to determine the frequency response for each CSD digit
reduction for 16-bit numbers. For n = 16, there are maximum of eight possible
non-zero digits for each filter coefficient, although, as shown in Table 4a and 4b,
there are no more than seven non-zero digits required for this particular filter.
Thus, the number of non-zero CSD digits will be limited from seven down to two
in single digit increments (i.e. 7, 6 , 5 , 4 , 3, & 2).

RESULTS
Table 5 shows the decimal values of the filter coefficients for each set of
CSD digits. Note that there is very little effect on the coefficients until only three
non-zero CSD digits are allowed. The filter frequency responses for 4, 3 and 2
non-zero CSD digits are shown in Figures 6, 7, and 8, respectively. The phase
response is unaffected by coefficient quantization and thus exhibits no error. No
appreciable difference is seen for allowable CSD digits above 4. The error in the
magnitude response is plotted in Figure 9. Most of the error occurs in the
stopbands at the extrema and may be discounted somewhat since these errors may
not affect the filter performance. As can be seen in the error plots and frequency
response, the passband error is relatively insignificant for all non-zero CSD digit
reductions. If the stopband limitation of the filter is arbitrarily set to at least 50dB
of attenuation, then the CSD implementation with no more than 3 non-zero digits is
an optimal solution.
Table 5. CSD Digit Reductions

0-7803-6488-O/OO/$lO.OO0 2000 IEEE

423

10

0
-10
-20

p -30

-40

Q)

'

'E

-50

-60
-70
-80
-90

-100
0

0.05 0.1

0.15

0.2

0.25

0.3 0.35 0.4

0.45

0.5

Normalized Frequency (cycledsample)

Figure 6. Frequency Response, 4 Non-Zero CSD Digits.


10
0

-1 0

-20

-30

'
'E

-40
-50
-60

-70
-80

-90
-100

0.05

0.1

0.15

0.2

0.25

0.3 0.35 0.4

0.45

Normalized Frequency (cycleslsample)

Figure 7. Frequency Response, 3 Non-Zero CSD Digits.

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

424

0.5

10
0

-1 0

-k
z
sm
O)

'

-20

-30
-40
-50
-60
-70

-80
-90

-1 00
0.05

0.1

0.15

0.2 0.25 0.3 0.35 0.4

0.45

0.5

045

05

Normalized Frequency (cycleslsample)

Figure 8. Frequency Response, 2 Non-Zero CSD Digits.


60.00

50.00

I
0

005

01

015

025

02

03

035

Normalized Frequency (cycledsample)

Figure 9. Error in Frequency Response.

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

425

04

CONCLUSIONS
CSD representation for FIR filters can reduce the delay and complexity of the
hardware implementation by a significant amount. It is also shown that further
reductions in the number of non-zero CSD digits of the filter coefficients reduces
the multiplication process to a few additions or subtractions of partial products.
For the bandpass filter discussed here, a restriction to 3 non-zero digits gives good
frequency response with limited error. Thus, with 3 non-zero digits, the multiplier
can be reduced to an adder that shifts and adds or subtracts at most three partial
products. A full Booth-type multiplier is not required for each filter tap which
reduces the overall hardware area requirements.
Filter design algorithms that restrict coefficients to powers-of-two already exist,
but further work could be done in this area to formulate a design algorithm that
would conform to only easy CSD numbers. This would reduce the expense of
full multipliers, but maintain a satisfactory frequency response of the FIR filter.

References
Fred J. Taylor, Digital Filter Design Handbook, New York: Marcel
Dekker, 1983.
John G. Proakis and Dimitris G. Manolakis, Digital Signal Processing:
Principles, Algorithms, and Applications, 2ndEdition, New York:
Macmillan, 1992.

Hwan-Rei Lee, et al, A new hardware-efficient architecture for


programmable FIR filters, IEEE Transactions on Circuits and Systems,
Vol. 43, pp. 631-644, 1996.
Henry Samueli, An improved search algorithm for the design of
multiplierless FIR filters with powers-of-two coefficients, IEEE
Transactions on Circuits and Systems, Vol. 36, pp. 1044-1047, 1989.
Algirdas Avizienis, Signed-digit number representations for fast parallel
arithmetic, IRE Transactions on Electronic Computers, Vol. EC- 10, pp.
389-400. 1961.
Kei-Young Khoo, et al, A programmable FIR digital filter using CSD
Coefficients, IEEE Journal of Solid-state Circuits, Vol. 3 1, pp. 869-874,
1996.
Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware
Designs, New York: Oxford University Press, 2000.

0-7803-6488-O/OO/$lO.OO
0 2000 IEEE

426

You might also like