data size

For general rambling.
Post Reply
Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

data size

Post by Peijen »

why is byte (8 bit) the standard "data" unit? it is so annoying when you have to pack things with bit mask. we should have used 4bits that way there is a single hexadecimal character representation of data unit and a byte = 2*hd, short = 4*hd, etc.

Jon, I expect you to re-design all cpu and compilers to make it so!

VLSmooth
Tenth Dan Procrastinator
Posts: 3055
Joined: Fri Jul 18, 2003 3:02 am
Location: Varies
Contact:

Re: data size

Post by VLSmooth »

The size of a byte probably has to due with the ascii table to represent characters.

Aha!
http://en.wikipedia.org/wiki/Byte wrote:Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit of memory in many computer architectures.
And the 1962 book referred to by the above on page 39-40
http://archive.computerhistory.org/resources/text/IBM/Stretch/pdfs/Buchholz_102636426.pdf wrote:4.3 Data Hierarchies
...
Byte denotes a group of bits used to encode a character, or the number of bits transmitted in parallel to and from input-output units. A term other than character is used here because a given character rnay be represented in different applications by more than one code, and different codes rnay use diff erent numbers of bits (i.e., different byte sizes). In input-output transmission the grouping of bits rnay be completely arbitrary and have no relation to actual characters. (The term is coined from bite, but respelled to avoid accidental mutation to bit.)

Peijen
Minion to the Exalted Pooh-Bah
Posts: 2790
Joined: Fri Jul 18, 2003 2:28 pm
Location: Irvine, CA

Re: data size

Post by Peijen »

yeah, I already found those information, but it is not helpful! I am more asking about making data size 4 bits than why it is 8 bits. Maybe there is a library out there that would do that.

Jonathan
Grand Pooh-Bah
Posts: 6722
Joined: Tue Sep 19, 2006 8:45 pm
Location: Portland, OR
Contact:

Re: data size

Post by Jonathan »

The term you are looking for is "nibble".

Also, frankly, 0-15 is a way more limited utility than 0-255. A lot of loops and whatnot fit into a byte. Substantially less fits into a nibble.

Post Reply