The only way the computer knows that a memory location is an instruction is that a special-purpose register called the instruction pointer points to them at one point or another. If the instruction pointer points to a memory word, it is loaded as an instruction.
RAM and ROM The chips that make up a computer's internal memory come in two broad flavors known as RAM (random access memory) and ROM (read-only memory). RAM chips remember things only while a computer is powered on, so they're used for storing whatever a computer is working on in the very short term.
Text is stored on a computer by first converting each character to an integer and then storing the integer. For example, to store the letter `A', we will actually store the number 65; `B' is 66, `C' is 67, and so on. The conversion of letters to numbers is called an encoding.
In a computer, the memory address register (Oct) is the CPU register that either stores the memory address from which data will be fetched to the CPU registers, or the address to which data will be sent and stored via system bus.
I guess this isn't strictly "programming", but I've been pondering this for a little while. When you create a variable and assign it a value, the computer allocates a certain number of bytes for said variable and stores the value, but how does it know what type of data is in that memory address when it comes back to use it later?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With