Introduction To Computer Architecture - David Vernon

Transcription

An Introduction toComputer SystemsDavid VernonCopyright 2007 David Vernon (www.vernon.eu)

A Computer . takes inputprocesses it according to stored instructionsproduces results as outputCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Input: DataInstructions: Software, ProgramsOutput: Information (numbers, words,sounds, images)Copyright 2007 David Vernon (www.vernon.eu)

Types of ComputerComputerSpecial Purpose(embedded systems)Pre-programmedGeneral Purpose(user-programmable)Can be adapted tomany situationsWatchesTraffic SignalsPersonal ComputersWorkstationsEngine honesNavigation DevicesCopyright 2007 David Vernon (www.vernon.eu)

Data vs Information A A– your grade in the exam 2, 4, 23, 30, 31, 36 2, 4, 23, 30, 31, 36– Next week’s LottonumbersCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Codes– Data and information can be represented aselectrical signals (e.g. Morse code)– A code is a set of symbols (such as dots anddashes in Morse code) that represents another setof symbols,»»»»such as the letters of the alphabet,or integers or real numbers,or light in an image,for the tone of a violinCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts A circuit is an inter-connected set ofelectronic components that perform afunctionIntegrated Circuits (ICs)– Combinations of thousands of circuits built on tinypieces of silicon called chipsCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Binary signal (two state signal)––––Data with two statesoff & onlow voltage & high voltage0v & 5vCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Bit– Single Binary Digit– Can have value 0 or 1, and nothing else– A bit is the smallest possible unit of information ina computerCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Groups of bits can represent data orinformation–––––––1 bit - 2 alternatives2 bits - 4 alternatives3 bits - 8 alternatives4 bits - 16 alternativesnn bits - 2 alternativies88bits - 2 256 alternativesa group of 8 bits is called a byteCopyright 2007 David Vernon (www.vernon.eu)

4 Bits 0000000100100011 0100010101100111 10001001101010111100110111101111Copyright 2007 David Vernon (www.vernon.eu)

Key Concepts Information System– A system that takes data, stores and processes it,and provides information as an output– An IS is a computer in use– The amount of data can be vastCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Communication System– Communication: the transfer of meaningfulinformation– Comprises» a sender (transmitter)» a channel over which to send the data» a receiverCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Network– Two and usually morecommunication devicesconnected together– Many connection topologiesCopyright 2007 David Vernon (www.vernon.eu)

Key Concepts Hardware– The physical (electronic and mechanical) parts ofa computer or information system Software– The programs that control the operation of thecomputer systemCopyright 2007 David Vernon (www.vernon.eu)

Components of ComputerSystemsCopyright 2007 David Vernon (www.vernon.eu)

Components of Computer Systems KeyboardDisplaySystem UnitStoragePrinterCopyright 2007 David Vernon (www.vernon.eu)

Key Components More pyright 2007 David Vernon (www.vernon.eu)

INPUTInput SystemsKeyboard Keyboard» Most common inputdevice» QWERTYCopyright 2007 David Vernon (www.vernon.eu)

INPUTInput Systems Mouse» Cursor manipulationdevice» TrackballCopyright 2007 David Vernon (www.vernon.eu)KeyboardMouse

INPUTInput SystemsKeyboardTouch Screen Touch ScreensCopyright 2007 David Vernon (www.vernon.eu)Mouse

INPUTInput Systems KeyboardMouseTouch ScreenPen/StylusPensStylusCopyright 2007 David Vernon (www.vernon.eu)

INPUTInput SystemsKeyboardMouseTouch ScreenPen/StylusMagnetic Ink Magnetic InkCharacter Recognition(MICR)Copyright 2007 David Vernon (www.vernon.eu)

INPUTInput Systems Bar Code ReadersCopyright 2007 David Vernon (www.vernon.eu)KeyboardMouseTouch ScreenPen/StylusMagnetic InkBar Code

INPUTInput Systems Optical Character RecognitionsystemsBook readers for the blindAutomated input of textCan do typewritten text andhandwritten block capitalProblems with cursive handwritingrecognitionCopyright 2007 David Vernon (www.vernon.eu)KeyboardMouseTouch ScreenPen/StylusMagnetic InkBar CodeOptical CharacterRecognition

