How to get an integer from a sequence of bytes

Grant Edwards invalid at invalid.invalid
Tue Jun 4 09:39:22 EDT 2013


On 2013-06-03, Dan Stromberg <drsalists at gmail.com> wrote:
> On Mon, Jun 3, 2013 at 7:31 AM, Grant Edwards <invalid at invalid.invalid>wrote:
>
>> That's a common assumption, but historically, a "byte" was merely the
>> smallest addressable unit of memory.  The size of a "byte" on widely
>> used used CPUs ranged from 4 bits to 60 bits.
>>
>> Quoting from http://en.wikipedia.org/wiki/Byte
>>
>>     "The size of the byte has historically been hardware
>>      dependent and no definitive standards existed that mandated the
>>      size."
>>
>> That's why IEEE standards always use the word "octet" when referring a
>> value containing 8 bits.
>
> When I was a Freshman in college, I used a CDC Cyber a lot; it had 6 bit
> bytes and 60 bit words.  This was in 1985.

But you couldn't address individual 6-bit "hextets" in memory could
you?  My recollection is that incrementing a memory address got you
the next 60-bit chunk -- that means that by the older terminology a
"byte" was 60 bits.  A "character" was 6 bits, and a single register
or memory location could hold 6 characters.

> Today though, it would be difficult to sell a conventional (Von Neumann)
> computer that didn't have 8 bit bytes.

There are tons (as in millions of units per month) of CPUs still being
sold in the DSP market with 16, 20, 24, and 32 bit "bytes".  (When
writing C on a TMS320Cxx CPU sizeof (char) == sizeof (int) == sizeof
(long) == sizeof (float) == sizeof (double) == 1.  They all contain 32
bits.

> Quantum computers would still sell if they were odd this way -
> they're going to be really different anyway.

-- 
Grant Edwards               grant.b.edwards        Yow! Either CONFESS now or
                                  at               we go to "PEOPLE'S COURT"!!
                              gmail.com            



More information about the Python-list mailing list