Generation

generate functionWed, 07 Dec 2022

floating point to fixed point conversion

float float2fix(float x, int bits, int frac_bits) { float scale = pow(2, frac_bits); float res = x * scale; return res; }

Want to kickstart your project?Use the new AI Studio to create your code