How Memory Works ?
When the cave paintings were discovered, it paved the way to understand how primitive humans used to image and pass on the information through images and actions more than something textual. Textual information is highly based on common logic of interpretation. Early man would describe it as series of actions like a Nolan movie but with a simplistic approach, but still it enabled us to time travel to the ancient time. Computers don’t have pictographic memory. These are dumb machines which works on electricity passing through sands of time.
Looks like a history lesson a bit. Let’s jump onto the real thing. Question to answer here is how computer processes and stores information ?
Let’s look at the above numbers. What’s the value here? Ten million one thousand and ten. Now how we actually interpreted this? We jumped to the conclusion because we have been using the system to pay pizza and toys. This number system is what we have decided and is in use — Base-10 system.
The value at each position is multiplied by the 10 and the power of 10 depends upon it’s position from right side and final answer is obtained by adding them up as given below. We have deduced our result mentally without going through the original steps of computation.
Now as humans have ten fingers and we find it easier to calculate in terms of 10s. In computer we have electrical signals — On/Off , 0/1, high and low voltage etc. These boxes can be considered a single unit cell which can be made from a pack of transistors (SRAM) or capacitor ( DRAM ).
This cell stores 1 bit of information. Let’s compare this to 10-base system. Suppose we have one blank space or a box. How many different values we can fill for base 10 — TEN i.e. 0 to 9. Now in base-2 system we can fill it with 2 values — 0 or 1. Our computers work in this base 2 system only.
If we have 1 such box, we can store 2 values from range 0 to 1. If we have four boxes, we can store 4 values from range 0 to 3. So if we are given ’N’ such boxes then -
1. How many values we can get ? — 2 to the power N.
2. Range of value ? — 0 to 2 to the power N-1 [ Because we are counting 0 here as well ]
If your system has 4GB of RAM that means we have 2 to the power 8 [ bits ] + 10 [ Kilo ] + 10 [ Mega ] + 10 [ Giga ] + 2 [ that’s how we get 4 ] these such boxes.
Moving forward we will talk about instruction set. The method revolved around logically breaking bits and adding a meaning to it.
Here in this example imagine I have 4 bit counter which defines some random stuff. If I show you 0 00 0 — What is the interpretation ? We can say “ You are happy to get ready at the start of the day ”. If I give you some other bits of word, there will be some interpretation. Similarly a 64 bit instruction set has 64 bits to define some operations which we call micro-operations. These are some basic operations such as load, execute, branch etc along with the memory addresses where the operands are stored. Since memory addresses can also be represented in binary format. The more the number of bits, the more operations we can handle and more memory addresses we can access. When we have defined all such instructions using combination of binary digits, we call it instruction set. It defines what a computer can perform and what it can’t. Simpler the instruction-More instructions it will require to perform certain set of tasks-Longer will be the programs/procedure. Complex the microinstructions-Efficient in performing multiple ops in one go-Enable use of microprogramming. This is the basic definition of RISC and CISC architecture which we will cover in another blog.