CPU Buses: Address, Data, and Control
Modern processors communicate with memory and peripheral devices through a set of parallel pathways called buses. Understanding the role of each bus is essential for grasping how a CPU reads from or writes to RAM.
What is a Bus?
A bus is a collection of wires that carries signals between components. In a typical Von Neumann architecture there are three logical buses:
- Address bus – carries the memory address that the CPU wants to access.
- Data bus – transports the actual data value read from or written to memory.
- Control bus – conveys timing and command signals such as
READ,WRITE, and clock pulses.
Address Bus vs. Data Bus
When the CPU issues a READ operation, the address bus first places the target memory address on the line. The memory controller then places the requested data on the data bus, which the CPU samples on the next clock edge. The control bus synchronises the whole transaction.
Key takeaway: Address bus carries the address; data bus carries the value. This is the correct answer to the quiz question about which bus carries the address and which carries the data.
Quiz Review
- Correct answer: Address bus carries the address; data bus carries the value.
- Common misconception: confusing the control bus with the address bus.
Network Packet Headers: MAC vs. IP
When a packet traverses multiple routers, different parts of the packet are rewritten. Knowing which header changes at each hop is crucial for network troubleshooting and design.
Layer‑2 (MAC) Header
The Media Access Control (MAC) header contains the source and destination hardware addresses of the two directly connected devices. Because each link‑layer segment has its own physical adapters, the MAC header is replaced at every router.
Layer‑3 (IP) Header
The Internet Protocol (IP) header holds the logical source and destination IP addresses. These addresses remain constant for the entire end‑to‑end journey, allowing routers to forward the packet based on the same IP information.
Quiz Review
- Correct answer: The MAC header is replaced at each hop while the IP header stays the same.
- This behaviour enables layered networking – the IP layer provides stability, while the MAC layer adapts to each physical segment.
Subnetting and Network Address Calculation
Subnetting divides a larger IP block into smaller, manageable networks. Determining the network address from an IP address and a subnet mask is a fundamental skill for any network engineer.
Understanding CIDR Notation
Classless Inter‑Domain Routing (CIDR) expresses a network as IP/prefix. The prefix length indicates how many high‑order bits belong to the network portion.
Example: 172.22.20.159/21
Step‑by‑step calculation:
- Convert the IP address to binary:
- 172 =
10101100 - 22 =
00010110 - 20 =
00010100 - 159 =
10011111
- 172 =
- Apply a /21 mask – the first 21 bits are network bits. The mask in binary is
11111111.11111111.11111000.00000000(255.255.248.0). - Zero out the host bits (the last 11 bits). The resulting network address is
172.22.16.0.
Correct answer: 172.22.16.0.
Quiz Review
- Common error: selecting the host portion (172.22.20.0) instead of zeroing the host bits.
- Remember: the network address always ends with zeros in the host part.
Hub vs. Switch: How Ethernet Devices Forward Frames
Both hubs and switches operate at the data‑link layer, but they differ dramatically in efficiency and intelligence.
Hub – The Simple Repeater
A hub receives an incoming Ethernet frame on one port and broadcasts it out every other port. It does not inspect MAC addresses, so every device on the hub sees every frame. This leads to collisions and limited bandwidth.
Switch – The Smart Forwarder
A switch maintains a MAC address table that maps each learned MAC address to the port on which it was seen. When a frame arrives, the switch looks up the destination MAC and forwards the frame only to the appropriate port, dramatically reducing unnecessary traffic.
Quiz Review
- Correct answer: A hub broadcasts incoming frames to all ports; a switch forwards frames only to the destination port using a MAC table.
- Key phrase for SEO: "hub vs switch" and "MAC address table".
Two's Complement Overflow
Two's complement is the dominant method for representing signed integers in modern CPUs. It allows addition and subtraction to be performed using the same binary circuitry as unsigned arithmetic.
When Does Overflow Occur?
Overflow happens when the result of an addition cannot be represented with the given number of bits. In two's complement, adding two negative numbers should never produce a positive result. If it does, the sign bit has wrapped around, indicating overflow.
Detecting Overflow
The CPU typically sets an Overflow Flag (OF) when the carry into the sign bit differs from the carry out of the sign bit. This flag is used by higher‑level language runtimes to raise exceptions or to implement saturating arithmetic.
Quiz Review
- Correct answer: Overflow has occurred.
- Remember: the presence of overflow does not mean the CPU "ignored" sign bits; it signals that the mathematical result exceeds the representable range.
Virtual Memory and Paging
When a computer with 8 GB of RAM runs out of physical memory, the operating system employs virtual memory to keep programs running.
How Paging Works
The OS divides both physical RAM and the logical address space into fixed‑size blocks called pages (commonly 4 KB). When a page is not needed in RAM, the OS writes it to a reserved area on the hard drive or SSD known as the swap space or page file.
Benefits of Swapping
- Allows processes to use more memory than physically available.
- Provides isolation between processes, enhancing security.
- Enables the system to continue operating under heavy load.
Quiz Review
- Correct answer: It uses the disk as virtual memory, swapping pages to storage.
- Hot‑plug RAM upgrades are rare and not a standard OS fallback mechanism.
TCP/IP Model: Transport Layer Responsibilities
The TCP/IP suite consists of four layers: Link, Internet, Transport, and Application. The Transport layer provides end‑to‑end communication services.
Key Functions
- Reliability – TCP guarantees ordered delivery, retransmission of lost packets, and flow control.
- Port numbers – Both TCP and UDP use 16‑bit port numbers to multiplex many applications over a single IP address.
- Segmentation – Large data streams are broken into manageable segments.
Quiz Review
- Correct answer: Transport layer.
- Remember: the Internet layer handles routing, while the Application layer deals with protocols like HTTP and DNS.
Subnet Mask to CIDR Prefix Conversion
Subnet masks are often expressed in dotted‑decimal notation, but CIDR notation (/n) is more concise for routing tables.
Example Mask: 255.255.248.0
Convert each octet to binary:
- 255 =
11111111 - 255 =
11111111 - 248 =
11111000 - 0 =
00000000
Counting the continuous 1s gives 21 bits. Therefore the CIDR prefix is /21.
Quiz Review
- Correct answer: /21.
- Tip for learners: memorize the binary patterns for common masks (e.g., /24 = 255.255.255.0, /20 = 255.255.240.0).
Putting It All Together: Study Guide
Use the following checklist to reinforce the concepts covered in this course.
- CPU Buses: Address bus = address, Data bus = value, Control bus = timing.
- Packet Headers: MAC changes per hop, IP stays constant.
- Subnetting: Apply the mask, zero out host bits, verify with binary.
- Hub vs Switch: Hub = broadcast, Switch = MAC‑based forwarding.
- Two's Complement: Adding two negatives that yield a positive signals overflow.
- Virtual Memory: Swapping pages to disk extends usable memory.
- Transport Layer: Provides reliability and port numbers.
- CIDR Conversion: Count the 1s in the mask to get the prefix length.
By mastering these foundational topics, you will be well‑prepared for exams, certifications, and real‑world troubleshooting in computer organization and networking.