Memory and the overflow problem

 Secondary Memory - 

We know how a main memory functions and works ( https://cs-weekly.blogspot.com/2024/03/bits-memory-and-vlsi.html ). 

However to retrieve the data into main memory , a secondary memory is required to fetch the data from, and the data is usually large in terms of capacity.

Secondary memory comes in various forms - hard drive, solid state drive , compact drive(CD), digital versatile disc (DVD).

Lets have a look at their individual architecture -

Hard drive - 

A hard drive works on the principle of the disc data storage in which data is encoded in the layers of the disc and a read/write head is present for the data  related operation. The data is present on the arcs called as tracks and the outer tracks of the disc usually have large storage capacity.

In order to perform the operations on the track outer side, the disc performs operations according to the data and is called as zoned bit recording.

A hard drive have these following attributes -

1] Seek time - It is the amount of time required for the data to be entered into disc or retrieved from the read/write head.

2] Rotation delay - It is the half the time that a disc take to complete one rotation.

3] latency - sum of seek time and rotation delay.


Optical Drive (CD and DVDs) -
The only difference between the hard drive and optical drive is that the hard disc uses a magnetic head to read and write data whereas the optical drives uses a laser beam. Apart from that Hard drive has moving parts like spinning platters and read/write head. Optical disc does not have a moving part only the disc rotates.
Also hard drive supports large amount of data whereas DVD and CD doesn't and it makes storage and access to the data a bit difficult in case of optical drives. Hence Optical drives are used for specific purpose and specific data rather than storing whole data.
That's why for high definition video format , blu-ray discs are available which supports storage upto 100 GB.
Moreover, optical drives are used as a medium to transfer the data rather than actually storing.

Lets look at the following analogy -

PS2 vs PS5 -
Games of the PS2 generation of console used to be of smaller size when compared to modern video games that usually starts from 70 GB for a big title. However the old generation big titles used to be maximum of 20 GB 10 years ago and in order to play the game you just needed to insert the disc.

Nowadays, the modern video game disc usually acts as a way to authorize whether the game is a genuine copy and not the pirated one. Once the disc is inserted it doesn't have the whole game but just setup and authentication steps and the data is transferred directly to the storage of the console which are of 512 GB or 1TB.

Flash Memory (Solid State Drive SSDs) -

The principle of flash memory revolves around the use of floating-gate transistors to store data. In a flash memory cell, electric charge is trapped within a floating gate, altering the transistor's conductivity and thereby storing binary data (0s and 1s). Unlike volatile memory such as RAM, flash memory retains data even when power is removed, making it suitable for non-volatile storage applications like USB drives, solid-state drives (SSDs), and memory cards. Flash memory can be erased and reprogrammed electrically, allowing for multiple write cycles, although there are limitations to the number of erase/write cycles a cell can endure before becoming unreliable.
 
The Overflow Problem - 

Data stored in the computer has limits, overflow is the problem that occurs when a computation produces when the value falls outside the range of values that can be represented. When storing the data which is integers , the computer uses two's complement form which earlier had 16 bits capacity. However, modern day computer uses as large as 32 bits for integers to accumulate before overflow.

On September 19 1989, a hospital computer system malfunctioned after years of reliable service. Close inspection revealed that it was 2^15 days after January 1900 and the computer was programmed to store dates up to 2^15 bits. It thus produced a negative value.  


Comments