Hello Dwayne. >Eg. Read the sequence number from 8 records and find the most recent record. > >00 01 02 03 04 05 06 07 (easy) >F9 FA FB FC FD FE FF 00 (harder) >FE FF 00 01 02 03 04 05 (harder) > >The problem is dealing with the wrap from FF to 00. You can solve the problem by searching for negative difference between consecutive records sequence numbers. 7 bit signed value should be used for difference. The trick is that 0 - 255 = +1 in this case, i.e. transition from 255 to 0 is treated as usual ascending of numbers. For example, scanning records 1) 00 01 02 03 04 05 06 07 will give differences +1 and -7 (0 - 7 = -7, so 7 is more recent) 2) 08 01 02 03 04 05 06 07 " " " " " " (1 - 8 = -7. 8 - recent) 3) F8 F9 FA FB FC FD FE FF " " " " " " (F8 - FF = -7. FF - recent) 4) 00 F9 FA FB FC FD FE FF " " " " " " (F9 - 0 = -7. 0 - recent) 5) 00 01 02 03 04 05 06 FF " " " " " " (FF - 6 = -7. 6 - recent) This method will work for 7 and 6 records too. Regards. _ Nikolai Golovchenko, Electrical Engineering Student National Mining University of Ukraine www.nmuu.dp.ua Dnepropetrovsk, Ukraine E-mail: golovchenko@mail.ru