Skip to main content
SWStudyWalks Search

Computer Systems

The narration between entries paraphrases; it never reads an entry aloud before the entry plays. Every entry in this lecture plays exactly as it does on its own page — same file, same speed, nothing laid over it.

What you can do after this

  1. Say why a string of bits carries no meaning by itself
  2. Say what two's complement fixed that the earlier attempts did not
  3. Say what the memory wall is, and how the hierarchy answers it
  4. Say what a computer loses when the power dies, and what it keeps
  5. Say what pipelining does to instruction execution

What it covers

29 entries in 10 topics. Each number links to that entry on its own.

  1. 1. What a system is

  2. 2. The ladder, and three requirements

  3. 3. Bits have no meaning

  4. 4. Numbers, represented

  5. 5. Four readings

  6. 6. Characters, and reals

  7. 7. Into the processor

  8. 8. The memory wall, and the hierarchy

  9. 9. Processor design

  10. 10. The capstone

Check yourself

Why does a bit string carry no meaning by itself?

Because meaning lives in the declared type, not the bits. The identical string read under four different types yields four unrelated values, and nothing inspectable about the bits settles which reading is right.

What did two's complement fix?

Sign-magnitude and one's complement each produced two separate representations of zero — a positive and a negative one — which breaks comparison and any arithmetic depending on it. Two's complement gives a single zero.

What is the memory wall, and how does the hierarchy answer it?

Performance depends on how fast instructions and data arrive, and that has fallen behind calculation speed. Since no one technology is best at speed, size, cost and permanence, systems layer several — which works because programs revisit the same memory regions.

What does a computer lose when the power dies?

Cache and main memory both — they are volatile. Anything meant to survive a shutdown has to be written to storage that is not.

What does pipelining do?

It divides instruction execution into phases — fetch, decode, issue, execute, commit — each handing forward to the next, so several instructions occupy different phases simultaneously rather than one instruction owning the whole cycle.

Lecture transcript

The narration as recorded, in order. Where an entry plays, the transcript links to it rather than reprinting it — the entry plays from its own file, unaltered, and says the same thing on its own page.

This is Unit Five of Computer Science: the computer system itself. The unit opens with a claim that sounds like wordplay and is not. A string of bits has no meaning. None. The same bits under two declared types are two different values, and nothing about the bits themselves settles which. That is why the middle of this unit is about representation — how numbers, negative numbers, characters, and numbers with decimal points get encoded, and why the first two attempts at negatives both misfired in the same way. Then the unit turns to why computers are as fast as they are and no faster. The answer stopped being about calculation speed a long time ago. It is about how quickly data arrives — and every layer of memory in a machine exists because of that one problem. There is also an error entry that catches almost everybody once, about what a computer keeps when the power goes out. By the end you will be able to do five things. One: say why bits carry no meaning by themselves. Two: say what two's complement fixed. Three: say what the memory wall is and how the hierarchy answers it. Four: say what a machine loses when the power dies. Five: say what pipelining does.

Four entries setting the ground. Two halves to a computer, and one fact underneath the whole unit — a program and the data it works on are stored in exactly the same form, with nothing distinguishing them but how they are used.

Two halves.

CS 0231 The Computer System

Hardware, the physical components, and software, the programs those components execute. Neither half does anything without the other.

The same form.

CS 0232 Program and Data

A program and its data are both stored as sequences of bits. The hardware executes one of them and treats the other as material — and the storage itself does not mark which is which.

The units.

CS 0233 The Bit and the Byte

A bit is a single binary digit, a one or a zero. A byte is eight of them. Every program and every piece of data in a machine gets measured in these terms.

A program at rest.

CS 0234 The Executable

A byte sequence stored on disk, doing nothing at all until a command or a click starts it. A program spends most of its existence not running.

Two entries. The descent from a stated problem all the way down to what the processor executes — and then the three properties an algorithm has to have before it can make that trip at all.

The descent.

CS 0235 The Abstraction Ladder

Problem, algorithm, program, assembly, machine code — each rung a translation of the one above it, with the machine only ever seeing the bottom.

The three requirements.

CS 0236 The Algorithm's Three Requirements

Unambiguous, so every step has one reading. Deterministic, so the same inputs give the same outputs. And affordable in time and memory — a correct algorithm that cannot be run is not usable.

Two entries, and this is the conceptual centre of the unit. Meaning is not in the bits. It is in the declared type — and the error entry exists because the opposite feels so obvious that people keep assuming it.

Where meaning lives.

CS 0238 Bits Need a Declared Type

A series of bits has no meaning by itself, and reading it requires knowing the declared type — because the identical string under two types is two different values.

And the error.

CS 0239 "The Bits Contain the Meaning"

Meaning does not live in the bit string. It lives in the type declared over it. Nothing you can inspect about the bits themselves tells you what they are — and that is a property of the representation, not a gap in the tooling.

Four entries. One counting scheme that decimal and binary share, the range a fixed number of bits gives you, and then the story of negative numbers — where the first two attempts both failed in exactly the same way before a third got it right.

The scheme.

CS 0240 Positional Notation

