Skip to main content

Why memory capacities are always in powers of two?







This has to do with how memory is adressed.
To retrieve or store a word in memory, you needs to specify where to/from. This is called adressing.
Memory addresses are binary numbers: using an n-bit address, you can uniquely specify exactly 2n memory locations. Thus, choosing a non-power of two as your memory size will result in either wasted space or invalid adresses.

For instance, say you choose to go for example
for a 43 byte RAM, and assume you address the locations 0 to 42. You can either choose a 5-bit adress, in which case locations 32-42 will go unused (5 bits can address only 32 locations); or a 6 bit address which covers the entire memory but leaves invalid memory addresses in the range 43-64 (6 bits address 64 locations).
Thus, since the address space by definition is always a power of two, memory is always rounded out at powers of two to avoid complications.

Comments

Popular posts from this blog

Video format explained and compared

 This article explains main video formats and later compares with photos the quality. Audio Video Interleave (.avi) Developed by Microsoft and released with Windows 3.1 way back when false teeth were still made out of wood, AVI files have been a work horse of digital video. Although its popularity has been waning, lots of legacy video in AVI can be found all over the web. More recently, AVI has been abandoned for Microsoft's WMV (Windows Media Video). One of the most maddening things about AVI today is that the format doesn't allow for specifying an aspect ratio, so a 16:9 AVI video may start displaying at 4:3 - this is less of a problem if your player allows you to manually select aspect ratios. If you're watching in the non-pro version of QuickTime though, you'll have to learn to live with people being unusually narrow. Advanced Systems Format (.asf) ASF is a proprietary Microsoft container that usually houses files compressed with Microsoft's ...

After Effects Alternative

Pro editing. Superpowered visual effects. Next-generation films. Editing Trim, ripple, roll and slice everything from feature-length films to 30 second YouTube videos, with HitFilm Pro’s industry standard editing software. Create 3D title sequences for your sci-fi thriller, distort action cam footage and get a hi-res second monitor preview of your work. Editor Get that rough cut looking sharp with HitFilm Pro’s dedicated editing trimmer, customizable workspace and shot-transition features. You can mix different formats, resolutions, framerates all on the same timeline and quickly import and organize your footage. Auto sync Tired of turning your characters into ventriloquists? With the much-requested audio auto-sync feature, your DSLR scratch audio will automatically synchronize with your files from a dedicated audio recorder. No more awkward sound delays. 3D titling Draw your audience in with 3D title sequences and stunning lower thir...

How video compression works

What is compression? Compression  is a reversible conversion  (encoding)  of data that contains fewer  bits. This allows  a more efficient storage and transmission of the data. The inverse process is  called  decompression (decoding). Software  and  hardware that can encode  and decode  are  called decoders. Both combined  form a codec and should not be confused with the terms data container or compression algorithms. Lossless compression  allows a  100% recovery  of the  original data.  It is usually used  for text or executable files, where a  loss of information is  a  major damage. These  compression algorithms often use  statistical information to reduce redundancies.  Huffman-Coding [1] and  Run Length Encoding  [2] are two popular examples allowing high compression ratios depending on the data.  Using  lossy compression  doe...