Foundations: What a Computer Is

the hardware/software interface

Think of a wall socket. You can plug in any lamp, kettle, or laptop charger without knowing anything about the power station miles away, and the power company can rebuild that station completely without telling you, as long as the socket keeps delivering the agreed voltage. The hardware/software interface is that socket for computers: the agreed boundary where software stops and hardware begins, so each side can be built and improved on its own.

On a computer this interface is mainly the instruction set architecture: the exact set of instructions, registers, memory rules, and number formats that hardware promises to provide and software is allowed to rely on. Above the line live compilers, operating systems, and applications; below it live the microarchitecture, the logic gates, and the transistors. Because both sides agree on the interface, a programmer never has to think about voltages, and a chip designer never has to read your program — they meet only at the contract.

This clean boundary is one of the most powerful ideas in all of computing. It lets a single program run on machines built decades apart, lets hardware get faster without rewriting software, and lets millions of programs and thousands of chips interoperate. The cost is that the interface is hard to change once everyone depends on it — which is why old, sometimes awkward instructions linger in real ISAs for decades.

When you write add a, b in assembly, the compiler turns it into a machine instruction defined by the ISA. The hardware below can be a 1990s chip or a 2024 chip; either honours the same add, so your program does not care which one runs it.

The ISA is the socket where software plugs into hardware.

The interface is mostly the ISA, but it is wider in practice — it also includes calling conventions and the system-call boundary to the operating system. Its great strength (stability) is also its great cost (it resists change).

Also called
the hw/sw boundary硬軟體界面