Computer memory is divided into primary and secondary memory. Primary memory, like RAM, allows direct access by the CPU and is volatile. Secondary memory, like hard disks, is permanent but requires accessing through primary memory. RAM is temporary memory that stores active data and instructions, while ROM contains permanent, unalterable instructions for starting the computer. Secondary memory devices store data permanently and include hard disks, CDs, DVDs, USB drives, and cloud storage. Data is represented digitally using bits and bytes as basic units, with kilobytes, megabytes, and gigabytes as larger units to measure larger amounts of stored data.