7

I am teaching the course "Introduction in Programming" for the first-year students and would like to find interesting examples where the datatype size in bits, chosen by design, led to certain known restrictions or important values.

Here are some examples:

  1. Due to the fact that the Bell teleprinter used 7-bit-code (later accepted as ASCII) until now have we often to encode attachments in electronic messages to contain only 7 bit data.
  2. Classical limitation of 32-bit address space leads to the 4Gb maximal RAM size available for 32-bit systems and 4Gb maximal file size in FAT32.

Do you know some other interesting examples how the choice of the data type (and especially its binary length) influenced the modern IT world.

Added after some discussion in comments:

I am not going to teach how to overcome limitations. I just want them to know that 1 byte can hold the values from -127..0..+127 o 0..255, 2 bytes cover the range 0..65535 etc by proving examples they know from other sources, like the above-mentioned base64 encoding etc. We are just learning the basic datatypes and I am trying to find a good reference for "how large" these types are.

3 Answers3

8

IPv4 is a very good example where a limited spec size caused a very expensive problem down the line. 4.3 billion addresses just aren't enough anymore. Now ISPs around the world are desparately rolling out IPv6 with a 128-bit address space which translates into an address for every atom in your body or something like that.

Wyatt Barnett
  • 20,787
1

The year 2000 problem was similar, except that people used decimal numbers instead of binary, and encoded just two last digits. This can be a useful example if explaining to someone who has little experience with binary.

FAT12/FAT16/FAT32 were adapted to cover for bigger and bigger storage.

TeX has some interesting properties when representing dimensions (from The TeXBook):

TEX represents all dimensions internally as an integer multiple of the tiny units called sp. Since the wavelength of visible light is approximately 100 sp, rounding errors of a few sp make no difference to the eye. [...]

TEX will not deal with dimensions whose absolute value is 2^30 sp or more. In other words, the maximum legal dimension is slightly less than 16384 pt. This is a distance of about 18.892 feet (5.7583 meters), so it won’t cramp your style.

(pt is a typographic unit approximately equal to 1/72 of inch)

liori
  • 725
0

Microsoft Excel - try to graph more than 32K items. There's got to be a signed 16 bit field in there somewhere. (although they round the limit down to 32000 even for some reason).

AShelly
  • 5,773
  • 32
  • 51