I am working with Xilinx HLS tool. Basically I wrote all the algorithms in C++. I want LFSR to be the input of my algorithm. So, I think, the whole work should be written in C++. That is why I need the LFSR to be written in C++.
If C++ and C can be combined, how it can be worked? Is there any example?
If C++ and C can be combined, how it can be worked? Is there any example?
the operators are the same. ~ (bit-not), ^ (bit xor), << shift, etc.. all the same
and those work on whatever integer types (but be very very cautious with signed values)
bitfields are the same. (but, not sure many use in c++ anymore?)
bitset is c++ only.
above that, c++ lets you wrap this stuff in classes or make it cleaner...
or, in a nutshell, the two are identical down in the details and only differ a bit when you decide how to wrap it up.
example... what language is this?
unsigned int a,b;
a = 3;
b = 5;
a ^= b;
… now when you chose to write out a with printf or c++ you have sort of picked a language assuming you don't use printf in your c++ code...
and, on top of this, c++ compilers can let you put a C file in and compile them all together. If you have something in C that just works, wrap in a function and call from c++. If your C code has a main function, you may have to convert that to not be main, but nothing major will need to be done.