Monday, 20 January 2020

memory - Why does everything in computing work with a base number of 2 to the power of x?



  1. Flash-drive sizes (increase by powers of 2)

  2. RAM size (increase by powers of 2)

  3. 32bit, 64bit, 128bit (increase by powers of 2) etc...


Can someone explain this, I think it might have something to do with device compatibility and also binary code in which case could you explain why these devices have to follow this binary code sequence ?


Also, how many fingers do computers have?



Answer



Digital electronics used in computers have two states: on and off. So storage of numbers in memory is made up of collections of elements each of which is on or off.


So one element can therefore only represent the numbers 0 and 1 (two values).
If you combine two of these you can now represent 2 to the power of two (four) numbers 0…3.



  • off, off = 0

  • off, on = 1

  • on, off = 2

  • on, on = 3


If you have three elements you can represent two to the power of three (eight) numbers 0…7.



  • off,off,off = 0

  • off,off,on = 1

  • off,on,off = 2

  • off,on,on = 3

  • on,off,off = 4

  • on,off,on = 5

  • on,on,off = 6

  • on,on,on = 7


And so on.


The element might be a switching transistor or something equivalent which is in an on or an off state, it could be a tiny patch of hard disk surface that is magnetised parallel or perpendicular to the direction of rotation (two states).


Hence everything naturally is organised in powers of two.


We only use powers of 10 because we have ten fingers (including thumbs), Computers don't.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...