(It's an electrical switch: it can be "off" or "on")
We will discuss various encoding methods later...
So a byte can represent only a set that has a small number of distinct values, such as:
The computer will only represent a subset of integers
Larger memory cells are needed to represent larger value sets of integer values.
|
Typical restrictions:
There are no markers in the memory to denotate where the address item are located and how big they are (how many bytes are used to hold the value of the item - short: 2 bytes, int 4 bytes, etc) !!!
The compiler will find an unused portion of consecute memory bytes to store the variable.
In addition, the starting location (= address) of the allocated memory and the size (number of bytes) are remembered by the compiler.
Schematically:
in its symbol table variable
(Remember, the compiler is a program and a program can have variables... The symbol table is one of the many variables used to write a compiler...)
Variables in a program can be "created" (begins to exists) and be "destroyed" (ceases to exists).