Computer memory operation

This article was posted for software engineers especially  🙂

For better understanding of computer science.

Hope you enjoy!

The three main components of a complete computing system are: CPU, Memory (RAM / ROM) and I/O. Computers can be found everywhere. Even in traffic signal systems and washing machines. Their purpose is to build computerized control systems, which get information through the input ports, process this information in a premeditated way (which is programmed) and return results through the output ports, thus building countless automated machines that are used everyday, everywhere. RAM in a computer is operating similar to any other controller system.

I/O refers to Input/Output methods whether they are a keyboard and a monitor in a PC, or digital and analog signals from different sensors or to the limbs of a robot. The CPU, Central Processing Unit, or the processor is the main component for doing simple and complex logic and arithmetic tasks, when using given information to process and returning other information as a result, it’s called data processing.

Computer system

The binary system

Memory is for storing data to use it later. Inside the memory circuits data is coded in binary codes (‘0’s and ‘1’s). These binary combinations represent Hexadecimal (base 16) numbers. This is the computer’s only way to understand information. The reason for that is because its elementary building block, the transistor, has only two effective states: ON (‘1’) and OFF (‘0’). Groups of transistors make logic gates that make flip-flops which are the data storing units.

e.g. the code “10001101” is an 8-bit number (as it has 8 digits) that represents the value 0x8D which is 8D in Hexadecimal format which is the number 141.

Dec Binary Hex Character
48
00110000
0x30
0
49
00110001
0x31
1
50
00110010
0x32
2
51
00110011
0x33
3
52
00110100
0x34
4
53
00110101
0x35
5
54
00110110
0x36
6
55
00110111
0x37
7
56
00111000
0x38
8
57
00111001
0x39
9
58
00111010
0x3A
:
59
00111011
0x4B
;
60
00111100
0x3C
<
61
00111101
0x3D
=
62
00111110
0X3E
>
63
00111111
0x3F
?
64
01000000
0x40
@
65
01000001
0x41
A
66
01000010
0x42
B
67
01000011
0x43
C
68
0100100
0x44
D

There are two types of memory that are an integral of a computer system:

RAM (Random Access Memory)

It’s called “Random access” because the CPU reads and writes it randomly. It’s useful because the processor is always working with information, therefore it has to store it somewhere to “remember” it for a short period, because otherwise it won’t  know what the information is when moving from task to task. The memory can be configured at any time, usually the processor would store information (that was “read” as an input for example) and make changes to it, then it can store the new information in a different space or replace it.

What is ram used for

RAM is a memory space for the processor to store information for a short time during real time processes. It’s used to store data for a short amount of time, and if the system is reset then all of the data in the RAM is erased.

ROM (Read Only Memory)

ROM stores the CPU’s program. like a “list of tasks” that cannot be erased or reprogrammed (for the most part while the machine is working). There are micro-controllers and processors that use EPROM(Erasable and Programmable ROM), that allows to configure their program from time to time by burning it to them. The processor reads them and follows them one after the other. PCs also have ROM that contains critical programs such as the booting firmware and the BIOS.

Memory Units

To understand how memory works we need to discuss the topic on a hardware scale. RAM for instance is made of many small components called “Flip-Flops”. A Flip Flop (FF) is basically a single bit memory unit and can store a single bit (‘0’ or ‘1’). Eight of them together make an 8-bit register that stores one byte of data. From here onward, millions upon millions of these are used to build the computer’s entire RAM. So if your PC has 8GB of memory, can you calculate how many FFs are there? It is 68,719,476,736. 8 Gigabytes are 8,192 Megabytes, that is 8,388,608 Kilobytes, that is 8,589,934,592 Bytes. 

A single FF is made of a few logic gates, which are able to perform basic logic tasks like “OR”, “AND”, “NOT”, and so on. 

Please refer to the table to see the common logic gates and their function:

Logic gates Electronics

Below is a simple FF that’s made of two NOR Gates. It has two inputs and two outputs (an input can be ‘0’ or ‘1’, so does the output).

The video above shows the function of this circuit using two LEDs to make its outputs visible. The LED is on when the output is ‘1’. The output Q represents the state of the FF, while the other output is “not Q” (Q), is the opposite of Q. At the beginning the red LED, which represents Q, was on. That means its state was Q = ‘1’ and Q = ‘0’. When I touched the wire connected to input A it became grounded through the floor I was standing on via my feet. In other words, it got the input ‘0’ when it was unconnected before. Then the FF changed its state: the white LED turned on, and stayed on. This happens because the output Q turns its state to ‘1’ and because it’s connected to the input of the top gate, resulting in a constant “01” on it, making it turn to Q = ‘0’. Q is connected to the bottom gate forcing a constant “00” on its inputs, making it stay ‘1’. And the cycle repeats.

An example of an Set/Reset Flip-Flop (SRFF) and it’s table of truth:

SRFF flip flop
SRFF flip flop

Set/Reset Flip Flop with clock (SRFF)

Memory structure:

To properly read and write data to and from the memory it’s essential to construct it in an effective method to have order. The order is a matrix of FFs. In a 64-bit system consisting of 8GB of RAM, for example, is as follows: 64 FFs are on every row, so it makes every row a 64-bit register. A register is a group of FFs, and it can store one number. The number of rows is 1,073,741,824 forming a 64×1,073,741,824 matrix. The number of rows is also the number of addresses. Moreover, the number of the accessible addresses depends on the width of the register (64 bits in this case), because the address register is also 64 bits long. Therefore the maximum number of addresses is 264.

IOT in smart cities

Internet of Things for Smart Cities

Computer memory. what is it? here we explain the most basic things about computer memory, the types of computer memory , how it operates and even how it looks inside, have a quick look and become aware of the coolest things about computer memory.

Read More »

Experts concerns with Artificial intelligence

Computer memory. what is it? here we explain the most basic things about computer memory, the types of computer memory , how it operates and even how it looks inside, have a quick look and become aware of the coolest things about computer memory.

Read More »

Computer memory operation

Computer memory. what is it? here we explain the most basic things about computer memory, the types of computer memory , how it operates and even how it looks inside, have a quick look and become aware of the coolest things about computer memory.

Read More »