Listing 1-1. Exercise 1, Part 1 - Analog Devices ADSP-BF537 EZ-KIT Lite Getting Started

Hide thumbs Also See for ADSP-BF537 EZ-KIT Lite:
Table of Contents

Advertisement

Programming ADSP-BF537 EZ-KIT Lite with VisualDSP++

Listing 1-1. Exercise 1, Part 1

/*
* Getting Started With the ADSP-BF537 EZ-KIT Lite
* Part 1, Exercise 1
*/
#include <stdlib.h>
#define NUM_ITERATIONS
#define ARRAY_LENGTH
/* Initialize two arrays to the same set of random values */
void randomize_arrays ( int *v1, int *v2, unsigned int length )
{
unsigned int i;
for ( i = 0; i < length; ++i )
{
v1[ i ] = v2[ i ] = rand () % 1024;
}
}
/* A standard bubble sort algorithm, O(n^2) */
void bubble_sort ( int *v, unsigned int length )
{
unsigned int i, j;
for ( i = 0; i < length - 1; ++i )
{
for ( j = i + 1; j < length; ++j )
{
if ( v[ i ] > v[ j ] )
{
int temp = v[ i ];
v[ i ] = v[ j ];
v[ j ] = temp;
}
}
}
}
/* A standard quick sort algorithm, O(n*log(n)) */
void quick_sort ( int *v, unsigned int p, unsigned int r )
{
if ( p < r )
Getting Started with ADSP-BF537 EZ-KIT Lite
www.BDTIC.com/ADI
1
128
1-19

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADSP-BF537 EZ-KIT Lite and is the answer not in the manual?

Questions and answers

Table of Contents