View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Help with an algorithm

I follow what you say about the bit/byte orders but none of the rest of your
description or examples. Maybe a search for "little-endian big-endian" will
find many examples of what you are looking for.

Regards,
Peter T


"Dan" wrote in message
...
Need help in determining an algorithm to extract bit/byte information from

a
data stream. I know the where the bit/byte starts and the lenght to

extract,
but the problem is extracting the information correctly.

7 - 0 15 - 8 23 - 16 31 - 24 39 - 32 47 - 40 55 - 48
7654_3210 5432_1098 3210_9876 1098_7654 9876_5432 7654_3210 5432_1098
03 C2 FF A0 78 23 F6

The first and second rows above sequence is to show the bit location

within
the sequence. The third is the actual data that will be received.

The problem is that bit information (8 bits or less) is read right to left
and byte information (9 bits and greater) is read left to right.

Expected
Value Bit Length Variable
0 0 1 A
0 1 1 B
0 3 1 C
0 4 1 D
0 5 1 E
0 6 1 F
0 7 1 G
0 8 1 H
1 9 1 I
0 10 3 J
1 13 1 K
0 14 1 L
1 16 1 M
1 18 1 N
1 19 1 O
1 20 1 P
5A 24 8 Q
5A 32 8 R
002D 47 16 S

Thanks