Memory Representation
- Bits and Bytes:
- The basic unit of memory is
a bit, which can store a single binary value (0 or 1).
- A group of 8 bits is called
a byte, which is commonly used to represent
characters, numbers, and other data types.
- Memory Addresses:
- Each memory location has a
unique address that allows the processor to locate and retrieve
data.
- Addresses are typically
expressed in hexadecimal format (base 16)
Example:
Imagine a small memory with a capacity
of 16 bytes:
The
addresses would range from 0x00 to 0x0F (0 to 15 in decimal).
If
a variable named "age" is stored at address 0x05, the CPU would
use this address to read or write its value.
- Memory Types:
- Primary Memory (Main
Memory):
- Directly accessible to the
CPU.
- Volatile (loses data when
power is turned off).
- Commonly used types
include:
- RAM (Random Access Memory)
- ROM (Read-Only Memory)
Note: While
ROM shares some characteristics with primary memory, such as direct CPU access and persistent data storage, its read-only nature distinguishes it from the dynamic role of
RAM in managing running programs. Therefore, it's more accurate to consider ROM as a special type of non-volatile
memory that occupies a unique space
between primary and secondary storage.
- Secondary Memory (Auxiliary
Storage):
- Non-volatile (retains data
even without power).
- Used for long-term storage.
- Examples include:
- Hard disk drives (HDDs)
- Solid-state drives (SSDs)
- Optical drives
(CDs, DVDs)
- Flash drives
No comments:
Post a Comment