Introduction to Microprocessor Systems

The Evolution of Computers

  • Electronic Delay Storage Automatic Computer(EDSAC)
    • First practical programmable computer, by UK. In Cambridge 1949.
    • On average, processes 650 instructions per second.
    • 1024 17-bit words of memory in mercury ultrasonic delay lines.
    • 3000 values, 12kW power consumption, occupied a room 5m by 4m.
    • Early use to solve problems in meteorology, genetics ans X-ray crystallography.
  • ARM7
    • Up to 130 million instructions per second. 1995-2011
    • One of the most successful embedded processor.
  • The picture shows LPC-H2124 header board.
    • 256KB of program flash
    • 16KB of RAM
    • The square chip in the middle is the microcontroller
  • Original ARM design:
    • Steve Furber, Acro RISC Machine
    • Cambridge, 1985
  • Evolution of computer architecture

计算机发展历史:

  1. 第一台可编程计算机 EDSAC:时钟频率低,耗电量大,占用大量空间。
  2. ARM7:时钟频率高,历史上最成功的嵌入式处理器之一。
  3. LPC-H2124:一种具有flash,RAM的微控制器。
  4. ARM 是精简指令集处理器,由Steve Furber于1985年在Cambridge设计。

What is Computer Architecture?

  • Computer architectures represent the means of interconnectivity for a computer's hardware components as well as the mode of data transfer and processing exhibited.
  • The architecture is the programmer's view of a computer. It is defined by the instruction set (language) and operand locations (registers and memory). Many different architectures exist, such as ARM, x86, MIPS, SPARC, and PowerPC.

Architecture is about design, not just hardware.

图片.png

计算机体系结构用于连接硬件组件(方式)以及数据传输和处理模式。它以程序员视角来思考指令集和数据存储在计算机内部的工作方式。体系结构位于操作系统和微架构之间,也被称为指令集架构。

高级语言编译后变成汇编语言,汇编语言经过汇编变成机器码,同一个可执行程序,在不同架构的机器上,机器码肯定是不同的。所编译出的汇编语言也不同,因为不同架构有不同的汇编指令。

Instruction Set Architecture(ISA)

  • Instruction (or Operation Code) set.
    • ADD, SUB, RSB, etc
  • Organisation of programmable storage.
    • Where data is stored.
  • Mode of addressing and accessing data items and instructions.
    • How data is stored/retrieved.
  • Behaviour on exceptional conditions, e.g.:
    • Hardware divide by zero.
    • An interrupt occurred.
  • ISA is about what the computer dose (not how it dose).
  • Examples of ISAs:
    • 8086/Pentium(x86) ISA: Widely used, compatible with a lot of operating systems and software.
    • ARM ISA: Supports highly optimising compiler & operating system software for embedded applications.
  • Different implementations of the same ISA can run identical software.
    • Your compiled C program can run on any x86 computer as long as the operating system is the same and libraries are satisfied.

图片.png

指令集架构的主要功能是定义指令集,对数据存储进行管理,控制寻址和访问数据的模式,异常表现。同一高级语言编写的程序,因指令集不同,所生成的汇编代码和机器码也不同。

What Factors Influence Computer Architecture?

  • Technology: Moore's Law
  • Applications
  • Programming languages
  • Design expertise
  • Operating Systems

影响计算机体系结构的因素:

  • 摩尔定律
  • 应用
  • 编程语言
  • 设计专业知识
  • 操作系统

Example: Buffer Overflow Attack

  • This attack targets programs that accept input data from untrusted sources and do not verify the length of the stored data.
  • Overloaded buffer can override executable code with malicious code.
  • Execution Disable Bit (EDB), introduced by Intel
    • Classifies areas in memory where a code can execute or not execute.
    • Stops an attack from running code in a non-executable region.
    • Does not shutdown the buffer overflow attack completely, but can help reduce the impact.

图片.png

缓冲区溢出攻击:程序从非信任区域接受数据并且没有认证数据长度,恶意代码通过覆盖(改变pc指向的地址)可执行程序,从而执行攻击。EDB是Intel芯片中一项硬件支持的安全机制,通过区分程序段和数据段让CPU知道那部分可以执行,阻止数据段代码对程序段进行恶意覆盖。不能够完全禁止缓冲区溢出攻击,但能够减小缓冲区溢出的影响。

Example: Application

  • Special units for AI learning in CPU.
    • Implemented in recent chips like Snapdragon from Qualcomm, Apple Silicon, Kirin chips, Exynos chips.
  • Video processing unit.
    • Intel chips provide video encoding/decoding accelerating
    • Can greatly speed up video decoding and encoding.
CPU中包含专门用于机器学习的处理单元。
视频处理单元提供视频编解码,并能够对其加速。

Example: Technology(Moore's Law)

  • In 1965, Gordon E. Moore, co-founder of Intel, postulated that the number of transistors that can be packed into a given unit of space will double about every two years.(See on Wikipedia)
  • VLSI(very large scale intergration) has increased speed and density of CPUs by shrinking dimensions.
    • This is limited by size of atoms (Quantum effects), so will stop.
  • Moore's Law predicted a doubling of computing power every tow years.
    • This has held true but will stop soon without a change in technology or architecture(Quantum computing)

摩尔定律:集成电路上可容纳的晶体管数目,约每隔两年便会增加一倍。超大规模集成电路通过缩小尺寸来提高CPU的速度和密度,受限于原子尺寸,如果不改变技术和架构(量子计算),该方法很快就会终止。

Micro-architectures of ARM

  • There are many architectures developed by ARM.
  • Each architecture has many implementations (micro-architectures).
  • Each micro-architecture has its own targeted purpose.
    • Cortex have A, M and R series.

图片.png

ARM有多种架构,不同架构应用于不同领域。

The Organisation of Microprocessor Systems

Von Neumann machine

  • Below is the typical organization of a modern Von Neumann machine.
    • Data and program are mostly stored in the computer memory separate from the process.
    • Registers in the processor datapath can also store small amount of data.
    • The address bus, data bus and control bus are also referred to as system bus.