Chapter 1.1: Introduction

Microprocessors
Microprocessor vs. microcontrollerFetch · decode · executeCPU structure Clock speedCISC · RISC · EPICSpecial-purpose processors Evolution of Intel x86Modern CPU features
Sercan KÜLCÜ · Giresun University · Computer Engineering

Introduction

Learning Outcomes

Basic concepts

Define the microprocessor, the microcontroller and the buses of a computer system.

Instruction cycle

Trace the fetch–decode–execute cycle and the role of the program counter (IP/PC) step by step.

Performance

Relate clock frequency, period, CPI and execution time.

Architecture types

Compare CISC, RISC and EPIC with vector, SIMD, DSP and GPU processors.

The x86 family

Trace Intel processors from the 4004 to the Core i7 and place the 8086 among them.

Modern features

Recognize cache, multicore, virtualization and power management.

Basic Concepts

What Is a Microprocessor?

  • The computer's brain: a central processing unit (CPU) built on a single chip.
  • A programmable device; instructions in memory tell it what to do.
  • Basic flow:
    • takes input,
    • performs arithmetic and logic operations,
    • produces the desired output.
  • It fetches and executes machine-code instructions.
Input Micro-processor Output Memory instructions + data keyboard, sensordisplay, motor
Example: on a calculator the keys are the input, the addition is the processing, and the result on the display is the output.

Basic Concepts

The Computer System and Its Buses

CPU(microprocessor) MemoryRAM / ROM I/O unitskeyboard, display, disk Address bus → (one-way) Data bus ↔ (two-way) Control bus (RD, WR, …)
Address busSelects which memory cell or I/O port is accessed. n lines → 2n addresses. 8086: 20 bits → 1 MB.
Data busCarries the data being read or written. Its width is the number of bits moved at once. 8086: 16 bits.
Control busTiming and control signals: read/write, memory or I/O, clock, interrupts.

Basic Concepts

Microprocessor vs. Microcontroller

Microprocessor (MPU) based system CPU RAM ROM I/O Timer separate chips Microcontroller (MCU) CPU RAM Flash/ROM I/O ports Timer ADC · UART all on one chip (“computer on a chip”)
MicroprocessorJust the CPU; memory and peripherals are added outside. Flexible and powerful. E.g. 8086, Core i7, Ryzen.
MicrocontrollerCPU + memory + peripherals on one chip. Cheap, low-power, dedicated to one job. E.g. 8051, PIC, AVR (Arduino), STM32.

Basic Concepts

Microprocessor or Microcontroller?

CriterionMicroprocessor (MPU)Microcontroller (MCU)
ContentsCPU (ALU, control unit, registers)CPU + RAM + Flash + I/O + timers + ADC…
Memoryexternal, large (GB)on chip, small (KB–MB)
Clock speedhigh (GHz)low–medium (MHz)
Powerhigh (W–100 W)very low (mW, µW in sleep)
Costhigh; needs extra chipslow; one chip is enough
Softwareusually an OS + many applicationsone fixed program (firmware)
UsePC, server, laptopwashing machine, remote, car ECU, IoT
Our example processor is the 8086: its buses, registers and instructions work the same way in MCUs.

Basic Concepts

Main Tasks: The Instruction Cycle

1 · FetchReads the instruction from memory at the address in the PC.
2 · DecodeDecodes the opcode: which operation, which operands?
3 · ExecuteCarries out the decoded instruction (ALU, data move, jump).
4 · ResultWrites the result to a register or memory and updates the flags.
Fetch Decode Execute Result repeat foreach instruction
The cycle repeats nonstop while the processor is on. Fast processors overlap the stages (pipelining).

Basic Concepts · Step by step

Instruction Cycle: MOV AL,5 · ADD AL,3 · HLT

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessorSTARTIP (PC) = 0100hInstruction: —Control unitwaitingALUAL??FlagsZF=?CF=?