INPUTInput Systems Sensors––––Digital thermometersAccelerometersStrain gauges (weighing scales).Copyright 2007 David Vernon (www.vernon.eu)KeyboardMouseTouch ScreenPen/StylusMagnetic InkBar CodeOptical CharacterRecognitionSensors

INPUTInput Systems Camera Systems––––Surveillance and monitoringVisual inspectionRobot guidanceVideo conferencingCopyright 2007 David Vernon (www.vernon.eu)KeyboardMouseTouch ScreenPen/StylusMagnetic InkBar CodeOptical CharacterRecognitionSensorsCameras

INPUTInput Systems Voice– Voice recognition– Hands-free car-phones– Assistance for the disabledCopyright 2007 David Vernon (www.vernon.eu)KeyboardMouseTouch ScreenPen/StylusMagnetic InkBar CodeOptical CharacterRecognitionSensorsCamerasVoice

Key Components InputOutputStorageProcessorCopyright 2007 David Vernon (www.vernon.eu)

Output SystemsOUTPUTSoft CopyModemDisk or TapeCopyright 2007 David Vernon (www.vernon.eu)Hard Copy

OUTPUTOutput SystemsSoft CopyVoice CRTModemFlat PanelSoft Copy» Voice synthesis» Music» CRT (Cathode RayTube)» LCD (Liquid CrystalDisplay)Copyright 2007 David Vernon (www.vernon.eu)Disk or TapeHard Copy

OUTPUTOutput SystemsSoft CopyVoice CRTModemFlat PanelModems– Modulator-Demodulator– Allows computers tocommunicate overtelephone linesCopyright 2007 David Vernon (www.vernon.eu)Disk or TapeHard Copy

OUTPUTOutput SystemsSoft CopyVoice CRTModemFlat PanelDisks– Magnetic» Floppy» Hard disk– Optical Storage DevicesCopyright 2007 David Vernon (www.vernon.eu)Disk or TapeHard Copy

Output SystemsOUTPUTVoiceSoft CopyModemDisk or TapeCRTFlat PanelPlottersHard CopyMicrofilmCopyright 2007 David Vernon (www.vernon.eu)Non-impactPrintersImpact Printers

Output SystemsOUTPUTVoiceSoft CopyModemDisk or TapeCRTFlat PanelPlottersHard CopyMicrofilmCopyright 2007 David Vernon (www.vernon.eu)Non-impactPrintersImpact Printers

Output SystemsOUTPUTVoiceSoft CopyModemDisk or TapeCRTFlat PanelPlottersHard CopyMicrofilmCopyright 2007 David Vernon (www.vernon.eu)Non-impactPrintersImpact PrintersLaserMagneticThermal TransferThermal and Electrostatic

Output SystemsVoiceOUTPUTSoft CopyModemDisk or TapeCRTFlat PanelPlottersHard CopyMicrofilmNon-impactPrintersImpact PrintersDot matrixCopyright 2007 David Vernon (www.vernon.eu)Line Printer

Key Components InputOutputStorageProcessorCopyright 2007 David Vernon (www.vernon.eu)

Storage SystemsSTORAGE Units of Storage––––TemporaryMEMORY1 bit8 bits 1 byte101kbyte 2 1024 bytes201Mbyte 2 1048576 bytesCopyright 2007 David Vernon (www.vernon.eu)PermanentMASS STORAGE

Storage Systems STORAGETemporaryMEMORYMemory– Stores the bits and bytes (instructionsand data)ROM– ROM - Read Only Memory» Non-volatile» Won’t disappear when power is off– RAM - Random Access Memory» Read/Write Memory» Volatile» SIMMs (Single Inline MemoryModules):4 Mbytes in a stick of chewing gumCopyright 2007 David Vernon (www.vernon.eu)RAMPermanentMASS STORAGE

