Posts tagged ‘hard disk drive’


The 64-bit Difference

I was just reading about the limitations of the WAV audio format.

The WAV format is limited to files that are less than 4 GB in size, because of its use of a 32-bit unsigned integer to record the file size header (some programs limit the file size to 2–4 GB). Although this is equivalent to about 6.8 hours of CD-quality audio (44.1 KHz, 16-bit stereo), it is sometimes necessary to exceed this limit, especially when greater sampling rates or bit resolutions are required. […] Its 64-bit header allows for much longer recording times.

I got to thinking about computer memory and the difference in capacity between N-bit systems. A computer uses an address to access different parts of the memory. The address consists of numbers (internally, ones and zeros), which for a 32-bit system (where the addresses always have a length of 32 bits) would look something like “af34c97b” written using a radix of 16. A 32-bit uses these addresses to look up places in the memory. Each address stands for a certain byte in the memory, so obviously if we only have addresses with 32 bits, we can’t look beyond the address with 32 ones in a row since that is the maximum value 32 bits hold.

Think of when you’re mailing a letter: you can mail the letter to anyone you want using only two numbers for the house or apartment number. You would be able to send it to (0)1-99 Blah Blah St., but not to the guy living at the end of the street at no. 100. Memory addresses work in the same way.

Let’s do some math now. Say your system is working with 32-bit memory addresses. That means the largest value we could have (the farthest down the street we would be able to send the letter) would be 1111 1111 1111 1111 1111 1111 1111 1111, or FFFF FFFF in hexadecimal numbers. Let’s write this figure out in a format that we’re more familiar with, such as Gibibytes (GiB) or as it is more incorrectly known as: Gigabytes (GB). 1 GiB = 1024^3 bytes; 1 GB = 1000^3 bytes.

FFFF FFFF in GiB is 2^32 / 1024^3 = 2^32 / (2^10)^3 = 2^32 / 2^30 = 2^(32-30) = 2^2 = 4 GiB.

You might have heard already that 32-bit systems only can handle 4 GiB of memory, and now you hopefully know why if you didn’t already. Now then, what happens if we double that number, and make it a 64-bit system?

FFFF FFFF FFFF FFFF in GiB would be 2^64 / 2^30 = 2^34 = 17179869184 GiB, or 16 Exbibyte (EiB). A MASSIVE amount of memory. As you can see, with a double increase in address size, we do not get a doubling of the memory space, but rather a number that is the number of bytes in 4 GiB to the power of 2. 4 GiB = 4294967296 Bytes, and 16 EiB = 18446744073709551616 bytes. These numbers are obviously incomprehensible. So I thought it would be easier to demonstrate them with an example, regarding the Wikipedia article quoted at the top of the article.

As the quote says, a 4 GB (actually GiB) WAV file (with file size header of 32 bits) would give us 6.8 hours of music with a sampling rate of 44.1 kHz, a bit depth of 16 bits and 2 channels (stereo).

If we assume the file size is proportional to the playing time of the audio file if the quality specifications remain the same, then we can calculate the playing time of a WAV file with file size header of 64 bits:

17179869184 [GiB] * (6.8 [hours] / 4 [GiB]) [hour-to-filesize ratio] = 29205777612.8 hours of music.

This number is still incomprehensible so let’s walk up the ladder of time units, shall we? Note that when calculating the amount of years, we will use a year length of 365.2425 days, which is the arithmetic mean of amount of days in a year in the Gregorian Calendar, which has a 400-year cycle and 146 097 days: 146097 / 400 = 365.2425 days. This is to take leap years into account. One could also use a day length of 24 hours and 58.3594503 seconds, but that doesn’t feel as nice, somehow.

29205777612.8 hours
= 1216907400.533333333 days
= 173843914.361904762 weeks
= 39981351.585316605 months (average of 30.436875 days/month in one 365.2425-day year)
= 3331779.298776384 years

So we see that just by doubling the address space, we go from 6.8 hours of music — which I guess you could plough through on a really dull and long bus ride — to more than 3.33 million years of music.

That, my friend, is the 64-bit difference.

… hmm? What was that about 128 bits? Shut up. 😦

No but really, to fill a 128-bit hard drive, it would more energy than it would to boil the oceans of the earth. Theoretical breakdown. Enjoy.


Bloat Warning

On my system, iTunes and QuickTime take up a combined space of over 180 MiB. That. Is. Crazy.

For a piece of software that I use for nothing else than transferring my songs from one place to another, 180 MiB is an astronomical length. iTunes takes up 106 MiB. The rest is accredited to QuickTime. I don’t even use QuickTime! But iTunes refuses to start without it! I use other free and open-source software to play media than iTunes:

On Ubuntu/Linux:

  • Rhythmbox
  • MPlayer
  • Totem

On Windows XP:

  • Winamp
  • VLC
  • XBMC

That covers all of my media-playing needs. Combined, these players, on each system respectively, play just about every format in existence. And MPlayer, VLC and XBMC are available for multiple platforms, it’s just that they run smoother/more gracefully in my experience on the respective platforms mentioned above that I use.

Back to the matter at hand: As I mentioned, I use iTunes for one reason and only one reason — to transfer songs to my iPod. That task does include fetching album cover art, but I count those two as one task. I don’t play any media in iTunes; no music, no podcasts, no videos or movies, nothing! If I have that kind of setup and needs, why shouldn’t I be able to uninstall the unnecessary modules of the software and save some space? I mean I can understand iTunes. It has quite a lot of features, and I assume that all drivers for every single product that iTunes supports comes with the installation of iTunes, but it doesn’t have to be that way!

Alternative #1

Imagine that you just bought a device from Apple. Let’s say it’s a new iPhone.

As soon as you plug in the iPhone for the first time after installing iTunes, iTunes recognizes that you have a new device and suggests to download the necessary drivers, or whatever it needs, to be able to work with your iPhone. Perhaps installing them as plugins, or integrating it with the software in some other way. BRILLIANT. Now, for any other features I like to use in iTunes, enabling them as I go.

Alternative #2

You just bought a new iPod Nano 16 GB (like I have), for example, and you go to the download page for iTunes to download and install the necessary software.

Upon installing iTunes, you are given — oh, I don’t know — OPTIONS REGARDING WHAT YOU WANT TO ACTUALLY INSTALL, as so many other installers do for other software. Then in those options it might say something like “I would like to be able to play music and video”, perhaps separating music and video into two options, and selecting those options would install QuickTime as well (although it’s ~75 MiB is inexplicable to me).

Alternative #3

Release the module that transfers content between hard disk drive and device as a stand-alone application! I understand that you need some type of technology to recognize which types of media can be transferred and played on the actual device, but that doesn’t imply that you also need the technology to play the media before you transfer it to where you actually want to play it.

That was a little messy, so let’s illustrate with a helpful and suitable analogy: You don’t need to take a bite out of the apple to realize it’s an apple! Otherwise I assume people would look at you strangely whenever you go to the grocery store for example. Sampling all the apples before you pick them up.

At the very least, iTunes should include some install-time options. I’m not really sure, but as far as I can remember, I couldn’t even select where I wanted to install it.