Decimal and binary run the identical positional scheme with different bases — each digit multiplied by the base raised to its position. The scheme was never decimal's own.

The range.

CS 0241 The Unsigned Range

An unsigned integer is non-negative, and n bits present exactly two-to-the-n values. The range is fixed the moment the width is chosen.

Two failures.

CS 0242 The Sign Problem

The first two approaches to negative numbers each produced two separate representations of zero. A positive zero and a negative zero — which breaks comparison, and breaks arithmetic that depends on comparison.

And the fix.

CS 0243 Two's Complement

The one's complement of a number plus one — giving a single representation of zero, and arithmetic that works without special cases for sign.

One procedure, and it is the demonstration that makes the type argument concrete. One bit string, unchanged, decoded four separate times under four declared types — producing four unrelated values.

Watch one string get read four ways.

CS 0245 One String, Four Readings

A single bit string run through four declared types, producing four different values with nothing altered but the declaration. The abstract claim about meaning becomes something you can watch happen.

Three entries extending representation past whole numbers. Letters and punctuation first, then every written language, then numbers with a decimal point — which turn out to be the awkward case.

Characters.

CS 0246 ASCII

Each keyboard character assigned a unique binary code — seven bits covering a hundred and twenty-eight characters, later extended to eight.

All of them.

CS 0247 Unicode

Character encoding extended to all written languages, with the earlier standard incorporated rather than discarded. Backward compatibility built into the design.

And real numbers.

CS 0248 The Floating Point

A representation for numbers with a decimal point, at fixed widths — four bytes for single precision. Fixed width and unlimited real numbers do not fit together, which is the source of a whole family of surprises.

Three entries moving from storage into execution. What puts a finished program into memory, the fastest storage a machine has, and one instruction form that works on many numbers at a time.

Getting loaded.

CS 0251 The Loader and the Libraries

A finished executable still needs the operating system to place it into memory arranged for execution, with the libraries it depends on collected alongside it.

The fastest storage.

CS 0252 The Register

A very high-speed memory unit, with a small fixed set of them sitting inside the processor. Small and fixed is the point — there is no room for more.

Many at once.

CS 0253 Vector Instructions

Instructions operating on groups of numbers rather than single values — one addition combining dozens of pairs. The parallelism from Unit Four, at the instruction level.

Six entries, and this is where the unit explains why computers are as fast as they are and no faster. The bottleneck is not arithmetic. It has not been arithmetic for a long time — it is how fast the data arrives.

The bottleneck.

CS 0256 The Memory Wall

Performance depends on calculation speed and on how quickly instructions and data reach the processor — and the second has fallen further and further behind the first.

The answer.

CS 0257 The Memory Hierarchy

No memory technology is best at speed, size, cost and permanence at once, so systems layer several — each layer trading one property for another.

The nearest layer.

CS 0258 The Cache

Built from static memory — very fast, expensive, small, and losing everything without power. It sits nearest the processor because that is where speed matters most.

The next.

CS 0259 Main Memory: DRAM

Main memory built from capacitors, with charge present meaning one and absent meaning zero. Larger and cheaper than the layer above it, and slower.

And the error.

CS 0260 "Memory Keeps It When the Power Dies"

Memory is volatile — both layers lose their contents when the power stops, and anything meant to survive a shutdown has to be written somewhere else entirely. Nothing about the word memory suggests that, which is why the entry exists.

Why layering works.

CS 0261 Locality

Programs revisit the same regions of memory — consecutively, and repeatedly over time. That pattern is what makes a small fast layer worth having at all.

Three entries on how processors got faster, and then on the two trends that made that possible running out — which is the reason the multiple cores from Unit Four exist at all.

The earliest design.

CS 0263 The Single-Cycle Processor

One bulky circuit running on one clock, with every instruction sharing the same cycle — so the cycle had to be long enough for the slowest one.

The improvement.

CS 0264 Pipelining

Dividing execution into phases, each handing forward to the next, so several instructions occupy different phases at the same moment.

And the limits.

CS 0265 Moore's Law and Dennard Scaling

One law predicted device counts doubling on a fixed schedule; the other described how power scaled as they shrank. When the second stopped holding, single-processor speed stopped climbing — and cores multiplied instead.

One capstone, and it uses the most ordinary action available. Playing a song — which turns out to touch every layer this unit named, from the bits on disk to the sound in the room.

The capstone. One song.

CS 0270 One Song, Every Layer

Playing a single song exercises the whole unit — stored bits given meaning by a declared type, moved up the memory hierarchy, decoded by a pipelined processor, and turned into sound.

Five things you can now do. You can say why a string of bits carries no meaning on its own — the meaning is in the declared type, and one string under four types gives four values. You can say what two's complement fixed: the two earlier approaches each produced two representations of zero, and that breaks comparison. You can say what the memory wall is — data arriving slower than the processor can use it — and that the hierarchy answers it by layering technologies, which works because programs revisit the same regions. You can say what a machine loses when the power dies: cache and main memory both, since both are volatile. And you can say what pipelining does — dividing execution into phases so several instructions occupy different phases at once.

This is free, and stays free. If it helped, here is what keeps it running.