Introduction to...

Preview:

Citation preview

Introduction to Microprocessors

Microprocessors, Lecture 1:

Computing Systems

2

General-purpose standalone systems

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

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,…

General-purpose standalone systems

4

Desktop processorsIntel and AMD processors

Server processorsIntel, AMD, IBM, SUN, …

Tablet processorsARM-based System-on-Chips

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

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

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

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

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

Processors

10

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

ASIPASICGPU

ASIP and ASIC are used in embedded systems

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)…

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

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

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

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

Design spectrum

Excellent tradeoff between efficiency of ASICs and flexibility of CPUs

GPU

17

Graphic processing unit

Used for graphic processing and other parallel algorithms

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

Embedded systems

19

More than 90% of computer systems are embedded!

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

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,….

Embedded systems- general picture

22

Different application type have different requirements and characteristics

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

Microcontrollers

24

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

General Purpose Microprocessorsvs. Microcontrollers

25

Most common microcontrollers

26

8-bit microcontrollersAVRPICHCS128051

32-bit microcontrollersARMPIC32

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

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

SoC evolution

29

SoC Example- a handheld device

30

SoC benefits

31

Reduce size

Low cost

Reuse

Low power

High performance

High reliability

Recommended