C language learned by suffering
C language learned by suffering
Memory Mechanism
Memory?
The word memory is familiar to anyone interested in computers.
It is in this memory that the computer's data is stored.
Even those who are not familiar with computers have heard of them.
That's enough for the average person's computer knowledge.
When programming, it is not enough.
How does memory store data?
It is necessary to have a solid understanding of this.
That said, I have no intention of explaining the structure of CMOS.
What is important is not the hardware mechanism, but the software concept.
What kind of mechanism does memory use to store data?
And I will explain in what way memory is handled in the program.
It is in this memory that the computer's data is stored.
Even those who are not familiar with computers have heard of them.
That's enough for the average person's computer knowledge.
When programming, it is not enough.
How does memory store data?
It is necessary to have a solid understanding of this.
That said, I have no intention of explaining the structure of CMOS.
What is important is not the hardware mechanism, but the software concept.
What kind of mechanism does memory use to store data?
And I will explain in what way memory is handled in the program.
Super huge single row lockers
There are so many electronic components built into the memory that
Each one of them has its own state of being.
state, i.e., on or off.
And if the state of the electronic component is on, it's a 1, if it's off, it's a 0, and so on.
Each component remembers whether it is a 1 or a 0.
This structure is, to use an analogy, like a very large single-row locker.
The number cannot be more than a sensible number, such as 10 or 100.
A computer with 64 MB of memory would have over 500 million lockers in a row.
And those lockers are numbered.
Each locker also has a status of luggage.
Count as 1 if there is luggage in the room and 0 if there is no luggage in the room.
All numbers are stored as a combination of 1s and 0s.
In short, computers store numbers in binary.
Each one of them has its own state of being.
state, i.e., on or off.
And if the state of the electronic component is on, it's a 1, if it's off, it's a 0, and so on.
Each component remembers whether it is a 1 or a 0.
This structure is, to use an analogy, like a very large single-row locker.
The number cannot be more than a sensible number, such as 10 or 100.
A computer with 64 MB of memory would have over 500 million lockers in a row.
And those lockers are numbered.
Each locker also has a status of luggage.
Count as 1 if there is luggage in the room and 0 if there is no luggage in the room.
The computer will fill this locker with luggage and memorize the numbers.
All numbers are stored as a combination of 1s and 0s.
In short, computers store numbers in binary.
Bits of CPU
You have probably heard of the word " bit" as well.
The computers we use today are 32-bit.
Right now (at the time of writing), there's a lot of talk about AMD's 64-bit CPUs.
It will be a long time before we, the general public, will be using them.
**As of 2017, 64-bit is the norm*.
By the way, what exactly are these bits?
In fact, it is very closely related to memory, which is the theme of this issue.
Earlier, we explained that memory is a very large single row locker.
I then explained that the numbers are recorded as binary numbers.
But since all this data is recorded in binary numbers, it's not
It is very troublesome to exchange data one by one.
So, everyone comes up with a way to use several of them at once.
For example, if you were to group eight of the data in memory together, you could use
Binary numbers in the range 000000000000 to 1111111111, i.e.
In decimal, it can be calculated using numbers in the range 0-255.
This seems like a pretty decent calculation.
As some of you may have already noticed, you are right.
The number of binary digits of memory that the CPU handles at one time is the number of bits.
When a CPU says something like how many bits, it usually means that.
However, some CPUs can calculate more than that number of bits at once with special instructions.
Note that one bit means one binary digit.
In the case just described, this means that the processing unit of the CPU is 32 bits.
The computers we use today are 32-bit.
Right now (at the time of writing), there's a lot of talk about AMD's 64-bit CPUs.
It will be a long time before we, the general public, will be using them.
**As of 2017, 64-bit is the norm*.
By the way, what exactly are these bits?
In fact, it is very closely related to memory, which is the theme of this issue.
Earlier, we explained that memory is a very large single row locker.
I then explained that the numbers are recorded as binary numbers.
But since all this data is recorded in binary numbers, it's not
It is very troublesome to exchange data one by one.
So, everyone comes up with a way to use several of them at once.
For example, if you were to group eight of the data in memory together, you could use
Binary numbers in the range 000000000000 to 1111111111, i.e.
In decimal, it can be calculated using numbers in the range 0-255.
This seems like a pretty decent calculation.
As some of you may have already noticed, you are right.
The number of binary digits of memory that the CPU handles at one time is the number of bits.
When a CPU says something like how many bits, it usually means that.
However, some CPUs can calculate more than that number of bits at once with special instructions.
Note that one bit means one binary digit.
In the case just described, this means that the processing unit of the CPU is 32 bits.
32-bit locker
We have explained that the CPU handles several pieces of data in memory at once.
And most current computers handle 32 at a time.
This is why we call them 32-bit computers.
From this point forward, we will proceed on the assumption that these 32 bits are used.
A 32-bit computer handles 32 pieces of data at once.
In other words, a very large single-column locker can be used to sort 32 pieces at a time.
In reality, however, they are sorted into eight pieces, each numbered.
Segmenting data into 8 pieces each means that memory is handled in 8-bit units.
Eight bits, also known as a byte, is the basic unit of measurement in computers.
This is because 8 bits are convenient for handling a variety of data.
Because 8 bits can represent a number from 0 to 255, they are ideal for storing relatively small numbers.
Also, for computers that operate in binary numbers, 8 bits is a good place to start.
Because of these circumstances, the actual handling of memory in a computer is
The lockers are grouped into eight units of eight lockers each, and the numbers are assigned as one unit of eight lockers.
In 32-bit computers, this is assigned a number within the 32-bit range.
Within 32 bits means, in other words, in binary
and can handle 8-bit numbers up to about 4.2 billion in decimal.
And most current computers handle 32 at a time.
This is why we call them 32-bit computers.
From this point forward, we will proceed on the assumption that these 32 bits are used.
A 32-bit computer handles 32 pieces of data at once.
In other words, a very large single-column locker can be used to sort 32 pieces at a time.
In reality, however, they are sorted into eight pieces, each numbered.
Segmenting data into 8 pieces each means that memory is handled in 8-bit units.
Eight bits, also known as a byte, is the basic unit of measurement in computers.
This is because 8 bits are convenient for handling a variety of data.
Because 8 bits can represent a number from 0 to 255, they are ideal for storing relatively small numbers.
Also, for computers that operate in binary numbers, 8 bits is a good place to start.
Because of these circumstances, the actual handling of memory in a computer is
The lockers are grouped into eight units of eight lockers each, and the numbers are assigned as one unit of eight lockers.
In 32-bit computers, this is assigned a number within the 32-bit range.
Within 32 bits means, in other words, in binary
and can handle 8-bit numbers up to about 4.2 billion in decimal.
About this Site
The C language (bitter C), which is learned by suffering, is
This is the definitive C language introductory site.
It systematically explains the basic functions of the C language and
It is as complete as or better than any book on the market.