Skip to content
BetterDL

Bus contention

Also called: bus conflict, bus fight, drive conflict

A fault where two or more devices drive the same bus line at the same time. If they disagree, the value is undefined and the drivers can be damaged.

A bus works because only one device drives it at a time. Bus contention is what happens when that rule breaks: two outputs are enabled on the same wire together.

If they drive the same value, nothing visibly goes wrong. If they drive different values, one output pushes toward 1 while the other pulls toward 0:

  • the wire ends up at some in-between voltage, so readers may see 0, 1, or something that's neither
  • a large current flows from one driver into the other, wasting power and heating the chips, which can damage them

Common causes in memory systems:

  • a broken chip select decoder that selects two chips at once
  • partial address decoding that leaves two chips answering the same address
  • timing overlap: one chip still driving the data bus as the next one starts

The cures are the ones you'd expect: tri-state outputs, chip selects from a decoder (whose outputs are one hot, so only one chip is ever selected), and careful timing of output enable.

Worked example

Example

Two chips selected at once

Two RAM chips on the same data bus are both selected for a read. Chip A holds 0110, chip B holds 0011.

  1. 1.

    Bit 3: both drive 0. The line reads 0, no fight.

  2. 2.

    Bit 2: A drives 1, B drives 0. Contention: the value is undefined.

  3. 3.

    Bit 1: both drive 1. Fine.

  4. 4.

    Bit 0: A drives 0, B drives 1. Contention again.

  5. 5.

    The CPU can't trust the word, and the fighting outputs draw excess current.

Common mistakes

  • Thinking the bus just ORs the two values together. Fighting drivers give an undefined level, not an OR.

  • Assuming contention is harmless if it's brief. Even short overlaps waste power and can corrupt a read.

  • Fixing contention by disabling all drivers. The bus then floats; exactly one driver should be enabled.

Practice Bus contention

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Bus contention is taught in Memory.