Instant SoC Class Library  3.1
FC_System_FPU Class Reference

Floating Point Unit
This class adds a floating point unit to the processor.
The gcc compiler will use floting point instructions.
. More...

Inheritance diagram for FC_System_FPU:
FC_Base

Detailed Description

Floating Point Unit
This class adds a floating point unit to the processor.
The gcc compiler will use floting point instructions.
.

The following example show how to include the foating point unit:

// This example show how to use FC_System_FPU class to add acceleration of floating
// points operations. A 32 depth array is first filled with integer sin values ranging
// from -1000 to 1000. A new value from the table is output every 10 us.
#include <math.h>
#include "fc_io.h"
#include "fc_system.h"
int main(void)
{
//% hw_begin
FC_IO_Clk Clk(100);
FC_IO_Out sin_out(11);
//% hw_end
// Create a table with sin values * 1000
const int N = 32;
int sin_table[N];
float da = 2 * 3.1415f / N;
for(int i=0;i<32;i++)
{
sin_table[i] = int( 1000.0f * sinf(da*i) );
}
timer.Start(10,TU_us);
int i=0;
for(;;)
{
timer.WaitTimer();
sin_out = sin_table[i];
i++;
if(i>=N)
i=0;
}
}
FC_IO_Clk
System clock input.
Definition: fc_io.h:55
FC_System_FPU
Floating Point Unit This class adds a floating point unit to the processor. The gcc compiler will use...
Definition: fc_system.h:315
FC_IO_Out
Logic output.
Definition: fc_io.h:126
FC_System_Timer
Timer.
Definition: fc_system.h:78