📘 CodingMarble Learn

Computer Memory: Units, Primary and Secondary, Data Recovery

Computers store everything as bits (0 or 1). 8 bits make a byte, and each bigger unit is 1024 times the one before. Primary memory (RAM, ROM, cache) works directly with the CPU; secondary storage (HDD, SSD, pen drive) keeps files for a long time. A deleted file can often be recovered until it is overwritten, so data must be protected.

đŸŽŦ Step-by-step story

  1. Everything is stored as bits: 1 or 0. Eight bits make one byte.
  2. Each bigger unit is 1024 times the smaller one: KB, MB, GB, TB, PB.
  3. Primary memory: RAM forgets when power goes, ROM does not, cache is extra fast.
  4. Secondary storage keeps files for years: hard disk, SSD, pen drive.
  5. Deleting only removes the name. Data can be recovered until it is overwritten.
  6. Your turn: convert any size into bytes and the next smaller unit.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Why is 1 KB 1024 bytes and not 1000?

Computers count in powers of 2. 2š⁰ = 1024 is the power of 2 closest to 1000. (Some disk makers use 1000, which is why a "1 TB" disk shows a little less.)

How does 01000001 mean "A"?

A code table called ASCII gives every letter a number. "A" is 65, and 65 in binary is 01000001.

If ROM is read-only, how is it updated?

Modern ROM is flash (EEPROM) that can be rewritten by a special firmware update, but not during normal use.

Why can't the CPU work directly on the hard disk?

The hard disk is thousands of times slower. The CPU would wait all the time, so data is first copied to RAM.

Is data safe once I empty the Recycle Bin?

No. The blocks stay until something overwrites them. Use a shredder tool or encryption if the data is private.

Memory units: bit to petabyte

A bit (binary digit) is a 0 or a 1. It is the smallest unit.

Why 1024 and not 1000? Because 1024 = 210, and computers count in powers of 2.

How to convert

Going to a smaller unit: multiply by 1024. Going to a bigger unit: divide by 1024.

Primary memory

Primary memory is the memory the CPU uses directly. It is fast but small.

Secondary memory (storage)

Secondary memory keeps data for a long time. It is non-volatile, large and cheap, but slower. The CPU cannot use it directly; data is first brought into RAM.

Primary vs secondary

Primary: fast, small, costly per GB, mostly volatile, used directly by CPU. Secondary: slower, large, cheap per GB, non-volatile, used for saving.

Data deletion, recovery and security

When you delete a file, it usually goes to the Recycle Bin first. Even after emptying it, the computer only removes the file's entry from its list and marks the space as free. The actual bits stay until new data is written there.

Data recovery means getting back deleted or lost data using special tools. It works only if the space has not been overwritten.

This is a risk: if you sell an old phone or pen drive, someone could recover your photos.

Keeping data safe

Try it: size detective

Open your phone's storage settings. Note the total (like 64 GB) and how much photos use. Convert the photo size to MB (×1024). Then in step 6 of the 3D, set the same number and unit and check your answer.

Key formulas and definitions

Worked examples

1. How many bits are in 2 KB?

2 KB = 2 × 1024 = 2048 bytes. 2048 × 8 = 16384 bits.

2. A pen drive is 4 GB. How many MB is that?

4 × 1024 = 4096 MB.

3. Convert 3072 KB into MB.

3072 Ãˇ 1024 = 3 MB.

4. How many bytes are in 1 GB?

1 GB = 1024 × 1024 × 1024 = 1,07,37,41,824 bytes (2Âŗâ°).

5. A photo is 2 MB. How many fit on a 1 GB card?

1 GB = 1024 MB. 1024 Ãˇ 2 = 512 photos.

6. Rita emptied the Recycle Bin by mistake and has not used the laptop since. Can she get the file back?

Probably yes. Only the entry was removed; the data is still there because nothing has overwritten it. A recovery tool can find it. She should stop saving new files until then.

Common mistakes

Practice quiz

1. 1 byte equals:
2. Which memory loses data when power is off?
3. 1 TB equals:
4. Which is secondary storage?
5. A deleted file can be recovered as long as:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between RAM and ROM?

RAM is read-write and volatile (loses data without power). ROM is mostly read-only and non-volatile (keeps start-up code).

What is the order of memory units?

Bit, nibble, byte, KB, MB, GB, TB, PB, EB, ZB, YB. After byte, each is 1024 times the previous.

Can deleted data be recovered?

Often yes, using recovery software, as long as the space has not been overwritten by new data.

Where this is taught

CBSE (India)Class 11Introduction to Computer System
England (GCSE, A level)Year 124.7 Computer organisation and architecture

Learn first

Learn next

Related lessons

All Informatics Practices lessons