The program is loaded into memory. IP (the 8086's name for the program counter) holds the address of the first instruction, 0100h.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor1 · FETCHIP (PC) = 0102hInstruction: B0 05Control unit—ALUAL??FlagsZF=?CF=?

Fetch: IP goes onto the address bus and B0 05 is read from memory. IP grows by the instruction length (2 bytes) → 0102h.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor2 · DECODEIP (PC) = 0102hInstruction: B0 05Control unitB0 → MOV AL, imm8imm = 05hALUAL??FlagsZF=?CF=?

Decode: the control unit decodes opcode B0 as “load an 8-bit constant into AL”; the constant is 05h.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor3 · EXECUTEIP (PC) = 0102hInstruction: B0 05Control unitB0 → MOV AL, imm8imm = 05hALU(unused)AL05hFlagsZF=?CF=?

Execute / result: 05h is written to AL. MOV does not affect the flags.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor1 · FETCHIP (PC) = 0104hInstruction: 04 03Control unit—ALUAL05hFlagsZF=?CF=?

The cycle starts again: 04 03 is fetched, IP → 0104h.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor2 · DECODEIP (PC) = 0104hInstruction: 04 03Control unit04 → ADD AL, imm8imm = 03hALUAL05hFlagsZF=?CF=?

04 = “add an 8-bit constant to AL”. Operands: AL (05h) and 03h.

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessor3 · EXECUTEIP (PC) = 0104hInstruction: 04 03Control unit04 → ADD AL, imm8imm = 03hALU05h + 03h = 08hAL08hFlagsZF=0CF=0

The ALU adds: 05h + 03h = 08h → AL. The result is not zero (ZF=0), no carry (CF=0).

Memory0100hB00101h050102h040103h030104hF4machine codeaddressdataMicroprocessorFETCH → DECODEIP (PC) = 0105hInstruction: F4Control unitF4 → HLThalt the processorALUAL08hFlagsZF=0CF=0

F4 = HLT is fetched and decoded; the processor stops until an interrupt arrives. The same cycle repeats for every instruction.

Basic Concepts

Basic Functions

Arithmetic and logic operations

Add, subtract, compare, AND/OR/XOR, shift. Done by the ALU (arithmetic logic unit). Newer processors also handle floating-point numbers (FPU).

ADD AX, BX
CMP AL, 10
AND AL, 0Fh
Data movement

Data is copied between registers, memory and I/O. This is the most common operation in programs.

MOV AX, [1234h]
MOV [BX], AL
IN AL, 60h
Program counter (PC)

Holds the address of the next instruction. Writing a new value to the PC is a jump; conditional jumps make decisions. On the 8086 it is called IP.

JMP label
JZ is_zero
CALL subroutine
Every program is a combination of these three functions (compute · move · change the order).

Basic Concepts · Step through the code

Code Trace: How Does IP Change?

mov cx, 3 is 3 bytes; after it runs, IP points to the next instruction (0103h).

The sum is cleared. IP again advances by the instruction length → 0106h.

AX = 0 + 3 = 3. add ax, cx is 2 bytes → IP = 0108h.

loop: CX = CX − 1 = 2 ≠ 0 → jump. IP gets 0106h; the sequential flow is broken.

AX = 3 + 2 = 5.

CX = 1 ≠ 0 → jump to 0106h again.

AX = 5 + 1 = 6.

CX = 0 → no jump; IP moves on to the next instruction (010Ah).

hlt: the processor halts. Result AX = 3 + 2 + 1 = 6.

0100  mov  cx, 3     ; count = 3
0103  mov  ax, 0     ; sum = 0
0106  again: add ax, cx
0108  loop again     ; CX--, jump if CX≠0
010A  hlt            ; halt

The numbers on the left are the instruction addresses (offsets, hex). loop does not change the flags.

Microprocessor Structure

Microprocessor Structure

Microprocessor (CPU) Control Unit (CU)instruction decoder · timingcontrol signals RegistersAX BX CX DX · SP BP SI DIIP · flags · segment internal data bus ALU+ − × ÷ · AND OR XOR Bus Interface Unitaddress/data buffers(8086: BIU + instruction queue) Memory I/O addressdatacontrol Clock (CLK)

The control unit decodes instructions and tells the other units what to do and when; the ALU computes; registers are the fastest temporary storage; the bus interface talks to the outside world.

Microprocessor Structure

Building Blocks

ALUPerforms arithmetic (+, −) and logic (AND, OR, NOT, XOR) on binary numbers, plus compares and shifts. Sets the flags (zero, carry, sign, overflow) from the result.
Control unitDecodes the instruction and times which register connects to which bus, which operation the ALU performs, and the memory read/write signals.
RegistersSmall, very fast storage cells inside the processor: general-purpose (data), address/pointer, status (flags) and program counter registers.
Bus interfaceDrives the address, data and control buses. On the 8086 the BIU prefetches instructions into a 6-byte queue.
Clock and timingEvery operation advances in step with the clock ticks. One tick lasts T = 1/f.
Cache, FPU, coresModern processors also put cache, a floating-point unit, several cores and a graphics unit on the same chip.

Microprocessor Structure

The Clock Signal and Its Period

10CLKT1T2T3T4T1T = 1 / f8086 bus cycle = 4 T → at 5 MHz, 4 × 200 ns = 800 nsnext cycle
  • Clock frequency f: ticks (cycles) per second, in Hz.
  • Period T = 1 / f: the length of one tick.
  • An instruction may take several clock cycles; on the 8086 a memory access takes at least 4 T (T1–T4).
fT = 1/f4 T
5 MHz (8086)200 ns800 ns
10 MHz (8086-1)100 ns400 ns
3 GHz0.333 ns1.33 ns

Microprocessor Structure · Interactive

Calculator: Clock Speed, Period and Execution Time

Period T—
8086 bus cycle (4 T)—
Speed (MIPS = f / CPI)—
Execution time—

The CPI values are rough examples: 8086 instructions take ~10 cycles on average, while modern processors can finish several instructions per cycle (CPI < 1).

Microprocessor Structure · Step through the code

Code Trace: How Many Clock Cycles Does a Loop Take?

org 100h
mov cx, 4        ; 4 cycles
mov ax, 0        ; 4 cycles
again: add ax, cx ; 3 cycles
loop again       ; 17 / 5 cycles
hlt              ; 2 cycles
clock cycles (5 MHz → 1 cycle = 200 ns)0102030405060704so far:4 cycles × 200 ns = 0.8 µsthis one: MOV imm → 4 cyclesCX = 4 · AX = 0

Every instruction takes a set number of clock cycles. On a 5 MHz 8086 one cycle is T = 1/f = 200 ns. mov cx, 4: 4 cycles.

clock cycles (5 MHz → 1 cycle = 200 ns)01020304050607044so far:8 cycles × 200 ns = 1.6 µsthis one: MOV imm → 4 cyclesCX = 4 · AX = 0

mov ax, 0: 4 cycles again. Total 8 cycles = 1.6 µs.

clock cycles (5 MHz → 1 cycle = 200 ns)01020304050607044so far:11 cycles × 200 ns = 2.2 µsthis one: ADD reg → 3 cyclesCX = 4 · AX = 4

add ax, cx: a register-to-register add takes 3 cycles; short because there is no memory access. AX = 4.

clock cycles (5 MHz → 1 cycle = 200 ns)0102030405060704417so far:28 cycles × 200 ns = 5.6 µsthis one: LOOP → 17 cyclesCX = 3 · AX = 4

loop: CX = 3 ≠ 0 → jump. A taken LOOP costs 17 cycles: the queue is flushed and refilled from the target.

clock cycles (5 MHz → 1 cycle = 200 ns)0102030405060704417so far:31 cycles × 200 ns = 6.2 µsthis one: ADD reg → 3 cyclesCX = 3 · AX = 7

add ax, cx: a register-to-register add takes 3 cycles; short because there is no memory access. AX = 7.

clock cycles (5 MHz → 1 cycle = 200 ns)010203040506070441717so far:48 cycles × 200 ns = 9.6 µsthis one: LOOP → 17 cyclesCX = 2 · AX = 7

loop: CX = 2 ≠ 0 → jump. A taken LOOP costs 17 cycles: the queue is flushed and refilled from the target.

clock cycles (5 MHz → 1 cycle = 200 ns)010203040506070441717so far:51 cycles × 200 ns = 10.2 µsthis one: ADD reg → 3 cyclesCX = 2 · AX = 9

add ax, cx: a register-to-register add takes 3 cycles; short because there is no memory access. AX = 9.

clock cycles (5 MHz → 1 cycle = 200 ns)01020304050607044171717so far:68 cycles × 200 ns = 13.6 µsthis one: LOOP → 17 cyclesCX = 1 · AX = 9

loop: CX = 1 ≠ 0 → jump. A taken LOOP costs 17 cycles: the queue is flushed and refilled from the target.

clock cycles (5 MHz → 1 cycle = 200 ns)01020304050607044171717so far:71 cycles × 200 ns = 14.2 µsthis one: ADD reg → 3 cyclesCX = 1 · AX = 10

add ax, cx: a register-to-register add takes 3 cycles; short because there is no memory access. AX = 10.

clock cycles (5 MHz → 1 cycle = 200 ns)010203040506070441717175so far:76 cycles × 200 ns = 15.2 µsthis one: LOOP → 5 cyclesCX = 0 · AX = 10

CX = 0 → no jump; a LOOP that falls through takes only 5 cycles.

clock cycles (5 MHz → 1 cycle = 200 ns)010203040506070441717175so far:78 cycles × 200 ns = 15.6 µsthis one: HLT → 2 cyclesCX = 0 · AX = 10

hlt: 2 cycles. Total 78 cycles × 200 ns = 15.6 µs; more than half the cycles (51) went to taken LOOPs.

Cycle counts are best-case values from the 8086 data sheet (full queue, no wait states). Time = cycles × T.

Microprocessor Structure

Clock Speeds of 16-, 32- and 64-Bit Processors

16-bit
  • 8086: 5 · 8 · 10 MHz
  • 8088: 5 · 8 MHz
    (4.77 MHz in the IBM PC)
  • 80186/80188: from 6 MHz
  • 80286: 6 · 8 · 10 · 12.5 MHz
32-bit
  • 80386: 16 – 33 MHz
  • 80486: 16 – 100 MHz
    (DX2/DX4 clock multiplier)
  • Pentium: started at 60 · 66 MHz
64-bit
  • Core 2: 1.2 – 3 GHz
  • Core i7 (1st gen): 2.66 – 3.33 GHz
  • Core i5 (1st gen): 2.4 – 3.6 GHz
  • Core i3 (1st gen): 2.93 – 3.33 GHz
In 30 years clock speed rose about 600× (5 MHz → ~3 GHz). Around 2005 it hit the power and heat wall; since then performance has come mainly from multiple cores and more instructions per cycle.

4.77 MHz is the clock speed of the 8088 in the IBM PC.

Microprocessor Structure

What Does “n-Bit Processor” Mean?

The word size the processor handles at once: the register and ALU width, and usually the data bus width. n bits represent the range 0 … 2n − 1.

WordUnsigned range
8 bits0 … 255
16 bits0 … 65,535
32 bits0 … 4,294,967,295
64 bits0 … ≈ 1.8 × 1019

The address bus width, in turn, sets how much memory can be reached: n lines → 2n bytes.

Address busMemoryExample
16 bits64 KB8080, 8085
20 bits1 MB8086, 8088
24 bits16 MB80286
32 bits4 GB80386, 80486
36 bits64 GBPentium Pro (PAE)
The 8086 is a 16-bit processor, yet it has a 20-bit address bus. The 20-bit address is formed by combining two 16-bit values (segment and offset).

Microprocessor Structure · Step through the code

32-Bit Addition on a 16-Bit Processor

org 100h
mov ax, 0FFFFh ; a: low half
mov dx, 0001h  ; a: high half
mov bx, 0002h  ; b: low half
mov cx, 0003h  ; b: high half
add ax, bx     ; low halves
adc dx, cx     ; high + CF
ret
high 16 bitslow 16 bitsaDX????AXFFFFhbCX????BX????+CF0two registers = one 32-bit number

a = 0001FFFFh (131,071) does not fit in a 16-bit register, so it is split in two. Low half AX = FFFFh.

high 16 bitslow 16 bitsaDX0001hAXFFFFh= 131,071bCX????BX????+CF0two registers = one 32-bit number

High half DX = 0001h. The 32-bit a now sits in the DX:AX pair.

high 16 bitslow 16 bitsaDX0001hAXFFFFh= 131,071bCX????BX0002h+CF0two registers = one 32-bit number

b = 00030002h (196,610): low half BX = 0002h.

high 16 bitslow 16 bitsaDX0001hAXFFFFh= 131,071bCX0003hBX0002h= 196,610+CF0two registers = one 32-bit number

High half CX = 0003h; b sits in the CX:BX pair.

high 16 bitslow 16 bitsaDX0001hAX0001h= 65,537bCX0003hBX0002h= 196,610+CF1carry out of AX →

add ax, bx: FFFFh + 0002h = 1 0001h. Bit 17 does not fit in 16-bit AX: AX = 0001h, and the carry goes to CF = 1.

high 16 bitslow 16 bitsaDX0005hAX0001h= 327,681bCX0003hBX0002h= 196,610+CF00001h + 0003h + 1 = 0005h

adc dx, cx: 0001h + 0003h + CF(1) = 0005h. Result DX:AX = 00050001h = 327,681.

high 16 bitslow 16 bitsaDX0005hAX0001h= 327,681bCX0003hBX0002h= 196,610+CF0DX:AX = 00050001h

The 16-bit processor needed two instructions for a 32-bit add; a 32-bit processor (80386) does it with a single add.

adc (add with carry) also adds the carry (CF) from the previous addition.

Processor Types

Processor Types: An Overview

Processors Instruction set architecture Data processing style Application-specific CISC RISC EPIC Scalar Vector Array DSP GPU Symbolic how are instructions designed? how much data per instruction? optimized for which job?
CISCComplex Instruction Set Computer
RISCReduced Instruction Set Computer
EPICExplicitly Parallel Instruction Computing

Processor Types

Complex Instruction Set Computer (CISC)

  • Performs complex operations in a single instruction.
  • One instruction can bundle several low-level operations, such as a load from memory, an arithmetic operation and a store to memory.
  • Instructions offer many addressing modes and direct memory operands.
  • Instruction lengths vary (1–6 bytes on the 8086); decoding is complex.
  • Has relatively few registers.
  • Usually a microprogrammed control unit.
Examples
  • Intel 8086, 80386, 80486
  • Pentium, Pentium Pro, II, III
  • Motorola 68000, 68020, 68040
  • DEC VAX, IBM System/360
ADD [BX], AX   ; mem = mem + AX
REP MOVSB      ; copy CX bytes

One instruction: read + add + write

Processor Types

Reduced Instruction Set Computer (RISC)

  • A small number of simple, fixed-length instructions (e.g. all 32 bits).
  • Fast execution through streamlined instructions and a pipeline.
  • Goal: ideally complete one instruction every clock cycle (CPI ≈ 1).
  • Only load/store instructions access memory; operations work between registers.
  • Many registers (32 or more) to cut memory accesses.
  • Hardwired control unit; the complexity moves to the compiler.
Examples
  • IBM RS/6000 (POWER)
  • Motorola MC88100
  • DEC Alpha 21064, 21164, 21264
  • MIPS, SPARC
  • ARM (phones, Apple M series)
  • RISC-V (open-source instruction set)

An instruction does not finish in one cycle; it passes through several stages. Thanks to the pipeline, one instruction completes every cycle (throughput).

Processor Types · Step by step

Pipelining: Overlapping the Stages

12345678cycle →I1IFI2I3I4Completed: 0 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 1: I1 is fetched (IF). The other stages are empty.

12345678cycle →I1IFIDI2IFI3I4Completed: 0 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 2: while I1 is decoded (ID), I2 is fetched. Two instructions are in different stages at once.

12345678cycle →I1IFIDEXI2IFIDI3IFI4Completed: 0 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 3: three instructions in three different stages.

12345678cycle →I1IFIDEXMEMI2IFIDEXI3IFIDI4IFCompleted: 0 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 4: four instructions in the pipeline at once.

12345678cycle →I1IFIDEXMEMWBI2IFIDEXMEMI3IFIDEXI4IFIDCompleted: 1 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 5: the pipeline is full; I1 completes (WB). From now on one instruction finishes every cycle.

12345678cycle →I1IFIDEXMEMWBI2IFIDEXMEMWBI3IFIDEXMEMI4IFIDEXCompleted: 2 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 6: I2 completes.

12345678cycle →I1IFIDEXMEMWBI2IFIDEXMEMWBI3IFIDEXMEMWBI4IFIDEXMEMCompleted: 3 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 7: I3 completes.

12345678cycle →I1IFIDEXMEMWBI2IFIDEXMEMWBI3IFIDEXMEMWBI4IFIDEXMEMWBCompleted: 4 / 4IF fetch · ID decode · EX execute · MEM memory · WB write back

Cycle 8: I4 completes. 4 instructions finish in k + n − 1 = 5 + 4 − 1 = 8 cycles; without a pipeline it would take 4 × 5 = 20.

Like a factory assembly line: each stage is its own hardware unit and moves on to the next instruction every cycle. Dependences and branches can cause pipeline stalls.

Processor Types

Same Job, Two Approaches

Task: add a register's value to a number in memory (mem[addr] += x).

CISC (8086)

ADD [BX], AX     ; 1 instruction
                 ; read, add, write
  • Short code, small memory footprint.
  • The instruction takes many cycles.

RISC (ARM)

LDR r2, [r1]       @ load
ADD r2, r2, r0     @ add
STR r2, [r1]       @ store
  • 3 simple instructions; each flows smoothly through the pipeline.
  • If the value stays in a register, later operations skip memory.
Modern x86 processors (since the Pentium Pro) translate complex instructions internally into RISC-like micro-operations (µops): CISC outside, RISC inside.

Processor Types · Step through the code

Code Trace: One CISC Instruction, Three Jobs

org 100h
mov bx, offset num  ; address
mov ax, 7           ; value
add [bx], ax        ; read, add, write
add [bx], ax        ; again
ret
num dw 0123h
ProcessorBX010BhAX0000htemp—ALUMemorynum · 010Bh0123h…

BX = 010Bh: the address of the variable num. In memory num = 0123h.

ProcessorBX010BhAX0007htemp—ALUMemorynum · 010Bh0123h…

AX = 0007h, the value to add.

ProcessorBX010BhAX0007htemp0123hALUMemorynum · 010Bh0123h…read1 · READ

add [bx], ax is one instruction but does three jobs inside. 1 · Read: the BIU brings the word at 010Bh (0123h) into a temporary register with a memory read cycle.

ProcessorBX010BhAX0007htemp012AhALU0123h + 7Memorynum · 010Bh0123h…2 · ADD

2 · Add: the ALU computes 0123h + 0007h = 012Ah and updates the flags.

ProcessorBX010BhAX0007htemp012AhALUMemorynum · 010Bh012Ah…write3 · WRITE

3 · Write: a second bus cycle writes the result back to memory: num = 012Ah. One instruction = 2 memory accesses.

ProcessorBX010BhAX0007htemp0131hALU012Ah + 7Memorynum · 010Bh0131h…read/writeREAD · ADD · WRITE

The same instruction again: read (012Ah), add (+7), write → num = 0131h.

ProcessorBX010BhAX0007htemp0131hALUMemorynum · 010Bh0131h…

CISC code is short: one instruction. On a RISC processor the same job takes three (LDR, ADD, STR), and the intermediate value is visible in a register.

Processor Types

RISC and CISC Processors

CriterionRISCCISC
Instruction setsmall and simplelarge and complex
Instruction lengthfixedvariable
Cycles per instructionfew (≈1, with pipelining)many (variable)
Memory accessload/store onlymost instructions can access memory
Register countmanyfew
Program sizelargersmaller
Power uselowrelatively high
Flexibilityburden on the compilerwide range of instructions, flexible use
RISC runs a few kinds of instructions fast: high performance, low power. CISC offers many kinds of instructions, but each one is slower.

Processor Types

Explicitly Parallel Instruction Computing (EPIC)

  • The compiler, not the hardware, decides which instructions can run in parallel and states it explicitly in the code.
  • Many instructions can run at once without a high clock frequency.
  • Instructions are encoded in 128-bit bundles: three 41-bit instructions + a 5-bit template.
instr 2 · 41 bits instr 1 · 41 bits instr 0 · 41 bits 12787|8646|455|40 template (5 bits): slot unit types and parallel group boundary 3 × 41 + 5 = 128
ExampleIntel and HP's joint architecture IA-64; the Itanium processors (2001–2021).
OutcomeIt burdened the compiler and had weak x86 compatibility; it lost to x86-64 in the market.

Processor Types

Scalar vs. Vector Processing

Scalar: 4 separate ADDs (4 steps) t=1t=2t=3t=4 1+ 10= 11 2+ 20= 22 3+ 30= 33 4+ 40= 44 Vector: 1 VADD (1 step) ABC 1 2 3 4 + 10 20 30 40 = (one instruction, t=1) 11 22 33 44

A scalar processor handles one data item per instruction; a vector processor handles a whole array of data (a vector) with one instruction. Instruction fetch/decode and loop overhead are paid once.

Processor Types · Step through the code

Code Trace: c = a + b on a Scalar Processor

org 100h
mov si, 0
mov cx, 4
again: mov al, a[si]  ; read one item
add al, b[si]         ; one add
mov c[si], al         ; write one item
inc si
loop again
ret
a db 3, 5, 7, 9
b db 10, 20, 30, 40
c db 4 dup(0)
a3579b10203040cscalar2 instr.vector (4 items)1 add

SI = 0 (index), CX = 4 (item count). A scalar processor works on a single data item per instruction.

a3579b10203040c13SI = 0scalar5 instr.vector (4 items)1 add

Item 0: a[0] + b[0] = 3 + 10 = 13 → c[0]. Three instructions fetched and decoded for one item.

a3579b10203040c13→ SI = 1scalar7 instr.vector (4 items)1 add

SI = 1, CX = 3 ≠ 0 → back to the top. The loop overhead (INC, LOOP) is paid again for every item.

a3579b10203040c1325SI = 1scalar10 instr.vector (4 items)1 add

Item 1: a[1] + b[1] = 5 + 20 = 25 → c[1]. Three instructions fetched and decoded for one item.

a3579b10203040c1325→ SI = 2scalar12 instr.vector (4 items)1 add

SI = 2, CX = 2 ≠ 0 → back to the top. The loop overhead (INC, LOOP) is paid again for every item.

a3579b10203040c132537SI = 2scalar15 instr.vector (4 items)1 add

Item 2: a[2] + b[2] = 7 + 30 = 37 → c[2]. Three instructions fetched and decoded for one item.

a3579b10203040c132537→ SI = 3scalar17 instr.vector (4 items)1 add

SI = 3, CX = 1 ≠ 0 → back to the top. The loop overhead (INC, LOOP) is paid again for every item.

a3579b10203040c13253749SI = 3scalar20 instr.vector (4 items)1 add

Item 3: a[3] + b[3] = 9 + 40 = 49 → c[3]. Three instructions fetched and decoded for one item.

a3579b10203040c13253749scalar22 instr.vector (4 items)1 add

CX = 0: the loop is done. Four additions took 22 instructions; a vector processor handles all four items with a single vector add.

Processor Types

Vector Processors

  • Perform mathematical operations on arrays of data called vectors.
  • For such work they are much faster than scalar processors, which handle one data item at a time.
  • They process many data items at once (or back to back in a deep pipeline).
  • They have long vector registers and vector load/store units.
  • Used in high-performance systems such as supercomputers, servers and GPUs.
V112345678V21020304050607080V31122334455667788VADD V3, V1, V2one instruction8 adds at once
Historythe Cray-1 (1976) supercomputer
Todayx86 SSE/AVX, ARM NEON/SVE, the RISC-V V extension
Usesweather forecasting, physics simulation, AI

Processor Types

Array Processors

  • Also called SIMD (single instruction, multiple data).
  • One control unit broadcasts the same instruction to many processing elements (PEs); each PE works on its own data.
  • Optimized for parallel computation and vector operations.
  • Scalar processors, by contrast, handle one data item.
  • Used in supercomputers, servers and GPUs; rare in general-purpose computing.
Flynn's taxonomy
SISDsingle instruction, single data (classic 8086)
SIMDsingle instruction, multiple data (array/vector, GPU)
MISDmultiple instruction, single data (rare; fault tolerance)
MIMDmultiple instruction, multiple data (multicore, clusters)
Control unit: ADDPE0local data 0PE1local data 1PE2local data 2PE3local data 3

Processor Types

Scalar Processors

  • Process scalar (non-vector) data, one data item per instruction.
  • Simple scalar processors handle integers only.
  • More powerful ones also handle floating point: the integer unit (ALU) and the floating-point unit (FPU) share the chip.
  • They can be CISC or RISC.
  • The most common type in general-purpose computing.
Superscalar

A scalar processor with several pipelines/execution units that can issue more than one instruction per clock cycle. The first x86 example: the Pentium (U and V pipes).

clock cycle →123456scalarI1I2I3I4I5I6superscalar UI1I3I5I7I9K11superscalar VI2I4I6I8K10K12

Processor Types

Digital Signal Processors (DSP)

  • Optimized for processing digital signals.
  • A digital signal is a sequence of samples representing sensory information such as sound or images.
  • An instruction set and hardware tailored to signal processing: single-cycle multiply-accumulate (MAC), circular buffer addressing, zero-overhead loops.
  • Applications:
    • audio processing and filtering
    • image processing and enhancement
    • telecom infrastructure (modems, base stations)
FIR filter

y[n] = Σ h[k] · x[n − k]

N multiplies + N adds per output sample. A DSP does each term with one MAC instruction:

A ← A + h[k] × x[n−k]

E.g. TI TMS320, Analog Devices SHARC

Processor Types · Step through the code

Code Trace: An FIR Sum on the 8086

org 100h
mov si, 0
mov bx, 0        ; sum
mov cx, 3        ; term count
again: mov al, h[si]
mul x[si]        ; AX = h × x
add bx, ax       ; accumulate
inc si
loop again
ret
h db 2, 3, 1
x db 10, 20, 30
h231x102030×AX+BX (sum)0feedbackAX = 0y = 2·10 + 3·20 + 1·30 = 110

BX = 0 is the accumulator, CX = 3 terms. Filter output y = h[0]·x[0] + h[1]·x[1] + h[2]·x[2].

h231x102030×AX+BX (sum)0feedbackAX = 20y = 2·10 + 3·20 + 1·30 = 110

Term 0: AL = h[0] = 2, mul → AX = 2 × 10 = 20. On the 8086 a MUL alone takes more than 70 cycles.

h231x102030×AX+BX (sum)20feedbackAX = 20y = 2·10 + 3·20 + 1·30 = 110

add bx, ax: sum = 20. Multiply and add are two separate instructions; on a DSP they are one MAC.

h231x102030×AX+BX (sum)20feedbackAX = 60y = 2·10 + 3·20 + 1·30 = 110

Term 1: AL = h[1] = 3, mul → AX = 3 × 20 = 60. On the 8086 a MUL alone takes more than 70 cycles.

h231x102030×AX+BX (sum)80feedbackAX = 60y = 2·10 + 3·20 + 1·30 = 110

add bx, ax: sum = 80. Multiply and add are two separate instructions; on a DSP they are one MAC.

h231x102030×AX+BX (sum)80feedbackAX = 30y = 2·10 + 3·20 + 1·30 = 110

Term 2: AL = h[2] = 1, mul → AX = 1 × 30 = 30. On the 8086 a MUL alone takes more than 70 cycles.

h231x102030×AX+BX (sum)110feedbackAX = 30y = 2·10 + 3·20 + 1·30 = 110

add bx, ax: sum = 110. Three terms done: y = 110. Each term needed its own MUL + ADD (+ loop overhead); a DSP does it with one MAC instruction in one cycle.

Processor Types

Symbolic Processors

  • Built for symbolic computation: it manipulates symbols, lists and rules instead of numbers.
  • Also known as PROLOG (and LISP) processors.
  • Focuses on semantic computation and rules of symbolic logic.
  • Manipulates mathematical expressions and symbols; can simplify complex expressions and take derivatives.
Application areas
  • Expert systems
  • Machine intelligence
  • Rule-based inference
father(ali, veli).
grandpa(X, Z) :- father(X, Y),
                 father(Y, Z).

A Prolog rule: symbolic inference

The LISP machines of the 1980s (Symbolics) and Japan's Fifth Generation Computer project were of this kind; today this work is done in software on general-purpose processors.

Processor Types

Graphics Processing Units (GPU)

  • Designed to accelerate 2D and 3D graphics.
  • Renders high-quality graphics in real time.
  • Efficient at rendering tasks: shading, texturing, rasterization.
  • Thousands of simple cores run the same program on different pixels (SIMD/SIMT).
  • Found in dedicated hardware such as graphics cards and accelerators.
CPUa few powerful cores · cuts latency · complex control flow
GPUthousands of simple cores · raises throughput · data parallel
GPGPUscientific computing and deep learning with CUDA/OpenCL
CPUcorecorecorecorelarge cache + controlGPUhundreds–thousands of small cores

Processor Types

Processor Types: Summary Table

TypeKey ideaStrengthExample
CISCrich, complex instructionsshort code, compatibility8086, Pentium, 68000
RISCsimple instructions + pipelinespeed, low powerARM, MIPS, RISC-V
EPICthe compiler marks parallelisminstruction-level parallelismIA-64 Itanium
Scalarone data item per instructiongeneral purposemost CPU cores
Vectoran array of data per instructionscientific computingCray-1, AVX
Array (SIMD)many PEs, same instructionmassive parallelismILLIAC IV, GPU
DSPMAC, special addressingreal-time signalsTMS320, SHARC
Symbolicsymbol/rule processingAI (classic)LISP machines
GPUthousands of simple coresgraphics, deep learningNVIDIA, AMD Radeon

Evolution of Intel x86

The Evolution of Microprocessors

1947 · The transistorInvented at Bell Labs (Bardeen, Brattain, Shockley) and announced in 1948; the microelectronics revolution began.
1958 · The integrated circuit (IC)Jack Kilby demonstrated the first integrated circuit at Texas Instruments. Many transistors on one chip made complex circuits possible.
1971 · The first microprocessorIntel 4004: a whole CPU on one chip. The microprocessor became the computer's central processing unit.
ResultComputers shrank from room size to the desktop and then to the pocket: smaller, more powerful, faster and cheaper.

Evolution of Intel x86

Intel Processors: A Timeline

400419718008197280801974808519768086197880881979802861982803861985804861989Pentium1993Pentium Pro1995Pentium II1997Pentium III1999Pentium 42000Core 22006Core i720084-bit8-bit16-bit32-bit64-bit
The name x86 comes from the common “86” suffix of the 80186, 80286, 80386 and 80486 that followed the 8086. All of them run 8086 code: backward compatibility.

Evolution of Intel x86

4- and 8-Bit Microprocessors

ProcessorYearClockTransistorsInstruction rate / note
4004 (4-bit)1971740 kHz2,300≈ 60,000 instr/s; Ted Hoff, Federico Faggin, Stanley Mazor
4040 (4-bit)1974740 kHz≈ 3,000improved 4004 (interrupts, more instructions)
8008 (8-bit)1972500 kHz3,500≈ 50,000 instr/s; the first 8-bit
8080 (8-bit)19742 MHz6,000≈10× the 8008's speed; 16-bit address (64 KB); first personal computers (Altair 8800)
8085 (8-bit)19763 MHz6,500single +5 V supply; 16-bit address bus; ≈ 769,000 instr/s (shortest instruction 1.3 µs)

Evolution of Intel x86

16-Bit Microprocessors

ProcessorYearClockTransistorsFeature
808619785 · 8 · 10 MHz29,00016-bit data bus, 20-bit address bus (1 MB); hardware multiply/divide; ≈ 0.33–0.75 MIPS
808819795 · 8 MHz29,000low-cost 8086 with an 8-bit external data bus; IBM PC (1981, 4.77 MHz)
80186 / 801881982from 6 MHz≈ 55,000on-chip interrupt controller, clock generator, local bus controller, timers, DMA; the 80188 is the low-cost (8-bit external bus) version
8028619826 – 12.5 MHz134,00016-bit data, 24-bit address bus (16 MB); protected mode; ≈ 0.9–2.7 MIPS
8086 instructions take more than 10 cycles on average, so at 5 MHz you get about 0.33 MIPS.

Evolution of Intel x86

32-Bit Microprocessors

ProcessorYearClockTransistorsFeature
80386198516 – 33 MHz275,00032-bit data and address bus (4 GB), paging; versions: 386DX, 386SX (1988; 16-bit external data, 24-bit address), 386SL (laptops)
80486198916 – 100 MHz1.2 million8 KB on-chip cache, integrated FPU, 5-stage pipeline; versions: 486DX, 486SX (no FPU), DX2, DX4
Pentium199360 · 66 MHz (first)3.1 millionsuperscalar (2 pipelines); separate 8 KB instruction + 8 KB data caches; 64-bit external data bus

Evolution of Intel x86

64-Bit Microprocessors

ProcessorYearClockTransistorsFeature
Core 220061.2 – 3 GHz291 million (Duo)64 KB L1 per core (32 KB instruction + 32 KB data), 2–4 MB shared L2; versions: Duo, Quad, Extreme
Core i720082.66 – 3.33 GHz731 million4 cores, Hyper-Threading, integrated memory controller, 8 MB L3
Core i520092.4 – 3.6 GHz—mid-range; Turbo Boost
Core i320102.93 – 3.33 GHz—entry level; 2 cores, integrated graphics
64-bit x86 (x86-64) was introduced by AMD (AMD64, Opteron/Athlon 64, 2003); Intel adopted it in 2004 with the Pentium 4.

Clock ranges are for 1st-generation desktop/mobile models.

Evolution of Intel x86

Transistor Count and Moore's Law

1031041051061071081094004 · 19712,3008080 · 19746,0008086 · 197829,00080286 · 1982134,00080386 · 1985275,00080486 · 19891.2 millionPentium · 19933.1 millionPentium 4 · 200042 millionCore 2 Duo · 2006291 millionCore 2 Quad (45 nm) · 2008820 million
Moore's law (1965/1975): the number of transistors per chip roughly doubles every two years. From the 4004 to the Core 2 Quad, 37 years gave ≈ 218×.

Evolution of Intel x86 · Key features

8080 and 8086

The structure, organization and technology of microprocessors changed dramatically: from the 8080, the first general-purpose microprocessor, to the 29,000-transistor 8086 and the 820-million-transistor quad-core Core 2.

8080 (1974)
  • Known as the first general-purpose microprocessor.
  • 8-bit data bus, 16-bit address bus (64 KB).
  • Used in the first personal computers (Altair 8800).
8086 (1978)
  • 16-bit data bus and more registers, all 16 bits wide.
  • 20-bit address bus: 1 MB of addressable memory.
  • Real mode only.
  • Prefetches instructions into a 6-byte instruction queue before running them → fetch and execute overlap.

The 8086 has no cache; the instruction queue provides the speedup. On-chip cache came to x86 with the 80486.

Evolution of Intel x86 · Key features

80286, 80386 and 80486

80286 (1982)
  • 16 MB of addressable memory (24-bit address).
  • Real mode + 16-bit protected mode.
  • 16-bit data bus and registers.
80386 (1985)
  • Intel's first 32-bit microprocessor.
  • Supports multitasking in hardware.
  • 32-bit protected mode, paging, virtual 8086 mode.
  • 4 GB of addressable memory.
80486 (1989)
  • On-chip cache (8 KB) and an instruction pipeline.
  • Page write protection (the CR0.WP bit).
  • An integrated math coprocessor (FPU) for complex arithmetic; previously the separate 80387 chip.
Protected mode: each program's memory is isolated from the others; one program's bug cannot crash the operating system. This is the basis of modern operating systems.

Evolution of Intel x86 · Key features

Pentium and Pentium Pro

Pentium (1993)
  • Superscalar: two pipelines (U, V) let instructions run in parallel.
  • Branch prediction (a first for x86).
  • Page size extension (PSE): 4 MB pages alongside 4 KB → better paging.
  • Separate instruction and data caches.
Pentium Pro (1995)
  • Advanced branch prediction.
  • Out-of-order execution through data flow analysis.
  • Speculative execution.
  • A level 2 (L2) cache in the same package.
  • PAE: 32-bit virtual addresses map to 36-bit physical addresses (64 GB).

Intel called the first three Pentium Pro techniques together “dynamic execution”.

Evolution of Intel x86 · Key features

Pentium II, III and 4

Pentium II (1997)
  • Combined MMX technology (integer SIMD instructions for multimedia) with the Pentium Pro core.
  • Handles video, audio and graphics data efficiently.
Pentium III (1999)
  • SSE (Streaming SIMD Extensions): 70 new instructions, floating-point SIMD.
  • Supports 3D graphics software.
  • Top clock speed 1.4 GHz.
Pentium 4 (2000)
  • Floating-point improvements for multimedia (SSE2, later SSE3).
  • A very deep pipeline (NetBurst), up to 3.8 GHz.
  • Hyper-Threading.

MMX first appeared in 1997 in the “Pentium MMX”; the Pentium II inherited it.

Evolution of Intel x86 · Key features

Core and Core 2

Core (Core Duo, 2006)
  • The first Intel processor in which two cores on the same die share the L2 cache.
  • Added virtualization technology (VT-x).
  • Low power (a mobile-derived design).
Core 2 (2006)
  • 64-bit architecture (Intel 64).
  • 64-bit register set and addressing modes.
  • Core 2 Quad: four cores in one package (two dual-core dies).
Core 2 Duo: 1 diecore 0core 1shared L2 cacheCore 2 Quad: 2 dies in 1 packagecore 0core 1L2core 2core 3L2

Intel's first dual-core desktop processor was the Pentium D in 2005 (its cores had separate L2 caches).

Evolution of Intel x86

Advantages of the x86 Architecture

CompatibilityOld software runs unchanged on new x86 processors: code written for the 8086 in 1978 can still run today.
PerformanceEach new processor generation was faster and more efficient than the last.
VersatilityA wide range of uses, from personal computers to servers, embedded systems and mobile devices.
Broad industry supportBacked by a large ecosystem of hardware and software vendors; this support has driven innovation.

Evolution of Intel x86

Disadvantages of the x86 Architecture

Complex instruction setThousands of instructions and variable-length encoding; the decoder gets complex and code is harder to optimize.
Power consumptionPower draw rose sharply as x86 evolved, a big problem where battery life is critical.
HeatMore powerful processors run hotter; cooling cost and noise go up.
Cost and licensingIntel owns the x86 architecture; only licensed firms (e.g. AMD) can build it, which limits competition.
That is why ARM (RISC) dominates phones and tablets, while x86 is strong on desktops and servers.

Modern Features · Step by step

Clock Speed Alone Is Not Performance

CPU time = N × CPI × T = N × CPI / f

DefinitionsN: instructions executed · CPI: average clock cycles per instruction · f: clock frequency (T = 1/f).
Processor A: f = 2 GHz, CPI = 2N = 109 → time = 109 × 2 / (2 × 109) = 1 s
Processor B: f = 1.5 GHz, CPI = 1time = 109 × 1 / (1.5 × 109) ≈ 0.67 s → B, with the slower clock, is 50% faster!
TakeawayClock speed counts cycles per second, not instructions. Instructions/s = f / CPI; architecture (pipelines, caches, superscalar) lowers CPI.

Modern Features

Modern Processor Features (1)

Clock speedClock cycles per second (GHz). Instruction rate also depends on CPI.
Instruction set architecture (ISA)Architectures such as CISC and RISC affect efficiency and complexity; the ISA is the contract between software and hardware.
CacheSmall, very fast memory that keeps frequently used data close to the processor (L1, L2, L3).
MulticoreRuns several tasks truly in parallel, raising overall performance.
VirtualizationLets several operating systems (virtual machines) run isolated on the same hardware (Intel VT-x, AMD-V).
Power managementClock and voltage drop when the load falls (DVFS); idle cores are put to sleep.

Modern Features

Cache and the Memory Hierarchy

Registers L1 cache L2 cache L3 cache Main memory (RAM) SSD / disk < 1 ns · hundreds of bytes ≈ 1 ns · 32–64 KB / core ≈ 3–5 ns · 256 KB – 2 MB ≈ 10–20 ns · a few to tens of MB ≈ 50–100 ns · GB µs – ms · TB faster · costlier larger · cheaper

Programs access the same and nearby data again and again (the principle of locality). By keeping that data close, the cache brings the average access time far below RAM's. Times are approximate.

Modern Features

Modern Processor Features (2)

Power managementModern processors cut power use and raise energy efficiency: Turbo/SpeedStep, sleep states (C-states).
GraphicsAn integrated graphics unit (iGPU) handles graphics-heavy tasks faster and more efficiently.
Security featuresHardware encryption (AES-NI), secure boot, isolated secure enclaves (TPM, SGX/TrustZone).
ConnectivityBuilt-in network units such as Wi-Fi, Bluetooth and Ethernet, especially in mobile and embedded chips (SoCs).
Machine learningDedicated AI units: NPUs, matrix accelerators (Intel AMX), vector dot-product instructions.
System on a chip (SoC)CPU, GPU, NPU, memory controller and I/O on one chip; a return to the microcontroller idea.

Summary

Summary

  • A microprocessor is a programmable CPU chip that runs the instructions in memory through the fetch–decode–execute cycle; a microcontroller also carries memory and peripherals on the same chip.
  • A CPU consists of the ALU, the control unit, registers and the bus interface; it talks to the outside world over the address, data and control buses.
  • Period T = 1/f; execution time = N × CPI / f. Clock speed alone is not a measure of performance.
  • CISC offers rich instructions, RISC simple instructions + pipelining, EPIC compiler-driven parallelism; vector, SIMD, DSP, GPU and symbolic processors target special jobs.
  • Intel 4004 (1971) → 8086 (1978, 16 bits, 1 MB) → 80386 (32 bits) → Core 2 (64 bits): backward compatibility is x86's greatest strength.
  • Modern processors gain performance through cache, multiple cores, virtualization, power management and special accelerators.

Summary

Exercises

  1. On a 5 MHz 8086, what is the clock period, and how long does a 4-T bus cycle take?
  2. How many bytes can a 24-bit address bus reach? Which processor has one?
  3. How many cycles do 100 instructions take in a 5-stage pipeline? How many without a pipeline?
  4. How many seconds does a program of N = 2 × 109 instructions take on a 3 GHz processor with CPI = 1.5?
  5. For a washing machine controller and for a laptop, would you choose a microprocessor or a microcontroller? Why?
  6. How are the 128 bits of an EPIC bundle divided up?
Hints / answers
  1. T = 1 / 5 MHz = 200 ns; 4 T = 800 ns.
  2. 224 = 16,777,216 bytes = 16 MB; the 80286.
  3. k + n − 1 = 5 + 99 = 104 cycles; without a pipeline 5 × 100 = 500 cycles (≈ 4.8× speedup).
  4. 2 × 109 × 1.5 / (3 × 109) = 1 s.
  5. Washing machine: a microcontroller (cheap, low power, one job). Laptop: a microprocessor (high performance, large memory, an operating system).
  6. Three 41-bit instructions (123 bits) + a 5-bit template = 128 bits.

Summary

References

  • Tanenbaum and Bos, Modern Operating Systems, 3rd ed., Pearson.
  • Brey, The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium …, 8th ed., Pearson.
  • Stallings, Computer Organization and Architecture, 10th ed., Pearson.
  • Patterson and Hennessy, Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann.
  • Intel Corporation, 8086 16-Bit HMOS Microprocessor data sheet and the Intel 64 and IA-32 Architectures Software Developer's Manual.

The End

Chapter 1.1: Introduction
Next: Chapter 1.2: Number Systems
1 / 1 Sercan KÜLCÜ. All rights reserved.