Unit 1 · Lesson 118 minAcademic review pending

How a computer remembers numbers

Build a useful mental model of the processor, memory, operating system, and binary representation.

Choose explanation

After this lesson

You should be able to

  • Explain what the CPU, memory, storage, and operating system each do.
  • Convert small positive integers between decimal, binary, and hexadecimal.
01

The working desk model

Imagine the CPU as a fast worker and RAM as the worker's desk. The CPU follows instructions and transforms data. RAM holds the instructions and values being used right now. Storage keeps files after power is removed, while the operating system coordinates programs, memory, files, and devices.

A compiler translates C source code into machine instructions the processor can execute. That translation is why a C program must be compiled before it runs.

02

Bits, bytes, and bases

A bit is either 0 or 1. Eight bits form a byte. Decimal uses powers of 10, binary uses powers of 2, and hexadecimal uses powers of 16. Hexadecimal digits run from 0 to 9 and then A to F.

To read 1101₂, add the place values that contain 1: 8 + 4 + 1 = 13₁₀. Grouping binary into four-bit chunks gives hexadecimal quickly: 1101₂ is D₁₆.

Try it yourself

Convert decimal 26 to binary and hexadecimal. Then name where a running program's current values are normally kept.

Need a hint?

26 = 16 + 8 + 2. Mark those binary place values.

Check the worked solution

26₁₀ = 11010₂ = 1A₁₆. A running program's current instructions and values are normally held in RAM.

Quick check

Which component keeps a document after the computer is switched off?

Select an answer to check your thinking.

Why this lesson exists

Syllabus mapping

Computer system components · Memory and processors · Operating systems · Number systems

Maps to course outcomes CO1, CO2.