A computer memory (called main memory) can be thought of as a stack of fixed sized boxes. There are fixed number of boxes present in a memory. Each location of a box is called its address. We can store a fixed number of bits in each box (typically 8). Naturally, for a processor to understand a command the manufacturer decides the format of these commands. A command (or an instruction) is typically a combination of a code and data. Code instructs the processor what to do with the data. For example, addition of 2 to 3 could be achieved by instructing the processor to execute the code specified for addition and the data would be composed of 2 and 3.
Data come in various sizes and formats, and so do the operation codes. Naturally, the manufacturer decides to characterize data (we can consider operation codes to be data too). So, typically, we come across data types, ie, types of data. Eight bits can be considered as a byte (or a char); 2 (or 4 or more) bytes may be considered constituting a ‘word’ (sometimes called an int); similarly there are data types of greater length.
Considering only the sizes is not sufficient. We need to decide, for example, how to differentiate negative and positive integers (int).
Going back to the history of mathematics, the concept of integers came much later. We first used whole numbers, numbers that exists in nature. These are 1, 2, 3, 4 and so on. We consider 0 to denote non-existence of an entity. If we remove (subtract) 3 apples for a collection of 3, we get none (0 apples). But, what if we want to have our 4 apples back from a person who has borrowed them from us, and what if he has only three. Subtracting 4 from 3 results in a borrow of 1 apple (remaining to be procured). Mathematicians termed it -1. Thus came the concept of integers, ….-4, -3, -2, -1, 0, +1, +2, +3, +4, +5, … .
Subscribe to:
Post Comments (Atom)
0 Response to "Main Memory"
Post a Comment