STORAGEStorage Systems Optical Disks––––TemporaryMEMORYROM15,000 tracks per inchDigital code read by laser650 Mbytes in a 4.75” plastic platterCD ROM; WORM; Erasable DisksCopyright 2007 David Vernon (www.vernon.eu)RAMPermanentMASS STORAGEOpticalMagnetic

STORAGEStorage Systems CD ROMTemporaryMEMORYROMRAMPermanentMASS STORAGEOpticalMagnetic– CD Read Only Memory– 12cm optical disk– Capable of storing 72 minutes of VHS quality video using MPEGcompressionCopyright 2007 David Vernon (www.vernon.eu)

STORAGEStorage Systems Write-One Read MostlyCDs (WORMS)TemporaryMEMORYROMRAMPermanentMASS STORAGEOptical– Powerful laser burns in the digital code– Not erasable– Lowe power laser reads the digital pattern Eraseable CD– Lasers read and write inofrmation– Also use a magnetic material– To write: a laser beam heats a tiny spot and a magnetic field isapplied to reverse the magnetic polarityCopyright 2007 David Vernon (www.vernon.eu)Magnetic

STORAGETemporaryMEMORYStorage SystemsROMPermanentMASS STORAGERAMOpticalMagneticDisk Magnetic DiskTape– A circular platter coated withmagnetic material Floppy Disk– 3.5”; 360kbyte to 2.88Mbytes (1.44 iscommon) Hard Disk– 1.3”, 1.8”, 2.5”, 3.5”, 5.25”;120Mbytes to over 6 Gigabyte (6Gbyte)Copyright 2007 David Vernon (www.vernon.eu)Memory Card

STORAGETemporaryMEMORYStorage SystemsROMPermanentMASS STORAGERAMOpticalMagneticDisk 40 Gbyte hard diskTape– 20,000,000 pages of text 650 Mbyte CD– 325,000 pages of text 17 Gbyte DVD– 8,500,000 pages of textCopyright 2007 David Vernon (www.vernon.eu)Memory Card

STORAGETemporaryMEMORYStorage SystemsROM PermanentMASS STORAGERAMHeight of Read Head above magnetic surface– 2 millionths of an inch Smoke Particle– 250 millionths of an inch Fingerprint– 620 millionths of an inch Dust particle– 1500 millionths of an inch Human hair– 3000 millionths of an inchCopyright 2007 David Vernon (www.vernon.eu)OpticalMagneticDiskTapeMemory Card

The Processor:Hardware & SoftwareCopyright 2007 David Vernon (www.vernon.eu)

Components of Computer Systems KeyboardDisplaySystem UnitStoragePrinterCopyright 2007 David Vernon (www.vernon.eu)

Key Components InputOutputStorageProcessorCopyright 2007 David Vernon (www.vernon.eu)

Processing UnitHardwareHardware Microprocessor––––Effects computationIntel 80486, 80586Motorola 68040PowerPC, MIPS,Alpha, Sparc– Clock speeds 50-600MHz ( ) MicroprocessorMemoryInterface ICsMemory– Storage Interface ICs– communication with other devicesCopyright 2007 David Vernon (www.vernon.eu)Software

Processing UnitHardwareHardware Much more to comeon the topic ofhardware shortlyMicroprocessorMemoryInterface ICsCopyright 2007 David Vernon (www.vernon.eu)Software

SoftwareSoftwareSystem ation SoftwareGeneralPurposeCopyright 2007 David Vernon (www.vernon.eu)SpecialPurpose

SoftwareOperating SystemsSystem SoftwareOperatingSystems ProgrammingLanguagesUser interfaces– Software which is responsible for passinginformation to and from the person using theprogram (the user)– Communicates with and controls the computer– Three types of user interface:» Graphic user interfaces» Menu driven interfaces» Command driven interfacesCopyright 2007 David Vernon (www.vernon.eu)Application SoftwareGeneralPurposeSpecialPurpose

SoftwareOperating SystemsSystem SoftwareOperatingSystems ProgrammingLanguagesGraphic User Interfaces (GUIs)– Pictures, graphic symbols (icons), to representcommands– Windows: a way of ‘looking in’ on severalapplications at onceCopyright 2007 David Vernon (www.vernon.eu)Application SoftwareGeneralPurposeSpecialPurpose

