Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 4.73 KB

5_Data Bus and Address Bus.md

File metadata and controls

41 lines (27 loc) · 4.73 KB

Data Bus and Address Bus 📘

  • Logical and Physical Addresses: The CPU generates logical addresses, while the Memory Management Unit (MMU) converts these logical addresses into physical addresses. An example given was the logical address 156 being converted to the physical address 56 by the MMU.

  • Address Bus: This connects the MMU and physical memory, with 32 metallic wires (in a 32-bit system). These wires can convey an address by varying voltage levels to represent binary encoding (e.g., 56 represented in binary).

  • Data Bus: This facilitates data transfer between the CPU and physical memory. In a 32-bit system, there are four buses (bus zero to bus three) with eight metallic wires each, allowing the data bus to carry 32 bits or four bytes of data in one go.

  • Read/Write Operations: Once a memory location is identified via the address bus, the CPU conducts read/write operations on the physical memory locations through the data bus.

  • Memory Limitations on a 32-bit System: The maximum memory address an address bus can carry is 2^32 - 1. For a 32-bit system, installing physical memory greater than 4 GB (2^32 bytes) is futile since addresses beyond 4GB cannot be accessed or utilized by the CPU.

🧐 Curiosity

  1. Q: How does MMU convert a logical address to a physical address? A: MMU (Memory Management Unit) converts logical to physical addresses using various memory management mechanisms like paging or segmentation. It employs a page table that keeps track of where the virtual pages are mapped in the physical memory.

  2. Q: Why are there 32 metallic wires in the address bus for a 32-bit system? A: Each wire represents a bit. For a 32-bit system, addresses are 32 bits long. Therefore, to transmit the whole address in one go, 32 wires are needed, with each wire carrying a single bit of the address.

  3. Q: How does data get transferred between the CPU and physical memory using the data bus? A: Data gets transferred via the data bus, which has several buses (e.g., 4 buses in a 32-bit system). Each bus has metallic wires (e.g., 8 wires/bus), representing 8 bits or 1 byte of data. So, the data from the physical memory is sent through these buses as electrical signals representing binary data to the CPU and vice versa.

  4. Q: Why does the 32-bit system have a physical memory limitation of 4 GB? A: A 32-bit system has an address bus capable of transmitting 2^32 distinct addresses. Since each address corresponds to 1 byte in memory, a 32-bit system can uniquely address 2^32 bytes, which equals 4 GB. Therefore, memory beyond 4 GB cannot be uniquely addressed and is, therefore, inaccessible.

  5. Q: Why would a 64-bit system potentially be preferable in modern computing? A: A 64-bit system allows for addressing vastly larger physical memory sizes (up to 2^64 bytes), providing the capability to utilize more RAM, which is beneficial for modern applications and systems that often require large amounts of memory to operate efficiently.

  6. Q: What is the role of voltage levels in the metallic wires of the address bus? A: The voltage levels in the metallic wires represent binary values: a higher voltage level represents binary '1', and a lower or zero voltage level represents binary '0'. By varying the voltage across the 32 wires, different binary addresses are generated and transmitted across the address bus.

  7. Q: How does the CPU decide which operations (read or write) to perform on identified memory locations? A: The CPU determines the operation type based on the instruction it is executing. If the instruction involves retrieving data, a read operation is performed; if it involves storing data, a write operation is executed. The instruction set, fetched from memory, dictates whether the CPU reads from or writes to memory, along with the address to do so.

📝 Concepts in Simple Words

  • The CPU gives a logical address like a location label (e.g., 156).
  • The MMU changes this logical address into a physical address, like converting a name into a specific house address (e.g., 56).
  • The Address Bus tells the physical memory which address or "house" to go to by sending a coded message through metallic wires. For example, in a 32-bit system, it uses 32 wires to send this coded message.
  • The Data Bus is like a courier, carrying data (letters or parcels) between the CPU and physical memory. In a 32-bit system, it can carry 4 bytes of data at once because it has 32 wires (grouped as 4 buses, each carrying 1 byte of data).
  • If your computer is a 32-bit system, it can only utilize up to 4GB of RAM because it can only send address codes for up to that amount. Anything more than 4GB would be like sending parcels to non-existent addresses.