W elcome to
Fintronic USA

redball.gif (326 bytes)About Fintronic USA

redball.gif (326 bytes)Main announcements

redball.gif (326 bytes)What's new at Fintronic

redball.gif (326 bytes)What our customers are saying...

redball.gif (326 bytes)Support for SystemC

redball.gif (326 bytes)Support for Verilog 2001

redball.gif (326 bytes)Third party tools integrated with FinSim(Specman, Denali, Debussy, Undertow, Vera, VirSim, HDL Score, Comet, Meteor, NelSim, Pivot, DeskPOD, @Designer 2.1)

home.htmlProductsSupportEvaluateContact

Pseudo inversion in Verilog


This example shows how to compute the pseudo inverse of an n x m matrix with elements of type real.

Note: this example runs on FinSim version 10.0.0 or higher.

module top;

real Q[3:0][2:0];
real IQ[3:0][2:0];
real S[0:0][3:0];
real P[0:0][2:0];

initial begin
#1;

Q = {1.0, 1.0, 1.0, 
     1.0, 2.0, 1.0,
     1.0, 1.0, 2.0,
     2.0, 1.0, 1.0};
S = {6.0, 8.0, 9.0, 7.0};

$PrintM(Q, "%e");
$PrintM(S, "%e");

P = S/Q;
$PrintM(P,"%e"); 
IQ = Q**(-1);
P = S*IQ;
$PrintM(P,"%e"); 

end
endmodule