We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 
Registered: ‎04-23-2014

2*2 matrix inverse in sysgen

hi friends

Im going to implement 2*2 , 3*3 and then n*n matrix inversion on fpga.

I'v started by sysgen and  2*2 matrix inversion.

look at my file i think my mistakes are toomuch!

i dont khow which way is the best for multiply,divide,sub,...?(cordic?simpler blocks?...?)

thank u friends.

0 Kudos
4 Replies
Xilinx Employee
Xilinx Employee
Registered: ‎08-01-2008

Re: 2*2 matrix inverse in sysgen


You can use Xilinx HLS with targeting sysgen design . Use the attached code for LU decomposition


LU Decomposition is a well known algorithm for matrix decomposition that is further used for matrix inversion for example.

This design integrates actually 2 different implementations showing how the code must be modified in order to optimize for Hardware implementation.

BasicLU: contains the VHLS project using the standard algorithm.

SimpleLU: contains the VHLS project optimized for Hardware

The PowerPoint file explains precisely why we should modify the code and explore the various solutions.

Thanks and Regards
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Registered: ‎02-28-2011

Re: 2*2 matrix inverse in sysgen



I have implemented matrix Inversion (2x2) in Sysgen very similar to your aproach:




My implementation is very ressource and timing orientated. As you can see i onl yuse one divider (reciprocal 1/X), which I implemented as a lookup table. You can even save more ressources by using Time Domain Multiplexing methods.


I would  not use this method however for matrixes above 3x3. Even for 3x3 this gets quite heavy. Instead I would got the LU decomposition route.


Regards Markus


0 Kudos
Registered: ‎04-23-2014

Re: 2*2 matrix inverse in sysgen

your answer was helpful my friend markus.and it will be so usefull to have ur .mdl file if psble.
In addition yes my main goal is to implement inversion algorithm for 4*4 or something above it.I read something about
QR decomposition and i think it was a bit complicated,but the LU decomposition seems to be better!
should i write the LU-D in HDL or u suggest something else?(like sys gen...)
0 Kudos
Registered: ‎04-23-2014

Re: 2*2 matrix inverse in sysgen

Great answer balkris!
and thanks for nice files.
unfotunately my xilinx account is really making me mad! and i cant download vivado because my information is not going to be verified,and i dont know why! I just have ise13.4
and u know its hard to write those .cpp codes in VHDL or Verilog :(
can u show me the road to do my project?
0 Kudos