MCU core 'CPU', output of calculation results
Accumulator, direct input of calculation results, simple structure
FIFO, designed to improve computational performance and temporarily store data
[Editor's Note] When we talk about semiconductors, we tend to think of semiconductors that are familiar to the general public, such as the CPU and memory of computers. On the other hand, MCUs (Micro Controller Units), which are core semiconductors used to operate electronic products, are semiconductors that are still unfamiliar to the general public, even though they are commonly used in all electronic products that we easily come across. These MCUs have recently been in the news due to the semiconductor shortage, and they are beginning to attract the attention of the general public. Accordingly, our magazine has prepared a place to learn about MCUs through a series of articles by Yuji Kawano, Manager of ST Microelectronics, a company specializing in MCU semiconductors.

The core component of a microcontroller (MCU) is the CPU. About 30 years ago, an MCU meant only a CPU, and the memory and peripheral modules were connected to the MCU in the form of separate ICs on the same printed circuit board (PCB).
The term CPU stands for Central Processing Unit. The CPU receives data and outputs the results of computational execution by controlling input/output devices (peripheral modules).
There are two types of CPUs, each of which uses a different type of register to temporarily store data during operations. One CPU uses general-purpose registers (register CPUs), while the other uses accumulators (accumulator CPUs).
In digital circuits such as MCUs, flip-flops and other circuits that store data are called 'registers'.
A register is similar to a memory in that it is used to store data, but it is a storage circuit with a relatively small capacity.
A general-purpose register is a type of register found inside the CPU that temporarily stores data used in instructions. The CPU contains a number of general-purpose registers.
On the other hand, peripheral registers are registers that store setting values or measurement results for peripheral modules (e.g. timers, USARTs, and ADCs).
Depending on the MCU, the names for peripheral registers may vary. The ARM Cortex-M3 processor used in the STM32 produced by STMicroelectronics uses general-purpose registers.
An accumulator is a different type of register. It has the same structure as a general-purpose register and stores data.
However, while a register CPU is equipped with multiple general-purpose registers and operations are performed between the registers, an accumulator CPU is equipped with only one accumulator and operations are performed only between the accumulator and memory. The result of the operation is entered into an accumulator (memory in some MCUs).
The accumulator got its name because the accumulated values of the operation results are repeatedly added together, and the operation result is always used as the input of the accumulator. One of the advantages of the accumulator CPU is that the circuit structure is simpler than that of the register CPU.
Although almost all MCUs today use register CPUs, ST's STM8 series is a high-performance MCU line that uses accumulator CPUs.

▲Figure 1. CPU block diagram
Figure 1 shows a block diagram of the CPU. The top part of the block diagram shows the execution unit of the CPU registers, and the bottom part shows the accumulator CPU.
To help you understand the basic concepts of these two types of CPUs, the block diagram shows only the major components.
The only difference between a register CPU and an accumulator CPU is in the internal structure of the execution unit.
When a command code is input from memory (ROM), it is first stored in the FIFO pre-fetch buffer. FIFO stands for First In, First Out.
There are different pronunciations, but it is commonly pronounced as 'fai-fo' and 'fee-fo'.
A buffer is a memory that temporarily stores data, and a FIFO buffer is a memory that processes data sequentially.
The word 'pre-fetch' means 'to read in advance'. In short, the FIFO prefetch buffer is a 'buffer that reads and stores data in advance'. This high-speed computational memory is designed to improve computational performance.
The decoder, as the name suggests, interprets the instructions. It reads the instructions from the FIFO prefetch buffer in order and determines what type of instruction it is. It also sends the instructions to the execution unit according to their function.
The execution unit, as the name suggests, is a device that executes instructions. This device is used to calculate data in registers or accumulators through the ALU and shifters that perform arithmetic functions.

▲Figure 2. Command processing process of the register CPU
Figure 2 shows how the register CPU performs operations.
The CPU performs several other types of tasks, including address calculations, interrupt handling, and processing (carrying and retrieving) the results of operations. These various tasks will be described in more detail later.