[OT] Why is it called string?

Thomas Bellman bellman at lysator.liu.se
Fri Aug 22 19:19:50 EDT 2003


"Andrew Dalke" <adalke at mindspring.com> wrote:

> Paul Watson
>> My CS professor would insist that a byte is a collection of bits, and not
>> necessarily eight.  There are machines which do not have 8-bit addressable
>> bytes.

> I thought that was called a word, as in "the CDC 6400 had a 60
> bit word size"

A word is the natural unit for operation in a machine.  The
registers are word sized (if there are registers, that is), reads
and writes to memory use words (at least from the machine code
programmers point of view), and so on.  A byte is a, typically
smaller, unit of bits that is semiconvenient to operate on, but
usually requires a bit more work by the hardware to extract and
deposit a single byte in a whole word.

Today many CPUs have a word size of 32 bits, and a byte size of
8 bits; there are instructions for operating on a quarter of a
word.  But on a 36 bit machine, 8 bit bytes would not be very
convenient - you'd probably prefer bytes being 6 or 9 bits in
size.

The DEC PDP-10 was a 36 bit machine.  Bytes, however, were
variable sized, and could be anywhere between 1 and 36 bits.
The instructions LDB (LoaD Byte) and DPB (DePosit Byte) took,
in addition to the destination/source register and the word
address to load/store from, also an offset (measured in bits)
within the word, and a byte size (also measured in bits).


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"We don't understand the software, and        ! bellman @ lysator.liu.se
 sometimes  we don't understand the hardware, ! 
 but we can *see* the blinking lights!"       ! Make Love -- Nicht Wahr!




More information about the Python-list mailing list