Computer components and bus interconnection
Components of a computer (CPU, memory, I/O) connect over a system bus (data, address, control); this note explains bus structure, protocols, timing, arbitration, address decoding and practical calculations for throughput and chip select.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
A computer's CPU, memory and I/O modules must exchange addresses, data and control signals. Engineers design the system bus and interconnection to meet required bandwidth, latency and correct device selection so the whole system runs without errors.
Key ideas
Start with definitions from first principles and then build the interconnection concepts.
Bus: a set of shared physical lines (wires) used for transferring digital information between components. A bus groups lines for different purposes.
System bus: the principal bus that connects the CPU, main memory and I/O modules. It usually splits into three functional groups: address bus, data bus and control bus.
Address bus: the set of lines used by the CPU to specify a memory or I/O address. The width of the address bus (number of lines) determines the maximum directly addressable locations by
2^(width)distinct addresses (assumes linear, flat addressing and word-addressable mapping if stated).Data bus: the set of lines used to carry actual data values during read or write transfers. The data bus width (bits) determines the size of each transfer unit.
Control bus: lines used for control and status signals such as memory read, memory write, I/O read, I/O write, clock, interrupt requests and acknowledge, bus request and bus grant.
Bus master: a device that can initiate transactions on the bus (typically CPU or a DMA controller). Bus slave: a device that responds to master requests (memory, I/O device).
Bus arbitration: the method used to decide which master gains control of a shared bus when multiple masters request it. Common schemes are centralized (single arbiter grants) and distributed (masters resolve conflicts using a protocol). Arbitration must ensure mutual exclusion; policies may target fairness or fixed priority depending on system requirements.
Tri-state: an output driver mode providing three possible electrical states: logical 0, logical 1 and high impedance (Z). High impedance allows multiple devices to share a bus line without interfering when they are not driving it.
Bus contention: occurs when two or more devices try to drive the same bus line to different logic levels simultaneously. It causes undefined values and potentially hardware damage; correct tri-state and arbitration prevent it.
Synchronous bus: bus operations use a common clock. Transfers proceed in defined clock cycles with known time slots (T1, T2, ...); wait states may be inserted. Assumption: all devices sample and change lines on clock edges.
Asynchronous bus: no common clock; uses handshaking signals (request, acknowledge) to control timing. Assumption: devices use request/ack pairs to indicate data validity and acceptance.
Bus protocol/transaction: the sequence of signals and timing rules for performing a read or write. Example synchronous read: CPU places address on the address bus in cycle T1, asserts MEMREAD on control lines; memory places data on data bus in T2; CPU samples data on the clock edge.
Memory-mapped I/O: I/O devices occupy addresses in the same address space as memory. CPU uses normal memory instructions to access I/O. Port-mapped I/O (or isolated I/O) uses a separate I/O address space and special instructions.
Bus mastering and DMA: Direct Memory Access (DMA) allows an I/O device to become a bus master to transfer data to/from memory without continuous CPU intervention. Assumption: bus supports multiple masters and arbitration.
Address decoding / chip-select: to enable exactly one device for a given address range, combine address lines through logic gates to form a chip select (CS) signal. Exact decode: for an address range aligned to power-of-two size, CS = 1 when the high-order address bits equal the device base pattern and low-order bits are 'don't care'.
Diagrams (what to draw):
- Draw a rectangle labeled CPU, a rectangle labeled Memory, several small rectangles labeled I/O devices. Draw three bundles of parallel lines between them labeled Address bus (A[n-1:0]), Data bus (D[m-1:0]), Control bus (READ, WRITE, CLK, IRQ, BR, BG). Show arrows from CPU to buses and from buses to devices.
- Timing diagram for a synchronous read: Draw time horizontally. Mark T1: CPU places address (A) on address bus and asserts MEMREAD; T2: memory places data (D) on data bus; T3: CPU samples D and deasserts MEMREAD. Label signal lines: ADDR, DQ, MEMREAD, CLOCK.
Exact statements and assumptions universities ask for:
- Maximum addressable bytes =
2^(address bus width)bytes if addressing is byte-addressable and address bus carries complete address. If the system is word-addressable with word size w bytes, maximum addressable bytes =2^(address bus width) * w. - When bus transfers one word of W bits per clock at frequency f, raw peak transfer rate (bit/s) = W * f (assumes one transfer per clock and no protocol overhead). Convert to bytes/s dividing by 8.
Formulas
Addressable locations = 2^(A) where A is address bus width in bits. Units: locations (if byte-addressable, this equals bytes). Applies when addressing is flat and contiguous.
Peak bandwidth (bytes/s) = (W_bits * f_transfers_per_s) / 8 where W_bits is data bus width in bits, f_transfers_per_s is number of transfers per second (Hz). Units: bytes per second. Applies when one transfer per clock and no overhead.
Effective bandwidth = Peak bandwidth * (T_useful / T_total) where T_useful is the time carrying payload, T_total is total cycle time including overhead (handshaking, wait states). Units: bytes per second.
Chip select logic for device at base address B with size S = 2^k: CS = 1 when A[n-1 : k] == B[n-1 : k] where A is address bus, n is address lines, k = log2(S). Applies if device base is aligned to its size boundary.
Transfer time per word (s) = 1 / f_transfers_per_s where f_transfers_per_s is effective transfer rate. Units: seconds. Applies for steady-state transfer.
Worked examples
Example 1 — Peak and effective bandwidth (numerical) Problem: A system has a 32-bit data bus and the bus clock is 100 MHz. The bus is fully pipelined so after the first transfer there is one data beat per clock; additional protocol overhead adds 1 wait clock every 4 transfers. Compute peak bandwidth and effective bandwidth in MB/s. Solution steps:
- Peak bandwidth using one data transfer per clock at 100 MHz: formula
Peak bytes/s = (W_bits * f) / 8.- W_bits = 32, f = 100e6 Hz. So peak bytes/s = (32 * 100e6) / 8 = (3200e6) / 8 = 400e6 bytes/s.
- Convert to MB/s (1 MB = 10^6 bytes for typical bandwidth reporting): 400 MB/s. Bold final: 400 MB/s.
- Effective bandwidth: every 4 transfers add 1 extra wait clock. Each transfer needs 1 clock for data plus address clock; but we assume data-phase-limited transfers so count 1 transfer per data clock. Effective clocks per transfer = 1 (data) + (1/4) (average wait) = 1.25 clocks per transfer. So effective transfer rate = 100e6 / 1.25 = 80e6 transfers/s.
- Effective bytes/s = (32 bits * 80e6) / 8 = 320e6 bytes/s = 320 MB/s.
Example 2 — Address decoding (logic) Problem: A CPU with 16-bit address bus must map a 4 KB ROM at the top of the 64 KB address space. Give the chip select equation and show which address bits to check. Solution steps:
- 16-bit bus means addresses 0x0000 to 0xFFFF (64 KB). 4 KB = 2^12, so k = 12 low-order bits are the device offset (don't-care for high-order matching).
- ROM placed at top: address range 0xF000 to 0xFFFF. High-order 4 bits (A15..A12) equal 1111 (binary for 0xF).
- Chip select:
CS = 1 when A15 = 1 and A14 = 1 and A13 = 1 and A12 = 1. AlternativelyCS = (A15 & A14 & A13 & A12). - Draw what to test: list address bits A15..A0; indicate A15..A12 must be 1111; A11..A0 are don't-care within ROM. Final: device enabled when addresses are 0xF000 - 0xFFFF.
Example 3 — Short algorithmic trace (bus read in synchronous system) Given: CPU issues read to address X. Draw time slots: T1 address placed + MEMREAD asserted, T2 memory places data, T3 CPU samples and deasserts. Show signals values at each slot (ADDR=X, MEMREAD=1 only in T1..T2, DATA valid in T2). This models typical synchronous bus read.
Common mistakes
- Writing chip-select logic that ignores alignment: device size must be power of two and base address aligned to that size for simple decoding formula to apply.
- Confusing tri-state (high impedance) with logical high or low; tri-state means the device is not driving the line.
- Assuming arbitration is instantaneous; in practice bus grant cycles or wait states add latency and reduce throughput.
For your exam
Typical question types
- Definitions and short notes: define bus, tri-state, bus arbitration, memory-mapped I/O.
- Derivations: show how address bus width gives maximum addressable memory; derive peak bandwidth formula and include units.
- Numericals: compute peak and effective bandwidth given bus width, clock, and wait-state pattern; compute chip-select logic for given address range.
- Diagrams: draw system bus connecting CPU, memory and I/O; draw timing diagram for a synchronous read/write transaction.
- Practical: explain consequences of bus contention and how tri-state and arbitration solve it.
What full-marks answers include
- Precise definitions with bold terms, units, and assumptions (for example whether addressing is byte-addressable). For numericals show each step, substitute numbers into the formula, carry units, and give final answer in correct units. For diagrams label all lines and phases.
Quick check
- What are the three functional groups of a system bus?
- If data bus width is 64 bits and clock is 250 MHz, what is the peak bandwidth in GB/s (use 10^9 bytes = 1 GB)?
- For a device of size 8 KB on a 24-bit address bus, how many low-order address bits are don't-care for chip select?
Answers: 1. Address bus, Data bus, Control bus. 2. Peak bytes/s = (64 * 250e6) / 8 = 2e9 bytes/s = 2.0 GB/s. 3. 8 KB = 2^13 so k = 13 low-order bits are don't-care.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?