OpenCores
URL https://opencores.org/ocsvn/mblite/mblite/trunk

Subversion Repositories mblite

[/] [mblite/] [trunk/] [sw/] [fibonacci/] [testbench.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 takar
int fib(int n){
2
    switch (n) {
3
        case 0:
4
            return 0;
5
        case 1:
6
            return 1;
7
        default:
8
            return fib(n-1) + fib(n-2);
9
    }
10
}
11
 
12
int main()
13
{
14
    fib(15);
15
    return 0;
16
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.