Microprocessor
El microprocesador ejecuta instrucciones, realiza operaciones sobre los datos y se comunica con otras unidades de la computadora mediante buses.
A microprocessor is defined as a central data processing unit implemented on a single integrated circuit (IC) with a high degree of component integration. It can be built using either bipolar or MOS technology. A microprocessor operates under the control of a program and performs the following operations:
- Logical operations.
- Arithmetic operations.
- Control of data input and output.
- Control of functions and units external to the microprocessor but internal to the computer.
In computing, the microprocessor is known as the CPU, or central processing unit.
The development of microprocessors was driven first by advances in integrated circuits, which allowed more components to be integrated at lower cost, and second by the design of circuits whose functions could be changed through programming. This made them suitable for many uses and displaced the hardwired logic of early computers, where changing a program meant rewiring connections. Both advances in hardware and advances in software methods therefore contributed to the development of microprocessors.
Microprocessors can be grouped by word size or, more broadly, by the number of bits in the data bus, which may be 4, 8, 16 or 32 bits.
Internal Structure of a Microprocessor
A microprocessor consists of the following parts:
- Arithmetic logic unit.
- Control unit.
- Accumulator.
- Instruction register.
- Instruction decoder.
- Program counter.
- Address registers.
- Status registers.
- Stack register.
These blocks are interconnected through the microprocessor’s internal bus. To communicate with external units, the microprocessor uses three external buses:
- Control bus.
- Address bus.
- Data bus.
Some microprocessors use separate buses for addresses and data, while others use the same bus to carry both.
Arithmetic Logic Unit
This unit performs the system’s calculations. It can carry out logical operations (AND, OR and XOR) and arithmetic operations (addition, subtraction and so on). It has two inputs and one output. One input comes from the accumulator and the other from main memory. The output can be connected to the accumulator.
Control Unit
The control unit regulates the flow of information, including instructions and data, within the system. Its functions include:
- Fetching instructions from memory.
- Decoding, interpreting and executing instructions.
- Controlling the execution sequence by determining which instruction to execute next.
- Recognizing interrupts, direct memory access requests, halt commands, wait commands and similar signals.
Accumulator
The accumulator is a register that temporarily stores the data to be operated on. Arithmetic and logical operations, as well as bit rotations and shifts, are generally performed through this register.
Instruction Register
The instruction register temporarily stores part of the instruction. An instruction consists of two parts:
- An operation code, which specifies the operation to perform, such as addition or a shift.
- The operands associated with the operation code, such as data or addresses.
The instruction read from memory is loaded into the instruction register and remains there throughout execution.
Instruction Decoder
The instruction decoder reads the contents of the instruction register, decodes them and ensures that the instruction is executed correctly.
Program Counter
The program counter is a pointer that indicates the next instruction to execute. After each instruction is executed, the counter is incremented to give the address of the next instruction. Some software instructions can modify the contents of the program counter and thereby change the order of execution.
Address Registers
These are internal microprocessor registers used to store data or intermediate results. Their main advantage is speed. Without these registers, the CPU would have to store intermediate data in external memory. This would slow down each operation because reading from and writing to an internal CPU register is faster than accessing external memory.
The number and capacity of these registers vary by microprocessor.
Status Registers
Each status register contains a set of bits that change according to the result of a microprocessor operation. The register also records the microprocessor’s operating mode or current state.
The number of flags varies by model. A given microprocessor model has a fixed set of flags, such as the following:
- The carry flag is set to 1 when an arithmetic result exceeds the capacity of the accumulator register.
- The sign flag records whether the result is positive or negative. A negative result is represented by 1 and a positive result by 0.
- The parity flag checks the parity of the data in the accumulator. If the flag is set to 1, the register contains an even number of 1 bits.
- The zero flag is set to 1 when an arithmetic or logical operation produces a result of zero. A flag value of 0 indicates a nonzero result.
