30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

in default RAM memory space (X-Data or Y-Data).<br />

f) Operations which return a destination matrix can be nested, so that for<br />

instance<br />

if:<br />

a = Op1 (b, c), with b = Op2 (d), and c = Op3 (e, f), then<br />

a = Op1 (Op2 (d), Op3 (e, f))<br />

2.5.3 Additional Remarks<br />

The description of the functions limits its scope to what could be considered the<br />

regular<br />

usage of these operations. However, since no boundary checking is performed<br />

during<br />

computation of these functions, you have the freedom to interpret the operation<br />

and its<br />

results as it fits some particular needs.<br />

For instance, while computing the MatrixMultiplyfunction, the dimensions of<br />

the<br />

intervining matrices does not necessarily need to be {numRows1,<br />

numCos1Rows2} for<br />

source one matrix, {numCols1Rows2, numCols2} for source two matrix, and<br />

{numRows1,<br />

numCols2} for destination matrix. In fact, all thatis needed is that their sizes are<br />

large<br />

enough so that during computation the pointers do no exceed over their memory<br />

range.<br />

As another example, when a source matrix of dimension {numRows, numCols}<br />

is<br />

transposed, the destination matrix has dimensions {numCols, numRows}. Thus,<br />

properly<br />

speaking the operation can be computed in place onlyif source matrix is square.<br />

Nevertheless, the operation can be successfully applied in place to non square<br />

matrices; all that needs to be kept in mind is the implicitchange of dimensions.<br />

DSP Library<br />

2004 Microchip Technology Inc. DS51456B-page 33<br />

Other possibilities can be exploited from the fact that no boundary checking is<br />

performed.<br />

2.5.4 Individual Functions<br />

In what follows, the individual functions implementing matrix operations are<br />

described.<br />

MatrixAdd<br />

Description: MatrixAddadds the value of each elementin the source one matrix<br />

with its counterpart in the source two matrix, and places the result in the<br />

destination matrix.<br />

Include: dsp.h<br />

Prototype: extern fractional* MatrixAdd (<br />

Ghi chú: Nếu giá trị tuyệt đối của srcM1 [r] [c] + srcM2 [r] [c] lớn hơn<br />

1-2<br />

-15<br />

, Kết quả hoạt động này trong độ bão hòa cho (r, c) các yếu tố -thứ.<br />

Chức năng này có thể được tính tại chỗ.<br />

Chức năng này có thể tự áp dụng.<br />

Source File: madd.asm<br />

Chức năng thông tin: sử dụng nguồn tài nguyên của hệ thống:<br />

W0..W4 sử dụng, không được khôi phục<br />

ACCA được sử dụng, không được khôi phục<br />

CORCON lưu, sử dụng, phục hồi<br />

DOand REPEATinstruction sử dụng:<br />

1 DOinstructions cấp<br />

không REPEATinstructions<br />

Từ chương trình (hướng dẫn 24-bit):<br />

14<br />

Chu kỳ (bao gồm cả cuộc gọi C-chức năng và trả các chi phí):<br />

20 + 3 (numrows * numCols)<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

DS51456B trang 34 2004 Microchip Technology Inc<br />

MatrixMultiply<br />

Mô tả: MatrixMultiplyperforms phép nhân ma trận giữa<br />

một nguồn và nguồn hai ma trận, và đặt kết quả trong<br />

ma trận đích. Tượng trưng:<br />

trong đó:<br />

0 ≤i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!