Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46900

Re: How to get an integer from a sequence of bytes

From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: How to get an integer from a sequence of bytes
Date 2013-06-04 13:39 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <kokqma$574$1@reader1.panix.com> (permalink)
References (3 earlier) <mailman.2447.1369941788.3114.python-list@python.org> <kog67o$pt2$1@news.albasani.net> <mailman.2571.1370224134.3114.python-list@python.org> <koi9ch$3ps$1@reader1.panix.com> <mailman.2611.1370299311.3114.python-list@python.org>

Show all headers | View raw


On 2013-06-03, Dan Stromberg <drsalists@gmail.com> wrote:
> On Mon, Jun 3, 2013 at 7:31 AM, Grant Edwards <invalid@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            

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-05-27 16:45 +0200
  Re: How to get an integer from a sequence of bytes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-27 15:00 +0000
    RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-28 03:37 +0300
  Re: How to get an integer from a sequence of bytes Ned Batchelder <ned@nedbatchelder.com> - 2013-05-27 11:30 -0400
    Re: How to get an integer from a sequence of bytes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-28 00:31 +0000
      Re: How to get an integer from a sequence of bytes Dave Angel <davea@davea.name> - 2013-05-27 20:41 -0400
    Re: How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-05-30 20:26 +0200
      Re: How to get an integer from a sequence of bytes Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-30 12:42 -0600
        Re: How to get an integer from a sequence of bytes jmfauth <wxjmfauth@gmail.com> - 2013-05-30 11:53 -0700
      Re: How to get an integer from a sequence of bytes Ned Batchelder <ned@nedbatchelder.com> - 2013-05-30 15:22 -0400
        Re: How to get an integer from a sequence of bytes Mok-Kong Shen <mok-kong.shen@t-online.de> - 2013-06-02 21:25 +0200
          Re: How to get an integer from a sequence of bytes Chris Angelico <rosuav@gmail.com> - 2013-06-03 05:54 +1000
          Re: How to get an integer from a sequence of bytes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-02 21:48 -0400
            Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-03 14:31 +0000
              Re: How to get an integer from a sequence of bytes Dave Angel <d@davea.name> - 2013-06-03 18:07 -0400
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-03 22:34 +0000
              Re: How to get an integer from a sequence of bytes Dan Stromberg <drsalists@gmail.com> - 2013-06-03 15:41 -0700
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-04 13:39 +0000
                Re: How to get an integer from a sequence of bytes Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-04 20:51 +0100
                Re: How to get an integer from a sequence of bytes Chris Angelico <rosuav@gmail.com> - 2013-06-05 07:49 +1000
                Re: How to get an integer from a sequence of bytes Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-04 20:34 -0400
                Re: How to get an integer from a sequence of bytes Tim Roberts <timr@probo.com> - 2013-06-04 22:11 -0700
                Re: How to get an integer from a sequence of bytes Fábio Santos <fabiosantosart@gmail.com> - 2013-06-12 15:00 +0100
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-12 14:42 +0000
              RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-06-04 02:18 +0300
                Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-06-04 13:42 +0000
                RE: How to get an integer from a sequence of bytes Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-06-04 16:58 +0300
              Re: How to get an integer from a sequence of bytes Dan Stromberg <drsalists@gmail.com> - 2013-06-03 16:47 -0700
  Re: How to get an integer from a sequence of bytes Grant Edwards <invalid@invalid.invalid> - 2013-05-28 16:04 +0000

csiph-web