SoftwareOperating SystemsSystem SoftwareOperatingSystems Menu-driven interfaces– Menu bar– Pull-down menu for choicesCopyright 2007 David Vernon (www.vernon.eu)ProgrammingLanguagesApplication SoftwareGeneralPurposeSpecialPurpose

SoftwareOperating SystemsSystem SoftwareOperatingSystems ProgrammingLanguagesApplication SoftwareGeneralPurposeCommand-driven interfaces– A (system) prompt– User types in single letter, word, line which is translated intoan instruction for the computer– For example: cp source destination– Need to be very familiar with the syntax (grammar) of thecommand languageCopyright 2007 David Vernon (www.vernon.eu)SpecialPurpose

SoftwareSoftwareSystem ation SoftwareGeneralPurposeCopyright 2007 David Vernon (www.vernon.eu)SpecialPurpose

Operating Systems Operating System is the software that managesthe overall operation of the computer systemMain purpose is to support application programsHide details of devices from application programsCopyright 2007 David Vernon (www.vernon.eu)

SoftwareSystem SoftwareOperating SystemsOperatingSystemsShell Network I/FApplication rposeSpecialPurposeKernelShell (or user interface)Network interface:coordinate multiple tasks in a single computerTask schedulercoordination of multiple tasks in a single computerKernel– Software which ties the hardware to the software, and– manages the flow of information to and from disks, printers, keyboards,. all I/O devicesCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems File Handling– Collection of information (stored on disk)– Disks need to be formatted to allow them to storeinformation– OS manages location of files on disk– OS performs I/O to disk– OS checks and corrects errors on disk I/OCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems Device Drivers– Programs which handle the various hardware devices,e.g., mouse, keyboard, CD, video, etc.– For example, an application wants to print a document» It call the operating system» which sends the information to the device driver togetherwith instructions» and the printer driver handles all the control of the printerCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems Single tasking OS– Runs only one application at a time Multi-Tasking OS– More than one application can be active at anyone timeCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems DOS (Disk Operating drivenHuge number of applications written for DOSDoes not require powerful computerNo network servicesNo multimedia extensionsDesigned for the Intel 80x86 processorCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems Windows–––––GUICan run DOS programsHas network servicesHas multimedia extensionsRequires large amounts of memory, disk space,powerful processor– Designed for the Intel 80X86 processorsCopyright 2007 David Vernon (www.vernon.eu)

Operating Systems Macintosh OS–––––––Multi-taskingGUI called finderVery easy to useVery graphically orientedHas network servicesHas multimedia extensionsDesigned for the Motorola and PowerPCprocessorsCopyright 2007 David Vernon (www.vernon.eu)

SoftwareApplication SoftwareSystem SoftwareOperatingSystems ProgrammingLanguagesSpecial gEntertainmentStatistical AnalysisCopyright 2007 David Vernon (www.vernon.eu)Application SoftwareGeneralPurposeSpecialPurpose

SoftwareApplication SoftwareSystem SoftwareOperatingSystems ProgrammingLanguagesGeneral Purpose–––––––Word Processing (e.g. MS Word)Desktop Publishing (e.g. Quark Xpress)Spreadsheets (e.g. MS Excel)Databases (e.g. MS Access)Graphics (e.g. MS Powerpoint)E-mail (e.g. MS Mail)Internet Browsers (e.g. Firefox, Explorer)Copyright 2007 David Vernon (www.vernon.eu)Application SoftwareGeneralPurposeSpecialPurpose

SoftwareApplication SoftwareSystem SoftwareOperatingSystems ProgrammingLanguagesApplication SoftwareGeneralPurposeIntegrated Software– Goal: effective sharing of information between allapplications– For example: MS Office: Excel, Word, Powerpoint,Access can all use each other’s data directlyCopyright 2007 David Vernon (www.vernon.eu)SpecialPurpose

SoftwareApplication SoftwareSystem SoftwareOperatingSystems ProgrammingLanguagesApplication SoftwareGeneralPurposeIntegrated Software–––––Object Linking & Embedding (OLE)Information is stored in one location onlyReference is made to it from another applicationThis reference is known as a linkDon’t actually make a copy (cf. hypertext, multimedia,WWW)Copyright 2007 David Vernon (www.vernon.eu)SpecialPurpose

Application Software Object Linking & Embedding (OLE)Copyright 2007 David Vernon (www.vernon.eu)

Operation ofProcessor and MemoryCopyright 2007 David Vernon (www.vernon.eu)

The Processor The processor is a functional unit that interpretsand carries out instructionsAlso called a Central Processing Unit (CPU)Every processor has a unique set of operationsLOADADDSTORECopyright 2007 David Vernon (www.vernon.eu)

The Processor This set of operation is called the instructionsetAlso referred to as machine instructionsThe binary language in which they are writtenis called machine languageCopyright 2007 David Vernon (www.vernon.eu)

The Processor An instruction comprises– operator (specifies function)– operands - (data to be operated on) For example, the ADD operator requires twooperands– Must know WHAT the two numbers are– Must know WHERE the two numbers areCopyright 2007 David Vernon (www.vernon.eu)

The Processor If the data (e.g. the number to be added) is inmemory, then the operand is called anaddressADD num1 num2num1 could be a number or it could be theaddress of a number in memory (i.e. wherethe number is stored)Copyright 2007 David Vernon (www.vernon.eu)

Machine LanguageInstruction SetCategoryExampleArithmeticAdd, subtract, multiply, divideLogicAnd, or, not, exclusive orProgram Controlbranching, subroutinesData MovementMove, load, storeInput/OutputRead, WriteCopyright 2007 David Vernon (www.vernon.eu)

The Processor The processor’s job is to–––––retrieve instructions from memoryretrieve data (operands) from memoryperform the operation(maybe store the result in memory)retrieve the next instruction .Copyright 2007 David Vernon (www.vernon.eu)

The Processor This step-by-step operation is repeated overand over at speeds measured in millionths ofa secondThe CLOCK governs the speed: each stepmust wait until the clock ‘ticks’ to begina 300 MHz processor will use a clock whichticks 300 000 000 times a secondCopyright 2007 David Vernon (www.vernon.eu)

The Components of a & Logic UnitALURegistersCopyright 2007 David Vernon (www.vernon.eu)

The Control Unit Supervises the operation of the processorMakes connections between the variouscomponentsInvokes the operation of each componentCan be interrupted!Copyright 2007 David Vernon (www.vernon.eu)

The Control Unit An interrupt– is a signal– which tells the control unit to suspend execution ofits present sequence of instructions (A)– and to transfer to another sequence (B)– resuming the original sequence (A) when finishedwith (B)Copyright 2007 David Vernon (www.vernon.eu)

An InterruptInstruction A1Instruction A2Instruction A3Instruction A4Instruction A5::Instruction B1Instruction B2::Instruction BnEXECUTE instructionsBRANCH to new set of instructionsCopyright 2007 David Vernon (www.vernon.eu)

The Control Unit Receives instructions from memoryDecodes them (determines their type)Breaks each instruction into a sequence ofindividual actions(more on this later)And, in so doing, controls the operation of thecomputer.Copyright 2007 David Vernon (www.vernon.eu)

The Arithmetic & Logic Unit ALUProvided the computer with its computationalcapabilitiesData are brought to the ALU by the controlunitALU performs the required operationCopyright 2007 David Vernon (www.vernon.eu)

The Arithmetic & Logic Unit Arithmetic operations– addition, subtraction, multiplication, division Logic operations– make a comparison (CMP a, b)– and take action as a result (BEQ same)Copyright 2007 David Vernon (www.vernon.eu)

Registers Register: a storage location inside theprocessorControl unit registers:– current instruction– location of next instruction to be executed– operands of the instruction ALU registers:– store data items– store resultsCopyright 2007 David Vernon (www.vernon.eu)

Registers 11001011Word size (or word length)– Size of the operand register– Also used to describe the size of the pathways toand from the processor and between thecomponents of the processor 16 to 64 bits word lengths are common32 bit processor . the operand registers of aprocessor are 32 bits wide (long!)Copyright 2007 David Vernon (www.vernon.eu)

Specialized Processors DSP - Digital Signal Processors– Image processing; sound, speech Math co-processors– Real number arithmetic ASICs - Application-Specific IntegratedCircuits– Microwave contoller– Engine management controllerCopyright 2007 David Vernon (www.vernon.eu)

The Operation of the ProcessorA Simple Accumulator-Based CPU(Von Neumann Computer)Copyright 2007 David Vernon (www.vernon.eu)

The Components of a & Logic UnitALURegistersCopyright 2007 David Vernon (www.vernon.eu)

Main Components (Program) Control Unit - PCU– Coordinates all other units in the computer– Organizes movement of data from/to I/O, memory,registers.– Directs ALU, specifically to indicate the operationsto be performed– The control unit operates according to the storedprogram, receiving and executing its instructionsone at a timeCopyright 2007 David Vernon (www.vernon.eu)

The Components of a & Logic UnitALURegistersCopyright 2007 David Vernon (www.vernon.eu)

Main Components Arithmetic & Logic Unit - ALU––––All computations are performed in this unitALU comprises adders, counters, and registersNumerical operations ( - / x)Logical operations (AND, OR, program branching)Copyright 2007 David Vernon (www.vernon.eu)

Main Components Register– Capable of receiving data, holding it, and transferring it asdirected by the control unit Adder– Receives data from two or more sources, performs thearithmetic, and sends the results to a register Counter– Counts the number of times an operation is performedCopyright 2007 David Vernon (www.vernon.eu)

The Components of a nitArithmetic& Logic UnitALURegistersCPUCopyright 2007 David Vernon (www.vernon.eu)

Some Key Points Instructions are coded as a sequence ofbinary digitsData are coded as a sequence of binarydigitsRegisters are simply physical devices whichallows these codes to be storedMemory is just the sameCopyright 2007 David Vernon (www.vernon.eu)

The Operation of a Processor How does a computer evaluate a simpleassignment statement? For example:A : B CCopyright 2007 David Vernon (www.vernon.eu)

The Operation of a Processor A : B CA computer can’t evaluate this directly(because it’s not written in a way whichmatches the structure of the computer’sphysical architecture)First, this must be translated into a sequenceof instructions which the does match thecomputer architectureCopyright 2007 David Vernon (www.vernon.eu)

The Operation of a Processor A : B CSo . we need a detailed processorarchitecture (i.e. a machine)and a matching language (machine languageor assembly language)– machine language when it’s written as a binarycode– assembly language when it’s written symbolically.Copyright 2007 David Vernon (www.vernon.eu)

The Components of a nitArithmetic& Logic UnitALURegistersCPUCopyright 2007 David Vernon (www.vernon.eu)

The Components of a RPCACIRArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

The Components of a Processor DR - Data RegisterAR - Address RegisterAC - AccumulatorPC - Progam CounterIR - Instruction RegisterALU - Arithmetic Logic UnitPCU - Program Control UnitCopyright 2007 David Vernon (www.vernon.eu)

The Components of a CIRDRACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

The Components of a CIRDRACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

The Components of a CIRDRACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

The Components of a CIRDRACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

The Components of a CIRDRACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)ALU

