How do the expansion buses of your PC work?

Input output ports

Since the dawn of the personal computer, not with the IBM PC but with the Altair of MITS that personal computers have different of different types and shapes, but all expansion bus follows a series of common rules in its operation regardless of the type of interface we are talking about. That is why we have made you an article with the common rules of expansion ports.

Regardless of whether we connect the printer to the USB port, the graphics card to the PCI Express port or the hard disk to the SATA port, they all follow a series of common standards that allow them to interact with the rest of the system, which we are going to define here , so that you have a better knowledge of the expansion ports in general and not just one in particular.

1st rule of an expansion bus: serial or parallel

serial parallel expansion ports

An expansion port can transmit data serially or in parallel. When we say that it transmits data serially, we are saying that the port has a single data pin that sends one bit of information per clock cycle.

A parallel expansion port, on the other hand, sends several bits simultaneously, but for this it requires a greater number of pins and therefore its interface is much wider. Therefore, the physical interface of said port will occupy many more pins and therefore a larger area. The consequence, larger chips as these interfaces are on the outer perimeter.

Since data transfer consumption increases exponentially with bandwidth, parallel interfaces are often used for high bandwidths and serial interfaces for low bandwidths. However, all interfaces contain a SerDes interface that accompanies it inside the processor, said interface converts the signal from parallel to serial and therefore serializes and also the opposite case. This happens inside the processor and before sending or receiving the signals, since the energy consumption inside the CPU is much lower.

2nd rule of an expansion bus: address

Duplex Simplex Expansion Ports

The first interfaces used to generally go in one direction only, especially for input peripherals where mice and keyboards were connected. After all, a keyboard does not need to process data and the same happened with the output ports such as the video output.

But for certain peripherals it is necessary to have communication in both directions and it is a huge waste of space and hardware complexity to have pins for sending data and pins for receiving data. The solution? Making the pins can work in both directions, with this, two types of configurations called Duplex were reached, which are the following:

  • Half Duplex: data is transmitted in a single direction, which is marked by sending a signal to one or two contiguous pins. If a single pin is used to select then it allows only one direction of the data, if it allows both then we can copy, that is, transmit data in mode Full Duplex.
  • Some communication interfaces always transmit data in both directions, these are purely Full Duplex, but they do not make use of certain pins to transmit the data.

Many of the more advanced systems of the second type usually have both a receiver and a transmitter at each end to be able to communicate the data in both directions.

3rd rule of an expansion bus: channels

USB-C Pinout

And since we are talking about data channels, there are expansion ports that can transmit several different data streams based on having several transmitters (TX), receivers (RX) or transceivers operating simultaneously on their interfaces. Which allows them not to send one stream of data, but several different ones at the same time.

This is the case of the USB-C Alt DP where the different data channels can be used both to transmit data and to send video to a DisplayPort input of a monitor. Another advantage that this allows is to be able to create hubs that allow several peripherals to share the same common interface.

Way of transmitting the data

Binary system

The next point is the way of transmitting the data and this changes according to the selected interface. In some simpler interfaces what we have is a pin that when it receives the signal transmits the data from one part of the interface to another directly. Many of the primitive interfaces are based on placing the data from a specific memory address and letting the hardware take care of transmitting the data.

But since PC CPUs began to use virtual addressing that became impossible to do, so data transfer systems with peripherals as well as RAM memory needed the addition of so-called IOMMUs, parts Like an MMU, they translate virtual addresses into physical addresses, but this time with peripherals.

Today most interfaces function as a network interface. The IOMMU can know directly which peripheral is communicating from the nature of each packet sent. However, not all data inputs and outputs go through the IOMMU as is the case with the video signal for example, since they are handled by the graphics card in that case.

DMA to communicate peripherals and memory

DMA diagram

One of the peculiarities of the x86 architecture is that it does not have differentiated pins to communicate the memory and the peripherals, so the peripherals are assigned a series of memory addresses for the communication between the CPU and the peripherals. The problem? The memory interface is located on the CPU. How do peripherals communicate with RAM?

Well, through a mechanism of direct access to memory or DMA, this mechanism is an interface with the RAM for the peripheral that temporarily disconnects one of the memory channels from the CPU to the RAM to assign it to the peripheral and be able to write the data to memory or read from it. This is important because the CPU requires data to be in RAM in order to operate with it.

The post How do the expansion buses of your PC work? appeared first on HardZone.

Related Articles