31
Introduction to Microprocessors Microprocessors, Lecture 1:

Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Introduction to Microprocessors

Microprocessors, Lecture 1:

Page 2: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Computing Systems

2

General-purpose standalone systems

Embedded systems ( سيستم ھای نھفته)

Page 3: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

General-purpose standalone systems

3

Stand-alone computer systems: used for processing and data management purposes

Example: desktop PCs, laptops, tablets, servers, supercomputers,…

They are general-purpose: can be programmed to perform any task

A computer is used for: web browsing, gaming, multimedia, database server, word processing, CAD, scientific applications,…

Page 4: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

General-purpose standalone systems

4

Desktop processorsIntel and AMD processors

Server processorsIntel, AMD, IBM, SUN, …

Tablet processorsARM-based System-on-Chips

Page 5: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

5

General-Purpose ProcessorGeneral-Purpose Processor

Processor designed for a variety of computation tasksEach processor has an ISA and a microarchitecture

ISA: Instruction Set ArchitectureISA determines the set of instructions that a processor supports (and registers and addressing modes)X86 is the dominant ISA for PCsARM is the dominant ISA for tablets and smartphones

Page 6: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

6

A Simple (Trivial) Instruction Set

opcode operands

MOV Rn, direct

MOV @Rn, Rm

ADD Rn, Rm

0000 Rn direct

0010 Rn

0100 RmRn

Rn = M(direct)

Rn = Rn + Rm

SUB Rn, Rm 0101 Rm Rn = Rn - Rm

MOV Rn, #immed. 0011 Rn immediate Rn = immediate

Assembly instruct. First byte Second byte Operation

JZ Rn, relative 0110 Rn relative PC = PC+ relative(only if Rn is 0)

Rn

MOV direct, Rn 0001 Rn direct M(direct) = Rn

Rm M(Rn) = Rm

Page 7: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

7

Sample Programs

int total = 0;for (int i=10; i!=0; i--)

total += i;// next instructions...

C program

MOV R0, #0; // total = 0

MOV R1, #10; // i = 10

JZ R1, Next; // Done if i=0

ADD R0, R1; // total += i

MOV R2, #1; // constant 1

JZ R3, Loop; // Jump always

Loop:

Next: // next instructions...

SUB R1, R2; // i--

Equivalent assembly program

MOV R3, #0; // constant 0

0

1

2

3

5

6

7

Compiler knows the machine instructions and translates the programs into machine language

Page 8: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Hardware accelerator

8

Implementing time-consuming algorithm on hardwareIn processors, it is also called Co-processorNot programmable: only a fixed function

Co-Processor(accelerator)Co-Processor(accelerator)

ProgramMemory

CPU

DataMemory

ArbiterArbiter

DataMemory

ArbiterArbiter

Page 9: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Hardware accelerator

9

The most important accelerates in processors are vector processing units (SIMD unit)

SIMD= single instruction multiple data

To accelerate processing on arrays

Page 10: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Processors

10

In addition to general-purpose processors, there are other processor types

ASIPASICGPU

ASIP and ASIC are used in embedded systems

Page 11: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Application-Specific Instruction set Processor (ASIP)

11

A processor that is programmable A general purpose processor + specific hardware resource

The instruction-set is optimized for a group of applicationsBase instruction set + customized instructions

Specific hardware resource implements the customized instructions Examples:

DSPs (Digital Signal Processor)NPs (Network Processor)GPUs (Graphical Processing Unit)…

Page 12: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Application Specific Instruction-set Processor

Program with basic instructions set It1 = a * b;

t2 = b * 0xf0;;t3 = c * 0x12;

t4 = t1 + t2;

t5 = t2 + t3;

t6 = t5 + t4;

CustomLogic

* * *

+ ++

0xf0 0x12a b c

Execution time: 9 clock cycles

*: 2 clock cycles +: 1 clock cycles

Page 13: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Application Specific Instruction-set Processor (cont’d)

* * *

+ ++

0xf0 0x12a b c

Program with extended instructionst1 = extop1(a, b, 0xf0);

t2 = extop2(b, c, 0xf0, 0x12);

t3 = t1 + t2;

Execution time: 5 clock cycles Speedup: 1.8

extops: 2 clock cycles +: 1 clock cyclesExtended Instruction Set: I∪extop1 ∪expop2

extop1 extop2

Page 14: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

ASIP example- DSPA Digital signal Processor (DSP) has instructions that efficiently executes the common signal processing algorithms

Typical DSP algorithms includes:Filtering, DFT, DCTSpeech and image: Compression, decompression, encryption, decryptionModems: Equalization, noise and echo cancellation, better SNRCommunication channel: encoding, decoding, equalization

14

Page 15: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

ASICsApplication-specific ICDigital circuit designed to execute one programFeatures

Contains only the components needed to execute a single programNo program memory

BenefitsFast (optimized)Low powerSmall size

Page 16: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Design spectrum

Excellent tradeoff between efficiency of ASICs and flexibility of CPUs

Page 17: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

GPU

17

Graphic processing unit

Used for graphic processing and other parallel algorithms

Page 18: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded System

18

Embedded systems: information processing systems that are embedded into a larger product and that are normally not directly visible to user

Single or limited purpose: designed to perform a single or a group of similar tasks

An embedded system may perform A single task that remains fixed during the system life-time

example: video-projector, printer,…

A group of tasks Example: a cell phone

Page 19: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded systems

19

More than 90% of computer systems are embedded!

Page 20: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded systems- classification

20

Monitoring and control functions Vehicle control, power plant control

Information-processing functions Telecommunication switches, Multimedia (mp3 player), etc.

A simple LCD board controller A complex telecommunication switch

Page 21: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded systems

21

Simple embedded systems are often use microcontrollers

Large and complex embedded systems are composed of many devices such as FPGAs, CPUs, ASIPs, hardware accelerates, memory modules, interfaces, analog devices,….

Page 22: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded systems- general picture

22

Different application type have different requirements and characteristics

Page 23: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Embedded systems-control-based

23

Most peripherals are organized to monitor the outside world and control it

Do not require large data storage and transfer

Reliability, low-cost, and low-power operation is important

Microcontrollers are the best choice for this purpose

A processor core with many peripheral integrated inside a single chip

Page 24: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Microcontrollers

24

A smaller computerOn-chip RAM, ROM, I/O ports...Example AVR, Intel’s 8051, Zilog’s Z8, and PIC 16X

Page 25: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

General Purpose Microprocessorsvs. Microcontrollers

25

Page 26: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

Most common microcontrollers

26

8-bit microcontrollersAVRPICHCS128051

32-bit microcontrollersARMPIC32

Page 27: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

IntroductionTechnological advances

Today’s chip can contains 7 billion transistorsThe consequences

Components connected on a board can now be integrated onto single chip Hence the development of system-on-chip design

27

Page 28: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

SoCAn SoC may contain

Custom hardware blocksA.K.A. Hardware accelerator

DSP blocksEmbedded CPUEmbedded MemoryReal World Interfaces (USB,

PCI, Ethernet)Software (both OS and Applications)Mixed-signal Blocks

DAC, ADC

FPGAs

28

Page 29: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

SoC evolution

29

Page 30: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

SoC Example- a handheld device

30

Page 31: Introduction to Microprocessorsce.sharif.edu/courses/93-94/2/ce513-1/resources/root/Slides/Micro-L… · 5 General-Purpose Processor yGeneral-Purpose Processor yProcessor designed

SoC benefits

31

Reduce size

Low cost

Reuse

Low power

High performance

High reliability