|
HAVE YOU EVER WONDERED why the number 65,536 comes up so often?
For example, why are there exactly 65,536 ports in the Windows operating system? Why are there exactly 65,536 vertical cells in Excel? Why is 16 bit color exactly 65,536 colors? Who decided this, or was it completely arbitrary?
No, it wasn’t arbitrary. Here’s the answer: 65,536 is the product of 2 to the power of 16. Why use this particular product? Because it is the largest number that can be expressed by 2 eight-bit bytes of data. Therefore, if a programmer assigns 2 bytes to hold a given positive integer (whether that integer is a processor address in a supercomputer or a line on a spreadsheet) 65,236 will be as large as it can get.
Powers of 2 crop up all over computing. 8 bit audio is jaggied up to 256 (2 to the power of 8) steps; a megabyte is 1,048,576 (2 to the power of 20) bytes; an NTFS volume can hold 4,294,967,295 files (2 to the power of 32 minus 1); standard 24 bit color is 16,777,216 (2 to the power of 24) colors.
Now you know.
[I didn’t figure this one out on my own, but I did wonder about it.. Thanks to Dan’s Atomic I/O Data, column #54 (11/13/07)]
|
|