Software Example - Lucent Technologies DSP1617 Information Manual

Digital signal processor
Table of Contents

Advertisement

DSP1611/17/18/27/28/29 DIGITAL SIGNAL PROCESSOR
Bit Manipulation Unit
13.2 Software View

13.2.8 Software Example

The following program example demonstrates the use and power of the BMU. It is a routine to convert an 8-bit
µ-law number to a 14-bit linear number. The routine calculates the function:
where S is the sign bit, M is the magnitude, and N is the exponent. The 8-bit µ-law value is passed to the routine in
the high half of accumulator a0 in the form:
0 0 0 0 0 0 0 0 (S) (n2) (n1) (n0) (m3) (m2) (m1) (m0)
A previous routine (_mulin) for the DSP16/16A is found in the application library. The comparison between the two
routines is:
ROM Locations
Instruction Cycles
Routine Source Code
a0=~a0
a1=extractz(a0,0x0314)
ar0=a1l
a1=extractz(a0,0x0410)
a1=a1<<17
y=33
a1=a1+y
a1=a1<<ar0
a1=a1-y
a0=a0>>23
if mns1 a1=-a1
return
13-10
(continued)
– ( )
2Y
=
1
DSP16A
24
32
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
DRAFT COPY
×
(
)
×
S
N
33
+
2M
2
33
DSP1611/17/18/27/28/29 with BMU
17
19
Inverts all bits in a0
Puts N into a1
Puts N into ar0
Puts M into a1l
Puts 2M into a1h
Puts 33 into high y
Puts 2M+33 into a1h
Puts (2M+33) 2
shifting left N times
Puts (2M+33) 2
Puts sign bit in bit 0, 1s in 1—35
If negative, take two's complement
Information Manual
N
into a1h by
N
–33 into a1h
Lucent Technologies Inc.
April 1998
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp1629Dsp1618Dsp1611Dsp1627Dsp1628

Table of Contents