Buses (the other spelling, "busses", are pecks on the cheek) are just bundles of wires for carrying related electrical signals. The system bus includes two subcomponents, the address bus and the data bus. When the CPU fetches instructions or data, it places the address of the instruction or data on the database, and the memory module recognizes the address as `belonging' to it and responds by places the memory contents (the instruction or the data) on the data bus, whereupon the CPU will sense the value. You should think of the memory module as a large array, and an address as simply an integer index into the array. This integer is sent over the address bus in binary form -- each wire has two valid voltage levels -- and similarly, the data is read from the memory as a binary value.
The CPU has internal modules too:
The register file is another sort of memory -- there are only a few of
them (on the MIPS architecture, there are 32), but access to their
contents is extremely fast, because they are on-chip. Main memory,
outside of the CPU, is implemented in DRAM (Dynamic Random Access
Memory) on separate chips. There is a huge amount of main memory in
comparison: most machines these days have 32-512 MB (MB stands for
"MegaByte" == 2^20 bytes or approx 10^6 bytes), in comparison to
32*4=128 bytes in a typical register file. Access main memory,
however, is slow, since the CPU send signals vast distances (a few
inches) to the memory and wait for the response. Compared to on-chip
distances of millimeters or less, the time required for the signals to
propagate over the fifteen centimeters or so is enormous -- electrical
signals travel at the speed of light in its medium, and over copper
wires is something like 2/3 the speed of light in vacuum,
Compilers generally keep variables in main memory, and registers are used to hold temporary copies of them while the CPU is modifying the variables. Indeed, most RISC instruction sets do not allow directly modifying memory -- they employ a ``load/store'' architecture, where memory contents must be loaded into a register before being used. Some very frequently used variables may be kept in a register for efficiency. In C and C++, the register storage class specifier tells the compiler that the programmer believes that the variable will be heavily used, as a hint to give greater priority to placing that variable over others in a register.
Coming next tuesday: caches, change of base, computer arithmetic, number representation, instruction sets.
bsy+www@cs.ucsd.edu, last updated