Welcome! Log In Create A New Profile

Advanced

Re: Oh or O?

July 24, 2008 09:07PM
I began my career over thirty years ago as a COBOL programmer (these days I work mostly in C++), so perhaps I should answer the question.

The number of characters you can represent doubles each time you use an additional bit of storage.
1 bit ==> 2 different characters
2 bits ==> 4 different characters
3 bits ==> 8 different characters
4 bits ==> 16 different characters
5 bits ==> 32 different characters
6 bits ==> 64 different characters
7 bits ==> 128 different characters
8 bits ==> 256 different characters

The character set we typically use has something like 90 characters, so at least 7 bits are needed to represent it. Since computers are organized by bytes (8 bits), normally we use a whole byte to represent each character. Thus, if you are going to allow up to 6 characters per number, the character representation would require 6 bytes of storage.

On the other hand, there are only 10 digits, so you can represent a digit using just 4 bits; that is you can store 2 digits in each byte, so the digit (what is sometimes called "packed" or "BCD") representation of a 6 character number would require just 3 bytes of storage.

Saving 3 bytes doesn't seem like much now, but 40 years ago storage was much more precious than it is now, and we were trained (we're talking about the era when I was a college student) how to save every last byte. My wife finished her thesis (in Chemistry) in 1980 - 10 years after the time we are talking about, but even then the program she used was too big for the main academic computer at Indiana University (she was storing something like 23000 4-byte "double precision" numbers), so her advisor got permission to run her program overnight on the main administrative computer; it didn't have quite as much real memory, but it was equipped with "virtual memory" - that is, the ability to automatically shift contents between real memory and the disk so that the user thought much more real memory was available. And running her program did take that computer almost all night to finish.

At the time I commented "someday computing will reach the point where you could run that program on a computer in our bedroom". She tossed all her stuff as soon as she was done, so we never tested that idea, but a typical home computer of 2000 could have breezed through her program.

BTW - these storage issues are also what led to the Y2K issues, since we routinely saved a byte per date by recording just the last 2 digits of the year.
Subject Author Posted

Oh or O?

KoloradoKid July 23, 2008 06:56PM

Re: Oh or O?

CodyAkin July 23, 2008 07:02PM

Re: Oh or O?

Ed Stabler July 23, 2008 07:07PM

Re: Oh or O?

Jerry Day July 23, 2008 07:12PM

Re: Oh or O?

KoloradoKid July 23, 2008 08:39PM

Re: Oh or O?

Jerry Day July 23, 2008 08:51PM

Re: Oh(m), my ...

Russo Loco July 24, 2008 01:31AM

Re: Oh(m), my ...

Ed Stabler July 24, 2008 05:38AM

Re: Oh or O?

John Craft July 24, 2008 05:22AM

Re: Oh or O?

Jerry Day July 24, 2008 08:01AM

Re: Oh or O?

hank July 24, 2008 12:06PM

Re: Oh or O?

John Craft July 24, 2008 02:39PM

Re: Oh or O?

Randall Hess July 24, 2008 09:07PM

Re: Oh or O?

Tom Richards July 25, 2008 08:26PM

Re: Oh or O?

Herb Kelsey July 26, 2008 04:35PM

Re: Oh or O?

Herb Kelsey July 23, 2008 11:26PM

Re: Oh or O?

Jerry Day July 24, 2008 08:12AM

Re: Oh or O?

OLCO107 July 24, 2008 09:46AM

Re: Oh or O?

Chile John July 24, 2008 10:09AM

Re: Oh or O?

Rick Steele July 24, 2008 01:03PM

Re: Oh or O?

KoloradoKid July 24, 2008 01:02PM

Re: Oh or O?

Jerry Day July 24, 2008 01:49PM

Re: Oh or O?

KoloradoKid July 24, 2008 02:14PM

Re: Oh or O?

Jerry Day July 24, 2008 02:31PM

Re: Oh or O?

KoloradoKid July 24, 2008 03:46PM

Re: Oh or O?

Jerry Day July 25, 2008 07:09AM

OU guys ... OY vey

Steve G. July 26, 2008 12:54PM



Sorry, only registered users may post in this forum.

Click here to login