Stack Registers
Detalle de una placa madre con un disipador de calor y ranuras de conexión.
The stack is the part of the CPU where information is stored for later retrieval. When a program encounters a subroutine call, it needs to run an auxiliary routine and then return to the original program. The address to return to is stored on the stack. Retrieving that address when the subroutine ends allows the main program to resume. In this case, the stack holds addresses in an order in which the last one added is the first one removed. This is known as LIFO (Last In, First Out).
Microprocessors can use two types of stack. The first is built into the microprocessor itself, which has internal registers dedicated to this purpose. The number of these registers varies by microprocessor, and the stack’s capacity is limited by how many registers the microprocessor can hold. In the second type, a single register inside the microprocessor points to an address in external memory used for the stack.
This single register, which holds an address, is known as the stack pointer. To save a register, its contents are stored at the memory address indicated by the pointer. The pointer is then updated to point to the next free memory address. It is incremented or decremented depending on whether the program is returning from or calling a subroutine. The stack is therefore limited only by the amount of memory available. The operating system or the programmer allocates an area of memory for the stack. This area must not overlap with the areas used for program instructions and data.
Microcomputer
A microcomputer is a computer whose central processor is a microprocessor. In addition to the CPU, it has internal memory, a clock generator and input/output circuits. A microcomputer consists of the following elements:
- Central processing unit (CPU).
- RAM for data.
- ROM containing program instructions.
- Input/output circuits (I/O).
- Clock generator.
The clock generator is a circuit that sets the pace at which the computer’s components operate. It is an oscillator, a circuit that generates a signal at a given frequency. This clock signal is sent to several circuits, including the CPU, to synchronize them. Its frequency is measured in millions of cycles per second (MHz).
The simplest microcomputer consists of a CPU and ROM. A microcomputer can also be part of a larger system that includes:
- Mass storage for data and programs.
- Various computing units.
- Devices or units for communicating with the user.
- Sensors and transducers that provide the system with information about specific conditions and states.
Controllers
Controllers are integrated circuits (ICs) that form part of a computer’s hardware.
These circuits help the CPU perform its work more efficiently. Controllers can be divided into two groups according to their function:
- Controllers for peripheral devices.
- Controllers for units inside the computer.
The first group includes:
- Serial and parallel interface controllers.
- Floppy disk or hard drive controllers.
- Display controllers.
- Keyboard controllers.
- Communications controllers.
The second group includes:
- Memory access controllers.
- CPU interrupt controllers.
Two controllers for internal computer units are described below.
Direct Memory Access Controller (DMA Controller)
A memory access controller relieves the CPU of control duties while information is exchanged between an internal memory unit, whether RAM or ROM, and an external unit or peripheral device.
This controller assists the CPU. While the memory access controller carries out its assigned task, the CPU can perform another operation as part of the task it has been given.
Interrupt Controller
Data processing involves various units inside or outside the computer. Each unit is managed by its own controller.
If one of these units needs to tell the CPU that it requires more data, the sequence is as follows:
- The unit sends a request to the CPU.
- The CPU receives the request, interrupts its current work and sends an acknowledgment.
- Once the acknowledgment is received, the peripheral device communicates with the CPU through its controller.
- When the exchange between the external unit and the CPU is complete, the CPU resumes the program where it left off.
The interrupt controller operates at the first step of this process. It receives interrupt requests from peripheral devices, prioritizes them and sends an interrupt to the CPU. Data processing inside a computer requires devices that allow the CPU and peripherals to communicate. Through these devices, the CPU sends messages to the operator, either displayed on a screen or printed. The operator can also send messages to the CPU using the keyboard and input unit.
