Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
COMPUTER ORGANZIATION AND ASSEMBLY LANGUAGE Abdul Mannan Course Objectives After successfully completing this course, you will be able to: • Describe the basic components of a Computer System, its instruction set architecture and its basic fetch-execute cycle operation. • Describe how data is represented and recognized in a Computer. • Understand the basics of Assembly Language programming including addressing modes, subroutines, interrupts, stacks, etc. • Analyze, design, implement, and test assembly language programs. Course is About • What computers are consist of? • How computers work? • How to represent information? • How they are organized internally? • How design affects programming and applications? • Programming the machine: Assembly Language Text Books to Follow • Assembly Language for x86 Processors ,6th Ed. Kip R. Irvine , Prentice Hall ,2010 • Computer Organization & Design: The Hardware/Software Interface, 4th Ed. David Peterson & John Hennessy 2008 • Computer organization and Architecture by William Stallings Subject Schema The course is divided into two sections: • Computer Organization: describes how different components fit together to create working computer system. • Assembly Language: programming language that uses symbolic names to represent operations, registers and memory locations. Computing Machines • Computing machines are ubiquitous. • General Purpose: Servers, desktops, laptops, PDAs, etc.… • Special Purpose: Cash register, ATMs, Games, Mobile Phones, etc. • Embedded: Cars, door lock, printers, digital players, industrial machinery, medical equipment, etc. Computer Hardware Electronics circuit boards that provide functionality of the system Software Program consists of sets of instructions that control the system Inside the Computer • System software: provides services that are commonly useful, including • Operating system • Handling input/output • Managing memory and storage • Scheduling tasks & sharing resources • Translators: translates HLL code to machine code • Application software: written in HLL. Moore’s Law • In 1965, Intel founder Gordon Moore stated: “The number of transistors per square inch in an integrated circuit will double every year” • Current version of Moore’s Law predicts doubling of density of silicon chips every 18 months. • Moore originally thought this postulate would hold for 10 years; advances in chip manufacturing processes have allowed the law to hold for 40 years, and it is expected to last for perhaps another 10 Abstraction Complete definition of abstraction includes the following: • Suppression of detail • Outline structure • Division of responsibility • Subdivision of system into smaller subsystems Abstraction and Computer System • Can look at a computer as being a machine composed of a hierarchy of levels. • Each level has specific function • Each level exists as a distinct imaginary machine (or virtual machine) • Each level’s virtual machine executes its own particular set of instructions, calling upon machines at lower levels to carry out tasks as necessary App7 HOL6 Asmb5 OS4 ISA3 Mc2 LG1 • Each level has its own language to describe tasks performed by Computer Machine-independent • Text uses the following labels to describe levels of abstraction in a computer system: Machine-specific Abstraction and Computer Systems Abstraction and Computer Systems Level: App7 • The application level is composed of those programs designed to do specific kinds of tasks for end users. • An application may have some sort of programming language associated with it (macros or shortcuts, e.g.) • Ideally, end users need not be concerned with the actions and language(s) associated with lower levels in the abstraction hierarchy. Abstraction and Computer Systems Level: HOL6 • The high order language layer is the layer of abstraction at which most programmers operate. • Applications are typically written in high order languages. • High order languages are characterized by: • Portability across platforms. • Relative ease of use. • Relatively high level of abstraction, requiring translation of program code prior to execution. Abstraction and Computer Systems Level: Asmb5 • The assembly language level is an intermediate step between high order language and the machine language of a particular processor. • Programs at the HOL6 level are usually compiled to level Asmb5, then translated (assembled) to machine language. • Source code can also be written in assembly language. Abstraction and Computer Systems Level: OS4 • The operating system is responsible for the tasks related to multiprogramming, including: • Memory protection • Process synchronization • Device management • Operating systems were originally developed for multiuser systems, but even most single user systems utilize an operating system. • Compilers and assemblers are also considered systems software. Abstraction and Computer Systems Level: ISA3 • The instruction set architecture, or machine language level, consists of the set of instructions recognized by the particular hardware platform. • Instructions at this level are directly executable without any translation. Abstraction and Computer Systems Level: Mc2 • The microinstruction or control level is the level at which the computer decodes and executes instructions and moves data in and out of the processor. • The processor’s control unit interprets machine language instructions, causing required actions to take place. Abstraction and Computer Systems Level: LG1 • The digital logic level consists of the physical components of the computer system, the actual electronic gates and wires. • Boolean algebra and truth tables can be used to describe the operations at this level. Functions of a Computer • Functions of all computers are: • Data processing • Data storage • Data movement • Control Functions of a Computer Data Storage Facility Data Movement Apparatus Control Mechanism Data Processing Facility Data Movement e.g. Keyboard to screen Functions of a Computer Data Storage Facility Data Movement Apparatus Control Mechanism Data Processing Facility Storage e.g. Internet download to Hard Disk Functions of a Computer Data Storage Facility Data Movemen t Apparatus Control Mechanism Data Processing Facility Processing from/to storage e.g. Updating Word/Excel File Functions of a Computer Data Storage Facility Data Movemen t Apparatus Control Mechanism Data Processing Facility Processing from storage to I/O e.g. Printing a Word/Excel File Anatomy of Computer: Block Diagram Anatomy of Computer: Detailed Block Diagram Anatomy of Computer: Detailed Block Diagram Anatomy of Computer: Detailed Block Diagram Processor (CPU) Control Unit Common Bus (address, data & control) Datapath Arithmetic Logic Unit (ALU) Registers Memory Program Storage Data Storage Output Units Input Units Anatomy of Computer: CPU Control Unit Datapath • Decodes and monitors the execution of instructions. • Controls flow of information in CPU, memory, I/O devices: Arithmetic Logic Unit (ALU) • System clock (Intel® Core™ I7-720QM Processor (1.6GHz, turbo up to 2.8GHz, 6MB L3 Cache)) Registers • Maintains a register called program counter(PC) Processor (CPU) Anatomy of Computer: CPU Control Unit Datapath Arithmetic Logic Unit (ALU) Registers Processor (CPU) • ALU – Performs all arithmetic computations & logic evaluations. • Registers – Storage location in CPU, used to hold data or a memory address during the execution of an instruction.. Anatomy of Computer: Common Bus Common Bus (address, data & control) • A group of conducting wires that allow signals to travel from one point to another: • Address bus – The location of data in memory or I/O devices. • Data bus – Carry data in & out from CPU. • Control bus – Control the operation of the CPU. Anatomy of Computer: Memory • RAM • Volatile – Cannot retain data without power. • Allows the processor to read from & write into any location on memory chip. • ROM • Nonvolatile – When power is removed, the reapplied, the original data will still be there. • Can only be read, cannot be written to or by the processor.