Octets calculation?

Bengt Richter bokr at oz.net
Fri Jun 13 17:18:38 EDT 2003


On 13 Jun 2003 19:18:15 GMT, grante at visi.com (Grant Edwards) wrote:

>In article <bcbb0q$hf4ub$1 at ID-169208.news.dfncis.de>, Greg Ewing (using news.cis.dfn.de) wrote:
>>
>>> It's not rare in the DSP world.  TI's line of FP DSPs all had
>>> 32-bit bytes.  Where "byte" is used in the sense of the "C"
>>> standard as the smallest unite of addressable memory.
>> 
>> I thought the C standard used the word "char" for that, not
>> "byte".
>
>Both.  In the C standard "char" and byte "byte" are equivalent.
>Using "byte" is more confusing, and if I had written it I would
>have stuck with "char".  But they didn't ask me...  ;)
>
>> If DSP people really use the word "byte" that way, they're
>> utterly barking, IMO. It's just too confusing for words. (Or
>> should I say octet-groups?-)
>
>They generally only use it that way when they're dealing with
>the C standard, and I, for one, do prefer "char".
>
The C++ standard (or at least a 2 December 1996 draft I snagged) says
--
  1.6  The C++ memory model                               [intro.memory]

1 The fundamental storage unit in the C++ memory model is the  byte.   A
  byte  is at least large enough to contain any member of the basic exe-
  cution character set and is composed of a contiguous sequence of bits,
  the  number of which is implementation-defined.  The least significant
  bit is called the low-order bit; the most significant  bit  is  called
  the high-order bit.  The memory available to a C++ program consists of
  one or more sequences of contiguous bytes.  Every byte  has  a  unique
  address.
--
which seems to imply that char and byte COULD have different numbers of bits.

Regards,
Bengt Richter




More information about the Python-list mailing list