Fundamentals Of Chapter 1 Microprocessor And Microcontroller

Transcription

Fundamentals ofChapter 1Microprocessor andMicrocontrollerDr. Farid FarahmandUpdated: 4/2/16

A little HistorynWhat is a computer? [Merriam-WebsterDictionary] one thatcomputes; specifically : programmableelectronic device that can store, retrieve, andprocess data. [Wikipedia] A computer is a machine thatmanipulates data according to a list ofinstructions.nClassification of Computers (power and price) Personal computersMainframesSupercomputersDedicated controllers – Embedded controllers

MainframesnThe First Mainframes nBig businesses with big needs required big computers.Economies of scale also favored large, consolidated computersystems.The Second Mainframes Transistor-based computers were replacing vacuum-tubemachines in the late 1950s, spurred developments in hardwareand software. Manufacturers commonly built small numbers ofeach model, targeting narrowly defined markets.

MainframesMassive amounts of memoryn Use large data words 64 bits or greatern Mostly used for military defense and largebusiness data processingn Examples: IBM 4381, Honeywell DPS8n

Personal ComputersnAny general-purpose computer Intended to be operated directly by an endusernRange from small microcomputers that work with 4-bitwords to PCs working with 32-bit words or moreThey contain a Processor - called different namesn Microprocessor– built using Very-Large-ScaleIntegration technology; the entire circuit is ona single chip Central Processing Unit (CPU) Microprocessor Unit (MPU) – similar to CPUhttp://en.wikipedia.org/wiki/Personal computer

SupercomputersnFastest and most powerful mainframes Contain multiple central processors (CPU)Used for scientific applications, and number crunchingNow have teraflops performancennnFLoating Point Operations Per Second (FLOPS)Used to measure the speed of the computerExamples of special-purpose supercomputers: Belle, Deep Blue, and Hydra, for playing chessReconfigurable computing machines or parts of machinesGRAPE, for astrophysics and molecular dynamicsDeep Crack, for breaking the DES cipherMDGRAPE-3, for protein structure ter

Microcontrollers –Embedded SystemsnnAn embedded system is a special-purpose computersystem designed to perform one or a few dedicatedfunctions often with real-timeAn integrated device which consists of multiple devices nMicroprocessor (MPU)MemoryI/O (Input/Output) portsOften has its own dedicated software

A little aboutMicroprocessor-basedSystems

EvolutionnnFirst came transistorsIntegrated circuits n1- Microprocessors (MPU) nSSI (Small-Scale Integration) to ULSIVery Large Scale Integration circuits (VLSI)Microcomputers (with CPU being a microprocessor)Components: Memory, CPU, Peripherals (I/O)Example: Personal computers2- Microcontroller (MCU) Microcomputers (with CPU being a microprocessor)Many special function peripheral are integrated on a singlecircuitTypes: General Purpose or Embedded System (with specialfunctionalities)

Microprocessor-Based Systems Central Processing Unit (CPU) Memory Input/Output (I/O) circuitry Buses– Address bus– Data bus– Control bus

Control UnitMicroprocessor-based System

Microprocessor-Based System withBuses: Address, Data, and Control

Microprocessor-based SystemsMicroprocessorn Themicroprocessor (MPU) is a computing andlogic device that executes binary instructions in asequence stored in memory.n Characteristics: Generalpurpose central processor unit (CPU) Binary Register-based Clock-driven Programmable

