spartan3e: BRAM gehaxe. lesbarer und wird auch richtig(er) instanziert
[calu.git] / 8_benchs / angabe / fib.c
1 /* recursive fibonacci computation */
2 /* optimization guideline: applying tail recursion optimizations is
3    okay, using an iterative algorithm is not */
4 int fib(int a) {
5         if (a < 2) {
6                 return 1;
7         } else {
8                 return fib(a-1)+fib(a-2);
9         }
10 }
11
12 int main() {
13         /* BENCHMARK START */
14         return fib(9);
15         /* BENCHMARK END */
16 }