Instruction Format An instruction is typically divided into 2 fields addressThis is a opcodevery simplifiedsituation and, ingeneral, one would expect– opcode/operand– opcode/address (which may vary in size)Copyright 2007 David Vernon (www.vernon.eu)

Instruction Format Load X– puts contents of memory location X into theaccumulator Add T– Add contents of memory at location T to thecontents of the accumulator Store Y– Put contents of accumulator into memory atlocation YCopyright 2007 David Vernon (www.vernon.eu)

Evaluate an Assignment A : B C Load BAdd CStore A Copyright 2007 David Vernon (www.vernon.eu)

Load CUControlCircuitsPCIRAC01001100ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Add CUControlCircuitsPCIRAC01001101ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Store CUControlCircuitsPCIRAC01001101ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

But . The instructions are stored in memory also!Copyright 2007 David Vernon (www.vernon.eu)

Load BInputCPUABC111111110100110000000001ARAdd CStore c CircuitsCopyright 2007 David Vernon (www.vernon.eu)

So . It works more like this .Copyright 2007 David Vernon (www.vernon.eu)

Evaluate an Assignment A : B C Load BAdd CStore A Copyright 2007 David Vernon (www.vernon.eu)

Load BLoad BInputCPUABC111111110100110000000001ARAdd CStore AOutputDRALUPCUControlCircuitsPCIRLoad BACArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BLoad BInputCPUAdd CABC111111110100110000000001ARStore AOutputDRALUPCUControlCircuitsPCIRLoad BAC01001100ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BAdd CInputCPUAdd CABC111111110100110000000001ARStore AOutputDRALUPCUControlCircuitsPCIRAdd CAC01001100ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BAdd CInputCPUAdd CABC111111110100110000000001ARStore AOutputDRALUPCUControlCircuitsPCIRAdd CAC01001101ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BStore AInputCPUAdd CABC111111110100110000000001ARStore AOutputDRALUPCUControlCircuitsPCIRStore AAC01001101ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BStore AInputCPUAdd CABC010011010100110000000001ARStore AOutputDRALUPCUControlCircuitsPCIRStore AAC01001101ArithmeticLogic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Load BInputCPUABC111111110100110000000001ARAdd CStore c CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Operation of the Processor The primary function of a processor is toexecute sequences of instructions stored inmain memory Instruction Cycle– Fetch Cycle– Execute CycleCopyright 2007 David Vernon (www.vernon.eu)

