Search Engine www.edaboard.com
4 Threads found on edaboard.com: 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 (...)
Software Problems, Hints and Reviews :: 01-23-2016 09:51 :: rahul.6sept :: Replies: 8 :: Views: 777
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
Microcontrollers :: 08-16-2010 10:51 :: rajudp :: Replies: 13 :: Views: 1233
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.
PLD, SPLD, GAL, CPLD, FPGA Design :: 06-28-2007 00:04 :: arnoud :: Replies: 2 :: Views: 1117
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.
PLD, SPLD, GAL, CPLD, FPGA Design :: 08-02-2004 02:19 :: mc_navman :: Replies: 4 :: Views: 3406