Microprocessor Lecture Notes PDF
Document Details
Uploaded by Deleted User
Wesleyan University-Philippines
2025
Engr. Robert Miranda
Tags
Summary
These are lecture notes on microprocessors and microcontrollers, covering topics such as introduction, building blocks, technical parameters, common types, and current trends.
Full Transcript
Microprocessors and Microcontroller Lecture Notes Prepared by: Engr. Robert Miranda Department of Engineering College of Engineering and Computer Technology Wesleyan University Philippines January 12, 2025 Contents 1 Introduction...
Microprocessors and Microcontroller Lecture Notes Prepared by: Engr. Robert Miranda Department of Engineering College of Engineering and Computer Technology Wesleyan University Philippines January 12, 2025 Contents 1 Introduction to Microprocessor and Microcontroller 2 1.1 About the course............................... 2 1.2 Microprocessor................................ 2 1.2.1 What is a microprocessor?..................... 2 1.2.2 Building Block of a Microprocessor................. 3 1.2.3 Key Technical Parameters...................... 4 1.2.4 Common Type of Microprocessors Based on Architecture..... 4 1.2.5 Common Types of Microprocessor Based on Application..... 6 1.2.6 Current Trends in Microprocessor Industry............. 7 1.3 Microcontroller................................ 9 1.3.1 What is a microcontroller?...................... 9 1.3.2 Building Block of a Microcontroller................. 9 1.3.3 Microprocessor Vs Microcontroller.................. 10 1.3.4 Common Types of Microcontroller................. 11 2 SAP-1 Architecture 12 2.1 What is SAP-1?................................ 12 2.1.1 How SAP 1 Works?.......................... 13 3 Modern Processors 16 3.1 Desktop Processors.............................. 16 3.1.1 Intel Core i9-14900K......................... 16 3.1.2 AMD Ryzen 9 7950X3D....................... 18 3.1.3 M3 Max chip............................. 19 3.2 Mobile Processors............................... 20 3.2.1 Dimensity 9300 SoC......................... 20 3.2.2 Qualcomm Snapdragon 8 Gen 3................... 22 3.2.3 Apple A18............................... 23 4 Development Boards 25 4.1 Arduino Uno: The Educational Pioneer................... 25 4.2 ESP32: The Wireless Wonder........................ 25 4.3 STM32: The Professional’s Choice..................... 26 4.4 Raspberry Pi Pico: The Versatile Newcomer................ 26 1 Chapter 1 Introduction to Microprocessor and Microcontroller 1.1 About the course This course covers concepts involving microprocessor/microcontroller systems architec- ture/organization including microprocessor/microcontroller programming, interfacing tech- niques, memory systems, and bus standards. In the laboratory, the students will be involved in experiments using microcontrollers and the use of microprocessor/microcon- troller development systems and other tools. By the end of this course, the student will be able to: 1. Explain the concepts behind microprocessor systems and their components 2. Differentiate between microprocessors and microcontrollers 3. Explain the different architecture and application of microprocessors and microcon- troller 4. Develop programs to run on microprocessors/microcontroller system using both as- sembly language and high-level language via cross-compilation 5. Interface microprocessors/microcontrollers to memory, I/O devices, and other system devices 6. Organize and explain the architecture of existing computer systems (e.g., desktops, workstations, etc.). 7. Analyze the capabilities of different processors by programming a specific microcon- troller system to accept input, process data, and control physical devices. 1.2 Microprocessor 1.2.1 What is a microprocessor? A microprocessor is an integrated circuit (IC) that contains all the functions of a cen- tral processing unit (CPU) of a computer, condensed into a single chip. It’s essentially the ”brain” of a computer that performs arithmetic and logic operations, controls data flow, and processes instructions. TO further understand what is a microprocessor let’s talk about the history of microprocessor.In 1971 Intel introduced the first commercial microprocessor, the Intel 4004, a 4-bit processor developed for a calculator manufacturer. However due to its limited application further improvements were needed to accommodate the needs of different industry. By 1974 The Intel 8080, an 8-bit processor, became the 2 first truly universal microprocessor. Intel’s 8086 introduced the x86 architecture, which would become the foundation for modern PC processors. IBM chose Intel’s 8088 for its first PC, cementing Intel’s position in the personal computer market. By the late 1990’s rapid advancement in processor technology, including multi-core processors, improved power efficiency, and dramatically increased processing speeds. This increasing comput- ing capacity due to higher density of transistors inside microprocessors is predicted by Moore’s Law. Gordon Moore, co-founder of Intel, that the number of transistors on a microchip would double every two years. 1.2.2 Building Block of a Microprocessor To better understand how microprocessor works, let us discuss some core components of microprocessors - Arithmetic Logic Unit (ALU): Designed to perform arithmetic operations (like add, subtract, multiply, divide, and compare numbers), logical operations (like AND, OR, and NOT), memory, register and program sequencing operations. - Control Unit: A control unit supervises instruction execution for smooth execution; it coordinates the processor’s actions with other units. It accesses instructions from mem- ory, decodes them, and controls the flow of data within the processor - Registers: These are very small, high-speed storage locations used to hold data tem- porarily during processing. Some most widely and commonly used registers in processors are instruction register (IR), program counter (PC), memory address register (MAR), memory data register (MDR), and general-purpose registers like accumulator, and index registers. Registers hold intermediate results obtained from processing. - Bus: Buses are the connection lines which are designed specifically to do the data transfer between multiple components of the system. Hence, it is used for the data com- munication. Buses carry actual data being processed by the CPU or transferred between system components like CPU and memory. It’s like the lanes on the highway where the vehicles move.Data buses are an essential part of computer architecture that influence the speed and efficiency of data transfer within a system. They are available in a variety of sorts and configurations, including address buses, control buses, and data buses, with each serving a unique purpose in aiding system communication. Data Bus Lines that carry data to and from memory are called data buses. It is a bidirectional bus with a width equal to the word length of the microprocessor. Data buses consist of parallel wires/lines that carry data in binary form like 0s and 1s. The width of the data bus controls how much data may be carried simultaneously. For example, a 32-bit data bus can transfer 32 bits of data in parallel, whereas a 64-bit data bus can transfer 64 bits at once. Address Bus It is a unidirectional responsible for carrying the address of a memory lo- cation or I/O port from CPU to memory or I/O port. In addition to the data bus, the address bus is an important component of a computer’s architecture. A data bus transfers actual data between components, whereas the address bus trans- ports information about where the data should go or originate from. Control Bus Lines that carry control signals like clock signals, interrupt signals or ready signals are called control buses. They are bidirectional. These signals make sure that operations are carried out in a proper sequence and at the right time. For example - a signal that indicates to a device to interrupt its process is called an interrupt signal. 3 1.2.3 Key Technical Parameters When choosing a microprocessor there are many things to consider, from the technical specification of the microprocessor itself to the specific application where we wish to use it. This is one of the tasks that we may encounter as an engineer, choosing the right microprocessor could be the deciding factor if a certain project would be successful or not. Choosing a wrong microprocessor for a project may result in higher cost, lower capabilities, slower processing, and integrity. Below are some of the technical parameters of microprocessors. However students are encourage to read some actual datasheets from different manufacturers to see how these parameter affect in real practices. - Clock Speed: Clock Speed refers to the rate at which a microprocessor executes instruc- tions is measured in cycles per second (Hertz). Higher clock speeds often lead to faster processing. - Number of Cores: A hardware term that describes the number of independent central processing units in a single computing component (die or chip). - Cache Size: Amount of integrated high-speed memory that is close to the CPU to store frequently accessed data and instructions. It minimizes access time and enhances system performance. - Instruction Set Architecture (ISA) is part of the abstract model of a computer that defines how the CPU is controlled by the software. The ISA acts as an interface between the hardware and the software, specifying both what the processor is capable of doing as well as how it gets done. The ISA provides the only way through which a user is able to interact with the hardware. It can be viewed as a programmer’s manual because it’s the portion of the machine that’s visible to the assembly language programmer, the compiler writer, and the application programmer. The ISA defines the supported data types, the registers, how the hardware manages main memory, key features (such as virtual mem- ory), which instructions a microprocessor can execute, and the input/output model of multiple ISA implementations. The ISA can be extended by adding instructions or other capabilities, or by adding support for larger addresses and data values. - Manufacturing process refers to the process of how a chip is manufactured. Different manufacturing process results to different transistor size commonly measured in nanome- ters. The smaller the size of the transistor the more transistors we can put inside a chip resulting more transistor density and faster processing speed. - Power Consumption: Measured in watts, indicates how much electrical energy a mi- croprocessor consumes to perform its tasks. Some microprocessors will have varying power consumption depending on the task its doing. Efficiency is also a concern as some microprocessor will consume the same amount of energy but give a slower performance. 1.2.4 Common Type of Microprocessors Based on Architecture Von Neumann Architecture Von Neumann Architecture is a fundamental computer design model where both pro- gram instructions and data share the same memory space and use the same bus system. This architecture forms the basis of most modern computers.It was developed by John von Neumann in 1945 he based his design on his ENIAC’s development experience. This architecture revolutionized computer design by introducing stored-program concept. Let us discuss its key components and its working principle that set its legacy and pave the way for more advance architecture. 4 Key Components: 1. Memory Unit: 2. Central Processing Unit (CPU): 3. Input/Output System: 4. System Bus: Operating Principles: 1. Fetch-Execute Cycle: - Fetch: Retrieve instruction from memory - Decode: Interpret the instruction - Execute: Perform the required operation - Store: Save results back to memory 2. Sequential Execution: - Instructions executed one after another - Program Counter tracks next instruction - Can be modified for branching/jumping Key Characteristics: 1. Advantages: Simple and elegant design, Flexible program modification, Efficient mem- ory usage, Universal computing capability 2. Limitations: Von Neumann bottleneck (memory bandwidth limitation), Sequential instruction execution, Shared bus for data and instructions, Memory access speed limi- tations Harvard Architecture Harvard Architecture is a computer design model where program instructions and data are stored in separate memory spaces, using different buses for access. This separation allows for simultaneous access to both instruction and data memory. This architecture originated from the Harvard Mark I computer (1944) under the supervision of Howard Aiken from Harvard University. Its initially used in early computers with separate storage systems and became popular in digital signal processors and microcontrollers. CISC CISC (Complex Instruction Set Computer) architecture is a computer architecture where processors have a large set of complex machine language instructions, with many special- ized instructions and addressing modes designed to execute complex operations with a single instruction. It emerged during the era of expensive memory and simple compilers in 1960’s. Intel 8080 introduced many CISC features and in 1978: Intel x86 architec- ture that is based on CISC was released. Today it is still dominant in desktop/laptop computers through x86 architecture. RISC RISC (Reduced Instruction Set Computer) architecture is a CPU design philosophy that emphasizes simplicity and efficiency through the use of simplified instructions that can be executed in a single clock cycle. This approach contrasts with CISC (Complex Instruc- tion Set Computer) architecture.During the late 1970s, research begins at IBM (IBM 5 801) and UC Berkeley and by 1981, the first RISC papers were published by Patterson and Ditzel. It is further developed and ARM (Advanced RISC Machines) was established in 1990. Today RISC Architecture dominates mobile devices, microcontrollers, embed- ded systems and other application specific microprocessors. Popular architecture based on RISC include ARM that mainly dominates mobile devices, RISC-V mainly used in academic and commercial adoption, MIPS that can be found in embedded systems and gaming consoles, SPARC taht is commonly used in Server systems. 1.2.5 Common Types of Microprocessor Based on Application The Versatile Generalists: General-Purpose Microprocessors At the heart of most computers lies the general-purpose microprocessor, a marvel of engineering that serves as the brain of our digital devices. These processors are like skilled conductors, orchestrating a complex symphony of calculations and operations. They house sophisticated components like the Arithmetic Logic Unit (ALU), which handles mathematical calculations, and the Control Unit, which directs traffic between different parts of the system. Think of these processors as universal translators, capable of understanding and exe- cuting a vast array of instructions. They’re the jack-of-all-trades in the processor world, equally comfortable running your favorite game, crunching numbers in a spreadsheet, or editing your holiday videos. Two major families dominate this landscape: the x86 architecture, championed by Intel and AMD, and the ARM architecture, which has found its way into everything from smartphones to Apple’s revolutionary M-series chips. A newcomer, RISC-V, has emerged as an open-source alternative, promising innovation through collaboration and openness. The Specialized Craftsmen: Embedded Microprocessors While their general-purpose cousins tackle broad challenges, embedded microprocessors are like skilled artisans, each crafted for specific tasks. These processors are the hidden heroes in your microwave, car engine, and smart thermostat. They’re designed with efficiency and reliability in mind, often working tirelessly for years without a moment’s rest. These processors excel in real-time processing, where split-second decisions can make all the difference. They’re the guardians of precision in industrial automation, the en- ablers of modern automotive safety systems, and the brains behind countless Internet of Things (IoT) devices. The Signal Specialists: Digital Signal Processors (DSPs) In the realm of signal processing, DSPs reign supreme. These specialized processors are like master musicians, capable of processing complex audio and video signals with incredible precision. They’re the reason your noise-canceling headphones can create an oasis of silence in a noisy world, and why your smartphone can capture and process high-quality video in real-time. With their unique architecture optimized for mathematical operations, DSPs have be- come indispensable in everything from telecommunications to medical imaging. They’re 6 the unsung heroes behind crystal-clear voice calls and the sharp images in your ultrasound scan. The Visual Artists: Graphics Processing Units (GPUs) The story of GPUs is one of transformation. What began as specialized circuits for rendering graphics has evolved into powerful parallel processors capable of much more. Modern GPUs are like digital artists with thousands of hands, capable of painting millions of pixels on your screen while simultaneously helping scientists simulate climate models or train artificial intelligence systems. These processors have revolutionized gaming with technologies like ray tracing, which simulates the behavior of light to create stunningly realistic images. But their true power lies in their ability to perform thousands of calculations simultaneously, making them invaluable for everything from cryptocurrency mining to scientific research. The Custom Craftsmen: Application-Specific Integrated Circuits (ASICs) ASICs are the master craftsmen of the processor world, designed and optimized for spe- cific tasks. Unlike their more flexible cousins, these processors are like specialized tools, created to do one thing exceptionally well. You’ll find them in cryptocurrency mining rigs, network routers, and various specialized industrial equipment. The Desktop Warriors In the realm of desktop computing, processors like the Intel Core i9-14900K and AMD Ryzen 9 7950X3D represent the cutting edge of consumer computing technology. These processors are like powerful engines, with multiple cores working together to handle everything from gaming to content creation. The Mobile Innovators In the mobile world, processors like Apple’s M3 Max, MediaTek’s Dimensity 9300, and Qualcomm’s Snapdragon 8 Gen 3 are pushing the boundaries of what’s possible in portable devices. These chips combine powerful processing capabilities with energy efficiency, enabling everything from high-end gaming to sophisticated AI applications on mobile devices. As we look to the future, these various processor families continue to evolve, each pushing the boundaries of what’s possible in their respective domains. Whether it’s the raw power of desktop processors, the efficiency of mobile chips, or the specialized capabilities of embedded systems, each has its role to play in our increasingly digital world. Together, they form the foundation upon which our modern technological society is built, enabling innovations that would have seemed like science fiction just a few decades ago. 1.2.6 Current Trends in Microprocessor Industry The microprocessor industry is at the forefront of technological innovation, with key players and emerging trends shaping the future of computing. Let us discuss the current trends, significant players, and key advancements in microprocessor industry. Key Players in the Microprocessor Industry Intel Core Series Processors: Intel’s Core series (i3, i5, i7, i9) remains a staple for desktop and 7 laptop computing. These processors are designed for a wide range of applications, from entry-level computing (i3) to high-performance gaming and professional workloads (i9). Trends and Innovations: Adoption of Intel Evo platform for optimized laptops. Transi- tion to Intel 7 and 4 process nodes for higher performance and efficiency. Development of hybrid architectures, such as Alder Lake, combining performance and efficiency cores. AMD Ryzen Series Processors: AMD’s Ryzen processors compete with Intel, offering high performance at competitive prices. Their architecture focuses on multi-core performance and energy efficiency. Trends and Innovations: Use of 3D V-Cache technology to improve gaming and multitasking performance. Expansion into high-performance computing with EPYC processors for servers and data centers. Focus on Zen architecture advancements, driving power and efficiency improvements. ARM Dominance in Mobile Devices: ARM processors power the majority of mobile devices, offering exceptional energy efficiency and performance. Trends and Innovations: Expan- sion into PCs with ARM-based processors in devices like Chromebooks and Windows on ARM PCs. Enhanced AI capabilities and support for machine learning workloads. Collaboration with chip manufacturers like Qualcomm and MediaTek to develop next- generation processors. Apple M-Series Processors: Apple’s M-series chips (e.g., M1, M2) for Mac computers are based on ARM architecture and optimized for macOS. Trends and Innovations: Integration of CPU, GPU, and Neural Engine in a unified SoC (System on Chip). Focus on power efficiency, offering significant battery life improvements. Enhanced capabilities for video editing, AI applications, and professional workloads. Key Trends Shaping the Future of Microprocessors Quantum Computing Integration Microprocessors are being developed to work alongside quantum processors, enabling a hybrid computing model. Companies like IBM, Google, and Intel are exploring how to integrate quantum and classical computing for tasks like cryptography, optimization, and simulation. Neural Processing Units (NPUs) for AI Applications.NPUs are specialized chips designed to handle artificial intelligence workloads, such as image recognition and natural language processing.Increasingly integrated into mobile processors (e.g., Apple Neural Engine, Google Tensor) and server-grade CPUs for real-time AI processing. Advanced Manufacturing Processes The semiconductor industry is transitioning to smaller process nodes, with 3nm tech- nology becoming mainstream and 2nm under development. Benefits of smaller nodes includes Higher transistor density, Increased performance and energy efficiency, and Re- duced heat generation. Companies like TSMC, Samsung, and Intel are leading the race in advanced semiconductor fabrication. Increased Energy Efficiency As energy costs and environmental concerns rise, micro- 8 processors are being designed for greater power efficiency. Innovations such as dynamic voltage scaling, asynchronous designs, and hybrid architectures are driving improvements in performance-per-watt. Enhanced Security Features With increasing cyber threats, modern processors integrate advanced security mecha- nisms, such as: Hardware-based encryption, Trusted Execution Environments (e.g., Intel SGX, AMD SEV),Real-time threat detection and mitigation. These current trends in microprocessor industry led by different key players will surely shape how our future will look like. And at the core of these companies and organizations are innovators, engineers, and scientists like you. Arming yourself with knowledge about microprocessors will surely give you an edge in today’s competitive world. 1.3 Microcontroller 1.3.1 What is a microcontroller? A microcontroller (MCU) is essentially a small computer on a single chip. It is designed to manage specific tasks within an embedded system without requiring a complex op- erating system. These compact integrated circuits (ICs) contain a processor core (or cores), random-access memory (RAM) and electrically erasable programmable read-only memory (EEPROM) for storing the custom programs that run on the microcontroller, even when the unit is disconnected from a power supply. Unlike general-purpose micro- processors, microcontrollers integrate processing, memory and input/output (I/O) pe- ripherals—including timers, counters and analog-to-digital converters (ADCs)—into one efficient and cost-effective standalone unit. By combining multiple components into a single system, microcontrollers are well-suited for applications requiring real-time signal processing, such as controlling motors and servos and interfacing with various types of sensors and communications 1.3.2 Building Block of a Microcontroller The following are key components of a microcontroller: Central processing unit (CPU): Colloquially referred to as the “brain” of the computer, the CPU serves as the core component responsible for executing instructions and control- ling operations. Memory: Microcontrollers contain both volatile memory (RAM)—which, unlike program memory, stores temporary data that may be lost if the system loses power—and non-volatile flash memory for storing the microcontroller’s programming in- struction set (firmware). Peripherals: Depending on the intended application, a microcontroller might con- tain various auxiliary components, such as input/output (I/O) interfaces—including timers, counters, analog-to-digital (ADC) and digital-to-analog (DAC) signal convert- ers (ADCs)—and communication protocols (UART, SPI, I2C). Auxiliaries might also include components like LCD screens, ethernet connectivity ports or interfaces for such 9 types of modules. Microcontrollers are ideal for battery-operated consumer electronics, such as smartphones, smartwatches and other wearables, because they are lightweight, small and require comparatively low power. A favorite among open-source hobbyists, low-cost microcontrollers and microcontroller development boards, such as those made by Arduino and Adafruit, can be easily config- ured within an integrated development environment (IDE) using common programming languages like C, C++ and Python. Although readily accessible to even beginner de- velopers, microcontrollers are also frequently used to control systems in a wide range of professional applications, including prototyping, robotics, automotive systems, industrial automation and Internet of Things (IoT) applications. 1.3.3 Microprocessor Vs Microcontroller Microcontrollers and microprocessors share many similarities. Both can be described as single-chip processors capable of executing computing logic, and both are highly valuable in the development and proliferation of general computing technology. However, the two components differ in both hardware architecture and application. The defining characteristic of a microcontroller is the combination of all necessary computing elements into a single chip—microcontrollers do not require any additional external circuits to operate. Conversely, microprocessors consist of a CPU and several supporting chips providing memory, serial interface, I/O and other necessary features. While the terms microprocessor and CPU are sometimes used interchangeably, it’s more accurate to describe microprocessor semiconductors as single integrated circuits that contain a CPU and can be connected to other external auxiliaries, such as input/output devices. The main difference between these two types of microchips is that microcontrollers are self-contained, whereas microprocessors are designed to interface with external auxiliaries. As a result, generalized and demanding tasks that might require specialized hardware with increased processing power are better suited for microprocessors. Specific tasks within embedded systems, such as sensor or motor control, are good examples of suitable microcontroller applications. Key differences between microcontrollers and microprocessors When comparing mi- crocontrollers and microprocessors, it’s helpful to consider four key features: Integrations: Microcontrollers integrate CPU, memory and I/O auxiliaries onto a single chip. Microprocessors require external memory and additional auxiliaries. Ap- plications: Microcontrollers are better suited for specific, low-power or ultra-low power applications within embedded systems, such as home appliances or IoT devices. Micropro- cessors are more suitable for general-purpose and high-performance applications requiring more processing power, such as personal computers or the data centers’ servers. Perfor- mance: Microcontrollers are optimized for efficiency and real-time processing and operate at lower clock speeds up to 200MHz. Microprocessors are built for more demanding and complicated computations and can operate at clock speeds above 1 GHz. Operational costs: Microcontroller hardware is inexpensive, and because they do not require special- ized programming knowledge, they add little to overall project budgets. Microprocessors are more expensive and more complex. Configuring an advanced microprocessor-based system might require specialized skills. 10 1.3.4 Common Types of Microcontroller The first types of microcontrollers grew out of advancements made in microprocessor manufacturing as researchers developed techniques to integrate CPU, memory and pe- ripheral components into single chips. Texas Instruments engineers Gary Boone and Michael Cochran are credited with creating the first microcontroller in 1971. Manufacturers like Intel and various Japanese electronics vendors followed quickly. Today, dozens of different microcontroller manufacturers—such as Intel, NXP and Arm—offer hundreds of varieties, ranging from general-purpose options for hobbyists and amateurs to highly specialized solutions for professional technologists and all manner of industries. Here are some of the more common types of microcontrollers: 8-bit microcontrollers The most basic type of microcontroller, featuring limited processing and memory and typically used in small appliances like toys and remote controls. 16-bit microcontrollers Twice as capable as 8-bit models, 16-bit microcontrollers are used for more complex ap- plications, including medical devices, automotive systems and industrial control systems. 32-bit microcontrollers The most powerful and feature-rich type of microcontrollers, these are used for demand- ing applications, such as gaming consoles, entertainment devices and high-end industrial automation. Reduced instruction set computer (RISC) microcontrollers RISC microcontrollers incorporate a design architecture that simplifies and improves op- erations by executing fewer compute instructions faster than other methodologies, such as the complex instruction set computer (CISC) architecture. ARM microcontrollers Formerly an acronym for Advanced RISC Machines, these types of microcontrollers incor- porate the ARM architecture, including the modern ARM Cortex subset, that bolsters performance and reliability. ARM microcontrollers are widely used in mobile devices, automotive systems and industrial control systems. PIC microcontrollers Developed by Microchip Technology, the PIC microcontroller is the world’s smallest mi- crocontroller, found frequently in robotics, home and industrial automation and renewable energy systems. FPGA-based microcontrollers Commonly used in applications necessitating digital signal processing, video processing and high-speed networking, these microcontrollers use field-programmable gate arrays (FPGAs), which can be configured and reconfigured on the hardware level, to achieve highly versatile and customizable processing results. 11 Chapter 2 SAP-1 Architecture 2.1 What is SAP-1? Now that we’ve built a foundation in digital hardware concepts, we can explore how computers actually function. While many textbooks might jump into computer design at this stage, we’ll focus instead on understanding the basic operations. We’re going to concentrate mainly on assembly language programming, but first, we need to grasp some key hardware concepts to make sense of assembly language. The best way to learn this is through a common teaching approach: starting with an extremely basic computer model and gradually building it up into something more practical. We’ll begin with a design called ”Simple-As-Possible-1” (SAP-1), which, as its name suggests, is stripped down to the absolute basics. This method of starting with the simplest possible version and expanding it is like learning to walk before running - it gives us a clear understanding of the fundamental principles before we tackle more complex systems. The Simple-As-Possible (SAP) computer is a teaching tool that shows how computers work at their most basic level. It was introduced in the textbook ”Digital Computer Electronics” by Malvino and Brown, and it’s designed to help students understand com- puter architecture step by step. There are 3 version of SAP namely: 1. SAP-1: The most basic version, introducing fundamental concepts 2. SAP-2: Adds more computing abilities and control features 3. SAP-3: The final version, which is a complete, working computer What makes this approach particularly clever is that SAP-3’s design is compatible with the Intel 8080/8085 microprocessors - real processors that were widely used in early personal computers. This means that while students learn with simplified versions (SAP-1 and SAP-2), they’re building toward understanding actual commercial technology. Think of it like learning to drive: SAP-1 is like a go-kart (basic movement), SAP-2 is like a training car (more features but still simplified), and SAP-3 is like a real car (fully functional and similar to what’s used in the real world). Each version builds on the previous one, making the learning process more manageable while leading to practical understanding. SAP-1 is a computer with a bus-based architecture based on Von Neumann architec- ture. It contains the following components: A. 8-bit multiplexed data/address bus B. 4/8-bit edge-triggered registers - The registers than can write to the bus contain an internal tristate buffer. Those that cannot do not have this buffer C. Program counter (PC) 12 D. Input and memory address register (MAR). E. Instruction register (IR). F. Accumulator (A). G. B register. H. Output register (OUT). I. Random-Access Memory (RAM) for reading/writing operations of size 16×8 bits (16 8-bit positions each). It is unified for data and programs. J. Arithmetic-Logic Unit (ALU) with two operations (addition and subtraction) for 8-bit two’s complement data (ranging from -128 to +127, both included). K. LED display for visualizing the data stored in the OUT register. In this simulator, we show directly the value corresponding to this display in decimal format. L. Control unit (CU), of type controller-sequencer. 2.1.1 How SAP 1 Works? SAP -1 uses reduced instruction set and is limited only to the most basic instructions or also called as OP-code (LDA, ADD, SUB, OUT, HLT). Let us first familiarize ourselves with the table below: Instruction Mnemonics Opcode Load Accumulator LDA 0000 Add B+A ADD 0001 Subtract B+A SUB 0010 Output OUT 1110 Halt Program HLT 1111 Table 2.1: List of Supported Instructions in SAP-1 To better understand this instruction and how SAP 1 works let us dissect the program shown below: Address Binary Value 0000 00001111 0001 00011110 0010 11100000 0011 11110000 1110 00000101 1111 00000001 Table 2.2: SAP-1 Program and Memory Layout Just like any other microprocessor, SAP 1 follows the Fetch-Decode-Execute cycle Since the SAP-1 has 24 or 16 memory addresses, the program counter will fetch at mem- ory address 0000 upon running the program. Let’s follow the data path step by step: 0000 FETCH CYCLE: Program Counter (PC) reads the content of memory address 0000 PC sends 0000 to Memory Address Register (MAR) 13 Memory outputs instruction 00001111 to Bus The 4 most significant bits (0000) go to Instruction Register (IR) PC increments to 0001 for next instruction 0000 DECODE CYCLE: Control unit recognizes 0000 as LDA 0000 EXECUTION CYCLE: Last 4 bits (1111) from IR go to MAR Memory at address 1111 contains 00000001 This value moves to Bus Finally, 00000001 is loaded into Accumulator 0001 FETCH CYCLE: PC (now at 0001) sends to MAR Memory outputs 00011110 to MBR 0001 goes to IR PC increments to 0010 0001 DECODE CYCLE: Control unit recognizes 0001 as ADD 0001 EXECUTION CYCLE: Address 1110 goes to MAR Memory at 1110 contains 00000101 This moves to MBR ALU adds MBR (00000101) and Accumulator (00000001) Result 00000110 (6) goes to Accumulator 0010 FETCH CYCLE: PC (0010) to MAR Memory outputs 11100000 to MBR 1110 goes to IR PC increments to 0011 0010 DECODE CYCLE Control unit recognizes 1110 as OUT 0001 EXECUTION CYCLE for OUT: Accumulator value (00000110) transfers to Output register Output displays 6 0011 FETCH CYCLE: PC (0011) to MAR Memory outputs 11110000 to MBR 1111 goes to IR PC would increment but HLT prevents this 0011 DECODE CYCLE: Control unit recognizes 1111 as HLT 0011 EXECUTION CYCLE for HLT: All clock signals stop Program ends 14 SAP 1 Simulators To better understand the data flow and how SAP 1 works, you can visit this SAP 1 Online simulator created by Louie Almeda of Technological University of the Philippines and try the following problems and see if you got the correct answers: 4 + 21 12 + 8 + 65 8-3 15 Chapter 3 Modern Processors To see how much the microprocessor has evolved from a very basic 4004 microprocessor, let’s discuss some of the most recent microprocessor found in desktop processor and mobile processors available in the market today. 3.1 Desktop Processors 3.1.1 Intel Core i9-14900K Specifications Core Architecture Raptor Lake Refresh architecture 24 cores total (8 P-cores + 16 E-cores) 32 threads Intel 7 process technology (10nm Enhanced SuperFin) Up to 6.0 GHz max turbo frequency 36MB Intel Smart Cache (L3) 32MB L2 Cache Integrated Intel UHD Graphics 770 Advanced Features Intel Thermal Velocity Boost Intel Adaptive Boost Technology Intel Turbo Boost Max 3.0 Intel Speed Optimizer Intel Thread Director 16 Support for DDR5-5600 and DDR4-3200 PCIe 5.0 support (20 lanes) Intel Quick Sync Video Performance Characteristics Power Specifications Base power: 125W Maximum Turbo Power: 253W Unlocked multiplier for overclocking Intel Speed Shift Technology Enhanced Intel SpeedStep Technology Memory Support Dual-channel DDR5-5600 Dual-channel DDR4-3200 Up to 192GB maximum memory Memory controller integrated XMP 3.0 support Key Technologies Performance Features Hybrid Architecture (P-cores + E-cores) Enhanced core communication Advanced thread scheduling Improved power management Enhanced overclocking capabilities Security Features Intel Software Guard Extensions Intel OS Guard Intel Boot Guard Intel Trusted Execution Technology Control-flow Enforcement Technology 17 3.1.2 AMD Ryzen 9 7950X3D Specifications Core Architecture Zen 4 architecture with 3D V-Cache 16 cores / 32 threads TSMC 5nm process Base Clock: 4.2 GHz Boost Clock: Up to 5.7 GHz 144MB total cache (128MB L3 + 16MB L2) PCIe 5.0 support (28 lanes) Integrated RDNA 2 graphics Cache Structure 128MB 3D V-Cache (L3) 16MB L2 cache (1MB per core) Vertically stacked cache design Low-latency cache access Gaming-optimized cache hierarchy Processing Capabilities AMD 3D V-Cache technology Hybrid CCD design One CCD with 3D V-Cache One standard CCD Thread scheduling optimization AMD EXPO memory overclocking 18 3.1.3 M3 Max chip Specifications Core Architecture 3nm manufacturing process Up to 16-core CPU – 12 performance cores – 4 efficiency cores Up to 40-core GPU 16-core Neural Engine Hardware ray tracing support Hardware mesh shading Advanced media engine Memory System Unified memory architecture Up to 128GB unified memory High memory bandwidth Low latency access High-speed memory bus Shared memory pool Performance Elements Neural Engine 16-core design Machine learning acceleration AI/ML workloads Real-time processing Advanced algorithms On-device learning 19 Media Engine ProRes acceleration H.264/HEVC encoding Hardware video decode Multiple stream processing High-resolution support HDR processing 3.2 Mobile Processors 3.2.1 Dimensity 9300 SoC Key Specifications CPU Configuration All-big core design 4x Cortex-X4 Prime cores (up to 3.25GHz) 4x Cortex-A720 Performance cores (up to 2.85GHz) TSMC 4nm manufacturing process Unique “All Premium” core layout APU 790 AI processor GPU Architecture Arm Immortalis-G720 MC12 GPU Hardware ray tracing Variable rate shading Advanced mesh shading MediaTek HyperEngine gaming technology Hardware-based motion blur reduction 20 Performance Features AI Capabilities APU 790 AI processor Mixed precision support AI-Super Resolution AI noise reduction Natural Language Processing Real-time AI processing Display Support Up to 4K resolution 180Hz refresh rate at FHD+ 144Hz at WQHD HDR10+ Adaptive refresh rate MEMC technology Connectivity Wireless 5G Sub-6GHz and mmWave WiFi 7 Bluetooth 5.4 GNSS with multiple constellation support NFC support Ultra-wideband (UWB) Memory Support LPDDR5X RAM UFS 4.0 storage High bandwidth memory bus Fast memory controller Enhanced memory management 21 Camera Capabilities Image Processing Imagiq 990 ISP HDR video capture AI-enhanced photography Multi-camera support 4K HDR video recording Real-time bokeh effects Advanced Features Native 4K60 HDR10+ AI noise reduction Multi-frame HDR Real-time portrait effects Night mode enhancement AI scene detection 3.2.2 Qualcomm Snapdragon 8 Gen 3 Core Specifications CPU Configuration 1x Cortex-X4 Prime core (up to 3.3 GHz) 3x Cortex-A720 Performance cores (3.2 GHz) 2x Cortex-A720 Mid cores (3.0 GHz) 2x Cortex-A520 Efficiency cores (2.3 GHz) TSMC 4nm manufacturing process GPU Adreno 750 GPU Hardware ray tracing support Variable rate shading Vulkan 1.3 support OpenGL ES 3.2 HDR gaming support 22 System Capabilities Performance Features Advanced thermal management Performance scheduler GameFirst network optimization Refresh rate optimization Touch latency reduction Background process management Memory and Storage Up to 24GB LPDDR5X RAM UFS 4.0 storage High-speed data transfer Gaming memory allocation Optimized storage management Cache optimization 3.2.3 Apple A18 Technical Specifications CPU Architecture 6-core architecture – 2 performance cores (up to 4.04 GHz) – 4 efficiency cores 5-core graphics processor 16-core Neural Engine 35 trillion operations per second Manufacturing and Memory TSMC 3nm process technology 8 GB LPDDR5X RAM 17% faster memory bandwidth vs previous generation Optimized power consumption 23 Key Features Performance 30% faster than A16 Bionic Hardware-accelerated ray tracing Enhanced graphics performance Improved power efficiency Connectivity Integrated 5G support Wi-Fi 7 support Enhanced wireless connections Advanced cellular capabilities Applications Powers iPhone 16 and iPhone 16 Plus Enhanced camera capabilities Advanced AI features Apple Intelligence support 24 Chapter 4 Development Boards 4.1 Arduino Uno: The Educational Pioneer The Arduino Uno stands as a cornerstone in the world of educational electronics, built around the ATmega328P microcontroller. This open-source platform operates at a 16 MHz clock speed and features 32 KB of Flash memory, with 0.5 KB reserved for the bootloader. The system includes 2 KB of SRAM and 1 KB of EEPROM, running at a standard operating voltage of 5V. The board’s input/output capabilities are comprehensive, featuring 14 digital I/O pins, six of which can handle PWM output. Users also have access to six analog input pins, complemented by a USB connection, power jack, ICSP header, and a reset button. Power requirements are flexible, accepting 7-12V input through the power jack or 5V via USB, while providing a 3.3V output pin. Each I/O pin can handle up to 40 mA, with the 3.3V pin supporting up to 50 mA. Programming the Arduino Uno is straightforward through the Arduino IDE, sup- porting both C and C++ programming languages. The board comes pre-installed with a bootloader and supports various communication protocols including UART (Serial), I2C, SPI, and USB connectivity through an FTDI chip. The programming structure follows a simple pattern: void setup() // Initial configuration void loop() // Main program loop Common functions like digitalWrite(), digitalRead(), analogWrite(), analogRead(), delay(), and millis() form the backbone of most Arduino programs. 4.2 ESP32: The Wireless Wonder The ESP32 represents a significant leap in microcontroller capability, featuring a dual-core Xtensa LX6 32-bit processor that can reach speeds up to 240 MHz. This system-on-chip includes 520 KB of SRAM, 448 KB of ROM, and typically 4 MB of Flash memory, along with an ultra-low power co-processor for enhanced efficiency. What sets the ESP32 apart is its comprehensive wireless connectivity. The chip in- cludes WiFi 802.11 b/g/n and Bluetooth 4.2 with BLE support, complete with advanced features like mesh networking and integrated TCP/IP stack. Security is robust, support- ing WPA/WPA2/WPA3 protocols. The I/O capabilities are extensive, with 34 programmable GPIO pins, 18 channels of 25 12-bit ADC, 2 channels of 8-bit DAC, and up to 10 touch sensors. The chip also includes a Hall sensor, SD card interface, Ethernet MAC interface, CAN bus 2.0, and IR support. 4.3 STM32: The Professional’s Choice The STM32 family of microcontrollers, based on ARM Cortex-M processors, represents a comprehensive solution for professional applications. The family spans from entry-level Cortex-M0/M0+ to high-performance Cortex-M7 processors, operating at frequencies up to 480 MHz. These devices can include up to 2 MB of Flash memory and 1 MB of RAM, supported by DMA controllers and cache memory. The peripheral set is particularly rich, including various communication interfaces (UART/USART, SPI, I2C, CAN, USB, Ethernet) and analog capabilities (12/16-bit ADCs, 12-bit DACs, comparators, op-amps). 4.4 Raspberry Pi Pico: The Versatile Newcomer The Raspberry Pi Pico, built around the custom RP2040 chip, brings dual-core processing to the entry-level market with its ARM Cortex M0+ processor running at 133 MHz. The board includes 264KB of SRAM and 2MB of Flash memory, complemented by DMA and USB controllers, plus a built-in temperature sensor. The board’s 26 multi-function GPIO pins support various interfaces including 2 UART, 2 SPI, and 2 I2C controllers, along with 16 PWM channels and 3 12-bit ADC inputs. A unique feature is its 8 Programmable I/O (PIO) state machines, enabling custom digital interface implementation. All these microcontrollers continue to evolve, with trends focusing on enhanced se- curity features, improved power efficiency, and expanded connectivity options. Their applications span from educational projects to professional industrial controls, making them essential tools in modern electronics development. 26 Bibliography 27 Glossary Microcontroller A compact integrated circuit designed to govern the operation of em- bedded systems. 1, 9 Microprocessor An integrated circuit (IC) that contains all the functions of a central processing unit (CPU) of a computer, condensed into a single chip. 1, 2 28