Microprocessor-based SystemsMicroprocessornthe “brains” of the computer nits job is to fetch instructions, decode them, and then execute them8/16/32/etc –bit (how it moves the rol UnitALU performs computing tasks – manipulates the data/ performs numerical and logicalcomputationsRegisters are used for temp. storageControl unit is used for timing and other controlling functions – contains a programcounter (next instruction’s address and status register)System software: A group of programs that monitors the functions of the entire system

Let’s Review a Few ThingsFirst

UnsignedData Format (8-bit) (1 of 4)nSignedUnsigned Integers: All eight bits (Bit0 toBit7) represent the magnitude of a number Range0 to FF in Hex and 0 to 255 in decimal

UnsignedData Format (8-bit) (2 of 4)nSignedSigned Integers: Seven bits (Bit0 to Bit6)represent the magnitude of a number. The8th bit (Bit7) represents the sign of anumber. The number is positive when Bit7is zero and negative when Bit7 is one. Positive numbers: 0 to 7F (0 to 127) Negative numbers: 80 to FF (-1 to -128) All negative numbers are represented in2’s complement

Data Format (8-bit) (3 of 4)nBinary Coded Decimal Numbers (BCD) 8bits of a number divided into groups of four,and each group represents a decimal digitfrom 0 to 9 Four-bit combinations from A through F in Hexare invalid in BCD numbersnExample: 0010 0101 represents the binary codingof the decimal number 25d which is different invalue from 25H.

Data Format (8-bit) (4 of 4)nAmerican Standard Code for InformationInterchange (ASCII) Seven-bitalphanumeric code with 128combinations (00 to 7F) Represents English alphabet, decimal digitsfrom 0 to 9, symbols, and commands

Back to the Main Point Evolution of CPUs

DigitalLogic

TransistorsnnVacuum Tubes: A devise to control,modify, and amplify electric signalsThen came transistors Designed by John Bardeen, WilliamShockley, and Walter Brattain,scientists at the Bell TelephoneLaboratories in Murray Hill, NewJersey – 1947

TransistorsnnnIn September 1958 Jack Kilby ofTexas Instruments, Dallas, TXdemonstrated the industry's firstintegrated flip-flop.TI announced Kilby’s germanium“Solid Circuit” conceptRobert Noyce had co-founded theFairchild Semiconductor Corporation –he was also working on how to makemore of less.Jack Kilby was awarded the Nobel Prize in Physics in 2000 for his role as coinventor with Robert Noyce of the integrated circuit. Noyce did not receive the awardas he died on June 3, 1990.

Integrated CircuitsnnnAdvances inmanufacturing allowedpacking more transistorson a single chipTransistors andIntegrated Circuits fromSSI (Small-ScaleIntegration) to ULSIBirth of a microprocessorand its revolutionaryimpact

MicroprocessorsnnnNoyce and GordonMoore started IntelIntel designed he firstcalculatorIntel designed the firstmicroprocessor in 1971 Model 4004 4-bit; 2300 transistors,640 bytes of memory,108 KHz clock speed

First ProcessorsnnnnnIntel released the 8086, a 16-bit microprocessor,in 1978Motorola followed with the MC68000 as their 16bit processor The 16-bit processor works with 16 bit words,rather than 8 bit words Instructions are executed faster Provide single instructions for more complexinstructions such as multiply and divide16 bit processors evolved into 32 bit processorsIntel released the 80386Motorola released the MC68020

Evolution of CPUsIn 1965, Gordon Moore, co-founder of Intel, indicated that the number of transistors per square inch on integratedcircuits had doubled every year since the integrated circuit was invented. Moore predicted that this trend wouldcontinue for the foreseeable future.

Evolution of CPUsnTukwila World's First 2-Billion TransistorMicroprocessor - Next-generation Intel Itanium processors (codenamed Tukwila)2010: Intel Itanium Tukwila MPU, 2000M transistor2010 AMD Operon 6100 MPU, 1800 transistors2006 Nvidia G80, 681M transistors1994 Motorola 68060 MPU, 2M cture-silicon/2billion.htm

Remember

Microprocessor-based SystemsMemorynMemory is a group of registersnn16 register – address: 0-15 – in binary:0-1111; Address lines: A0-A3Serves two major purposesqqstoring the binary codes for the sequence ofinstructions specified by programs (program)storing binary data that the computer needsto execute instructions (data)

Microprocessor-based SystemsMemory Types R/W:It is volatile (losses information as power isremoved)n Write means the processor can store informationn Read means the processor can receive informationfrom the memoryn Acts like a Blackboard!ROM: Read-Only memory;n It is typically non-volatile (permanent) – can beerasablen It is similar to a Page from your textbookn Read/Write Memory; also called RAM

Microprocessor-based SystemsMemory ClassificationBasic Technologies:SemiconductorMagneticOptical(or combination)ExpensiveFast/CheapSlowOnetime programmableElectronically ErasablePROM

Microprocessor-based-one transistor and one Systemscapacitor to store a bitMemory Classification-Leakage problem, thusrequires refreshing-Used for dynamic data/program storage-Cheap and slow!-4/6 transistor tosave a single bit- Volatile- Fast butexpensiveExpensiveFast/CheapSlowOnetime programmableElectronically ErasablePROM

Erasable ROMsnMarked Programmed ROM nProgrammable ROM (PROM) n Uses ultraviolet light to erase (through a quartz window)OTP refers to one-time programmableElectrically Erasable Programmable ROM (EEPROM) nCan be programmed in the field via the programmerErasable Programmable ROM (EPROM) nProgrammed by the manufacturerEach program location can be individually erasedExpensiveRequires programmerFLASH Can be programmed in-circuit (in-system)Easy to erase (no programmer)Only one section can be erased/written at a time (typically 64 bytes at a time)

Microprocessor-based SystemsI/O PortsnnThe way the computer communicates with theoutside world devicesI/O ports are connected to Peripherals Peripherals are I/O devicesnn Input devicesOutput devicesExamplesnnnnPrinters and modems,keyboard and mousescannerUniversal Serial Bus (USB)

Microprocessor-basedSystems - BUSnThe three components – MPU, memory, and I/O – are connected by agroup of wires called the BUSnAddress busnnnControl bus nconsists of 16, 20, 24, or 32 parallel signal lines (wires) - unidirectionalthese lines contain the address of the memory location to read or writtenconsists of 4 to 10 (or more) parallel signal linesCPU sends signals along these lines to memory and to I/O portsn examples: Memory Read, Memory Write, I/O Read, I/O WriteData bus consists of 8,16, or 32 parallel signal linesbi-directionalonly one device at a time can have its outputs enabled,this requires the devices to have three-state output

Remember: 111 1111 1111 7FF 2 11-1 20472 11 2K 20482 11 Requires 11 bitsExpanded Microprocessor-Based System1. Note the directionsof busses2. What is the width ofthe address bus?3. What is the value ofthe Address but toaccess the firstregister of the R/WM?You must know how todraw it!

Example8000008010012KRegisters or bytes ofmemoryWhat?How many bitsHow much memory do we have?2KRegisters or bytes ofmemoryWhat?How many bits

Example8000008010012K(2 11 2048)Registers or bytes ofmemory2 11 -1 7FFRequires 11 bits2K(2 11 2048)Registers or bytes ofmemoryFFFRequires 12 bitsFor a total of 4095 bytesTotal of 4K bytes of memory: 2 12 (FFF) à 12 bits ; last values 2 12-1 4096-1

Example8 bits0000011G bytes of memory30 bits!2 30 -1 3FFF FFFFNext number: 4000 0000 (in Hex)

Example of an 8-bit MPUA15A0800RAM2KROM2KFFFD7D08-bit

So what aremicrocontrollers?

What is a Microcontroller?nA microcontroller is a small computer on asingle integrated circuit containing processorcore, memory, programmableninput/output peripheralsUsed for specific (embedded) applications

Embedded controllersUsed to control smart machinesn Examples: printers, auto braking systemsn Also called microcontrollers ormicrocontroller units (MCU)n

Embedded controllersSoftware CharacteristicsnnnNo operating systemsExecute a single program, tailored exactly to thecontroller hardwareAssembly language (vs. High-level language) Not transportable, machine specific Programmer need to know CPU architecture Speed Program size Uniqueness

Microcontroller Unit (MCU)Block DiagramnAn integrated electronic computing and logic device thatincludes three major components on a single chip nIncludes support devices nMicroprocessorMemoryI/O portsTimersA/D converterSerial I/OParallel Slave PortAll components connected by common communicationlines called the system bus.

First MicrocontrollersnnnnIBM started using Intel processors in its PC Intel started its 8042 and 8048 (8-bitmicrocontroller) – using in printersApple Macintosh used Motorola1980 Intel abandoned microcontroller businessBy 1989 Microchip was a major player indesigning microcontrollers PIC: Peripheral Interface Controller

Different Microcontrollers hat is the difference?8/16/24/32 bitsArchitecturePackageCapabilityMemorySoftware (IDE)/cloudADC (10-12 bit)A more complete list is here: lers

MCU ArchitecturennRISC Reduced instruction set computer Simple operations Simple addressing modes Longer compiled program but faster to execute Uses pipelining Most embedded systemCISC Complex instruction set computer More complex instructions (closer to high-level languagesupport) x86 standard (Intel, AMD, etc.), but even in the mainframeterritory CISC is dominant via the IBM/390 chipBench marks: How to compare MCUs togetherMIPS: Million Instructions / second (Useful when the compilers are the same)

CISC vs RISCCISCPentium/x86 are CISC-basedRISCARM-basedMost mobile-phonesComplex instructions requiremultiple cyclesReduced instructions take 1cycleMany instructions can referencememoryOnly Load and Store instructionscan reference memoryInstructions are executed one ata timeUses pipelining to executeinstructionsFew general registersMany general registersRISC and CISC architectures are becoming more and more alike.*Read the LINK on the web site!*

A Bit About A

02.04.2016 · n Range from small microcomputers that work with 4-bit words to PCs working with 32-bit words or more n They contain a Processor - called different names Microprocessor – built using Very-Large-Scale Integration technology; the entire circuit is on a single chip Central Processing Unit (CPU)