2.0 Module II: The Core of the Machine: Processors and Architectures
2.1 The Central Role of the Processor
The processor is the heart of an embedded system. It is the fundamental unit responsible for taking inputs, processing data according to a set of instructions, and producing outputs. For any embedded systems designer, a thorough understanding of processor fundamentals is non-negotiable, as it dictates the system’s capabilities, performance, and overall efficiency.
A processor contains two essential units that work in tandem:
- Program Flow Control Unit (CU): This unit, often simply called the Control Unit, manages the flow of the program. It includes a fetch unit that is responsible for retrieving instructions from memory.
- Execution Unit (EU): This unit carries out the instructions fetched by the CU. Its circuits implement data transfer operations, convert data from one form to another, and execute program control tasks such as jumps and interrupts. The EU contains the Arithmetic and Logical Unit (ALU), which performs all mathematical and logical calculations.
The processor operates on a fundamental “fetch and execute” cycle, continuously retrieving the next instruction from memory via the CU and executing it with the EU.
2.2 A Taxonomy of Processors
The term “processor” encompasses a wide range of devices, each tailored for different applications. They can be broadly classified as follows:
- General Purpose Processor (GPP)
- Microprocessor
- Microcontroller
- Embedded Processor
- Digital Signal Processor
- Media Processor
- Application Specific System Processor (ASSP)
- Application Specific Instruction Processors (ASIPs)
- GPP or ASIP cores on an Application Specific Integrated Circuit (ASIC) or a Very Large Scale Integration (VLSI) circuit.
For the purpose of introductory embedded systems, the most important distinction is between the Microprocessor (a single VLSI chip containing a CPU) and the Microcontroller (a single-chip VLSI unit with a CPU, memory, and I/O integrated).
2.3 Comparative Analysis: Microprocessor vs. Microcontroller
While related, microprocessors and microcontrollers are designed for fundamentally different purposes. The choice between them is a critical design decision.
| Microprocessor | Microcontroller |
| Designed for multitasking, allowing multiple tasks to be performed simultaneously (e.g., playing music while editing text on a computer). | Oriented towards a single task, such as a washing machine designed only for washing clothes. |
| Core components like RAM, ROM, I/O ports, and timers must be added externally and can vary in number. | Key components like RAM, ROM, I/O ports, and timers are embedded on the chip and are fixed in number. |
| System designers have the flexibility to decide the amount of memory and the number of I/O ports needed for the application. | The fixed number of integrated components makes a microcontroller ideal for a limited but specific task. |
| The need for external memory and I/O ports makes a microprocessor-based system heavier and more costly. | The integrated, single-chip design makes microcontrollers lightweight and cheaper than microprocessors. |
| External devices require more board space and their power consumption is typically higher. | A microcontroller-based system consumes less power and takes up significantly less space. |
2.4 System Architecture: Memory Organization
The way a system organizes its memory for storing program instructions and data defines its fundamental architecture. There are two primary models.
Von Neumann Architecture
Proposed by the computer scientist John von Neumann, this architecture is defined by its use of a single data path or bus for both instructions and data. Because they share a common bus, the CPU can only perform one operation at a time: it either fetches an instruction from memory or performs a read/write operation on data. It cannot do both simultaneously. This design supports simpler hardware and allows for the use of a single, sequential memory space.
Harvard Architecture
The Harvard architecture features separate storage and signal buses for instructions and data. This physical separation is its key advantage, as it allows the CPU to access both instructions and data simultaneously. In this model, data storage is entirely contained within the CPU, and there is generally no way to access the instruction storage area as if it were data.
Architectural Comparison
| Von-Neumann Architecture | Harvard Architecture |
| Uses a single memory to be shared by both code and data. | Uses separate memories for code and data. |
| Requires two clock cycles, as the processor must fetch code in one cycle and data in another. | Is sufficient with a single clock cycle, as separate buses are used to access code and data. |
| Higher speed, thus less time consuming. | Slower in speed, thus more time-consuming. |
| The hardware design is simple. | The hardware design is complex. |
(A note from the professor: The speed comparison in the table above is reproduced faithfully from the source material, but it is a common point of confusion and likely an error in the source. In practice, the Harvard architecture’s parallel buses for instructions and data allow for simultaneous access, which generally leads to higher performance by eliminating the “Von Neumann bottleneck” where data and instruction fetches compete for the same bus.)
2.5 Instruction Set Architecture: CISC vs. RISC
The final architectural consideration is the design philosophy behind the processor’s instruction set—the set of commands it can execute.
- Complex Instruction Set Computer (CISC): This architecture can address a large and complex number of instructions. The emphasis is on having powerful instructions that can accomplish multi-step operations in a single command.
- Reduced Instruction Set Computer (RISC): Developed in the early 1980s, the RISC philosophy proposed that computers should use fewer, simpler instructions that could be executed much faster within the CPU, without needing frequent memory access.
Architectural Comparison
| CISC | RISC |
| Instruction Set Size | A larger set of instructions, which can be easier to program with. |
| Programming Difficulty | Easy to program. |
| Compiler Design | Simpler compiler design, considering the larger instruction set. |
| Addressing & Format | Many addressing modes, leading to complex instruction formats. |
| Instruction Length | Instruction length is variable. |
| Clock Cycles per Instruction | Higher CPI (multiple cycles per instruction). |
| Design Emphasis | Emphasis is on the hardware. |
| Control Unit | Implements the large instruction set using a micro-program unit. |
| Execution Speed | Slower execution, as instructions must be read from memory and decoded. |
| Pipelining | More complex to implement. |
Having reviewed the general theories of processors and architectures, we will now shift our focus to a specific, historically significant microcontroller that serves as an excellent platform for learning: the 8051.