Instruction Cycle Fetch Cycle– Fetch instruction from memory Execute Cycle– Decode instruction– Fetch required operands– Perform operationCopyright 2007 David Vernon (www.vernon.eu)

Instruction Cycle Instruction cycle comprises a sequence ofmicro-operations each of which involves atransfer of data to/from registersCopyright 2007 David Vernon (www.vernon.eu)

Instruction Cycle In addition to executing instructions the CPUsupervises other system component usually viaspecial control linesIt controls I/O operations(either directly or indirectly)Since I/O is a relatively infrequent event, I/Odevices are usually ignored until they activelyrequest service from the CPU via an interruptCopyright 2007 David Vernon (www.vernon.eu)

An InterruptInstruction A1Instruction A2Instruction A3Instruction A4Instruction A5::Instruction B1Instruction B2::Instruction BnInterrupt is activated byan electronic signalEXECUTE instructionsBRANCH to new set of instructionsCopyright 2007 David Vernon (www.vernon.eu)

STARTInstructionCycleInstruction AwaitingExecution?NOYESFetch next instructionExecute next instructionInterrupts requiringservicing?NOYESTransfer control tointerrupt handling programCopyright 2007 David Vernon (www.vernon.eu)FETCH CYCLEEXECUTE CYCLEPROGRAMTRANSFER

Main ProgramSubroutine AInterrupt HandlerLoad BOP1OP1Add COP1OP1Store AOutputOP1OutputOP1OutputCPUARA 11111111B 01001100C ic CircuitsCopyright 2007 David Vernon (www.vernon.eu)

Register Transfer Language Storage locations, in CPU and memory, arereferred to by an acronym AC– Accumulator; main operand register of ALUCopyright 2007 David Vernon (www.vernon.eu)

Register Transfer Language DR– Data Register; acts as a buffer between CPU andmain memory.– It is used as an input operand register withaccumulator to facilitate operations of the form AC f(AC, DR)Copyright 2007 David Vernon (www.vernon.eu)

Register Transfer Language PC– Program Counter– Stores address of the next instruction to beexecuted IR– Instruction Register– Holds the opcode of the current instructionCopyright 2007 David Vernon (www.vernon.eu)

Register Transfer Language AR– Address Register– Holds the memory address of an operandCopyright 2007 David Vernon (www.vernon.eu)

Register Transfer Language A B– transfer contents of sto

Copyright 2007 David Vernon (www.vernon.eu) Storage Systems Write-One Read_Mostly CDs (WORMS) - Powerful laser burns in the digital code - Not erasable .