Search Engine

Max Array Value

Add Question

4 Threads found on Max Array Value
Dear all, Kindly advice me the correction for this code of matlab.I'm not able to get the output. Also I don't know how to compare the outputs in array to find the max and min. %For x=, calculate f(x)=xe^-2x. Report the value of x at which %f(x) is maximum. This value of x should be reported (...)
min=0; max=0; while(1) { ADCON0 = ADC_SINE; ADCON0bits.GO = 1; while (ADCON0bits.DONE); //Terminates the A/D conversion when all the signal are converted adc_result = 256*ADRESH + ADRESL; // Store the result if(min > adc_result) min=adc_result; if(max < adc_r
Same way as you would do it in C (or whatever language you use): - use a counter to address the whole array one by one: at seach start set register to max value, and coutner to 0. for every data read: - compare output with a register - if lower, load register with read value Hope this helps.
Hi, I want to set arraysize based on the max value to be represented. Is this possible in verilog? i.e. parameter CLK_DIV = 27210; reg CLK_DIV_REG; //<<-- how do I set this array size automatically for when I change the parameter.