- ProducMode
- SumFractionLength if SumMode is 'SpecifyPrecision'
- SumMode
- ProductFractionLength if ProductMode is 'SpecifyPrecision'
Fimath function
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to compute T=C*X where C and X are 8*8 matrices (Matrix multiplication includes multiplication of corresponding rows and colums followed by addition)
the wordlength for my multiplier module is 16 bits and adder module is 17 bits....
1)How can this be done using fimath function..... 2)How can i verify the results that I'm getting is correct ,if i'm using the above mentioned wordlengths......
can anyone explain?
0 Kommentare
Antworten (1)
Hong Ye
am 1 Aug. 2012
Hi, you can achieve this by using fi object
Cm = fi(rand(8,8), 1, 16);
Xm = fi(rand(8,8), 1, 16);
F1 = fimath('ProductMode','keepMSB',...
'ProductWordLength',16, ...
'SumMode', 'SpecifyPrecision',...
'SumWordLength',17,...
'SumFractionLength',14);
Cm.fimath = F1;
Tm = Cm*Xm;
you can compare you fixed-point result with floating-point reference result to check for numerical correctness and quantization error. you can adjust following "knobs" to minimize quantization errors,
hope it helps.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Fixed-Point Designer finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!