digiwleeaLearn
Open the lab →

Buses

Moving a whole byte

5 min read

A bus is a group of wires, one per bit, routed together so they carry a whole multi-bit number at once. It is the plumbing and notation that lets the parts of a CPU pass bytes between each other.

Everything so far moved one bit at a time: a wire is one net, holding a single 0 or 1. But a CPU works on whole numbers, and an 8-bit number needs eight wires at once. A group of wires that travels together, carrying one multi-bit value, is called a bus. This short lesson is mostly vocabulary and bookkeeping, but it is the convention every later lesson leans on, so it is worth pinning down.

A number is just its bits, side by side

Write a byte in binary, say 1010 0101. That is eight separate bits. Put each on its own wire and you can carry the whole value across the chip. We name the wires by bit position: b0 is the least-significant bit (worth 1), b1 is worth 2, b2 is worth 4, and so on up to b7 worth 128. The value on the bus is the sum of the positions whose wire is 1.
value = b7*128 + b6*64 + b5*32 + b4*16 + b3*8 + b2*4 + b1*2 + b0*1
Nothing new is happening electrically. A bus is 0s and 1s on ordinary wires, exactly the nets from the wires and nets lesson. The bus idea is a way of *thinking about* eight wires as one number, so we can talk about moving a byte instead of tracking eight signals by hand.

Why we draw it as one fat line

Drawing eight parallel wires everywhere gets noisy fast. On real schematics a bus is often drawn as a single thick line with a small /8 slash to mean eight bits, and it splits back into individual wires only where a circuit needs a specific bit. digiwleea gives you exactly this: the SPLIT8 and MERGE8 parts (the *Buses* group in the palette) bundle eight single-bit wires into one wide bus pin, so a bus wire drawn between two of them carries all eight bits at once, as one thick line, and fans back out to the individual bits at the other end. You can still route the eight wires by hand if you prefer, but the adapters keep a wide datapath tidy. Either way, label by position, because the adder and register you are about to build line their bits up b0-to-b0, b1-to-b1, all the way up.
A 4-bit bus shown literally: four inputs b0-b3 carry a nibble straight through to four probes. A byte is the same idea with eight wires. Open it in the lab, set the inputs, and read the four-bit number off the probes.
Try it
On the 4-bit bus above, you want to put the value 6 on the wires. With b0 = least-significant, which of b0-b3 do you set to 1? Set them in the lab and check.
Bit ordering is a real source of bugs. Pick a convention, b0 = least-significant, and hold to it everywhere. When you wire two 8-bit blocks together, connect b0 to b0 and b7 to b7. Crossing the order silently computes the wrong number, and the circuit will look perfectly connected.
From here on, a labelled bus like A[7:0] means eight wires, A0 through A7. Next we build the first block that *chooses* between buses: the multiplexer, a selector that routes one of several inputs onto a shared bus. Selecting which value travels on the bus is most of what a CPU's wiring does.
Spot the fault
ENA1ENB1A1B0BUSX
Look at BUS
Short (X)
Two drivers are enabled onto the same bus at once: source A pushes 1 while source B pushes 0. They fight, and the wire settles to neither value, so the simulator marks it X (contention). A shared bus needs exactly one driver enabled at a time; gate the others off with tri-state buffers so they release the wire.

Frequently asked

What is a bus in a CPU?

A bus is a group of wires, one per bit, routed together so they carry a whole multi-bit value at once. An 8-bit bus is eight ordinary wires (named by bit position b0 through b7), and the value it carries is the sum of the positions whose wire is 1. It is the plumbing that lets the parts of a CPU pass bytes between each other.

Can two devices drive a bus at the same time?

No. Many devices connect to a shared bus, but only one may drive it at a time; two drivers pushing opposite values short the wire to X. Devices take turns using tri-state buffers, which let an unselected device release the wire entirely (high-Z) so it adds nothing.

Is a bus a special kind of wire?

No, electrically nothing new is happening: a bus is just 0s and 1s on ordinary wires and nets. "Bus" is a way of *thinking about* eight wires as one number. Schematics often draw it as one thick line with a /8 slash to mean eight bits, but in this simulator you really do route the individual wires.

Why does bit ordering matter on a bus?

Because crossing the order silently computes the wrong number while the circuit still looks perfectly connected. Pick a convention (b0 = least-significant) and hold to it everywhere: when wiring two 8-bit blocks together, connect b0 to b0 and b7 to b7.

Every lesson here builds toward one thing: a working CPU, from the transistor up.

Open the free lab →
Found this useful? Share itShare on X