-
- Open http://dl.altera.com/?edition=lite
- Login and click on desired Quartus version download
- Click in the individual file links to start download (Akamai DLM3 Download Manager might not work).
- Extract Quartus installer.
- Run setup.sh: ./setup.sh
- Select desired devices.
- For launching modelsim, install libxft2 32 bit version library: sudo apt install libxft2:i386. Then execute
./vsim
in the path intelFPGA_lite/17.1/modelsim_ase/linuxaloem/
Mes: abril 2018
#define round(x) x >= 0.0 ? (int)(x + 0.5) : ((x - (double)(int)x) >= -0.5 ? (int)x : (int)(x - 0.5))
Example:
#include <stdio.h>
#define round(x) x >= 0.0 ? (int)(x + 0.5) : ((x - (double)(int)x) >= -0.5 ? (int)x : (int)(x - 0.5))
void main(void){
float f1 = 3.14, f2 = 6.5, f3 = 7.99;
int r1, r2, r3;
r1 = round(f1);
r2 = round(f2);
r3 = round(f3);
printf("r1 = %d\nr2 = %d\nr3 = %d\n", r1, r2, r3);
}
The console output is:
r1 = 3
r2 = 7
r3 = 8