Welcome to my presentation Mawlana Bhashani Science And Technology University Course Title : Microprocessor and Assembly Language Course Code : CSE - 3103 Submitted to: Submitted by: Mahbuba Begum Assistant Professor Dept. of CSE, MBSTU Md. Abdur Rahim ID: CE-16051 Dept. of CSE, MBSTU Objectives Generation of computer Microprocessor Generation of microprocessor Coprocessor Physical & Logical memory Real mode & protected mode Types of microprocessor based on register Microcontroller Microprocessor vs Microcontroller Compiler vs Assembler Types of register (CPU) Computer Generation: Generation in computer terminology is a change in technology a computer is/was being used. Initially, the generation term was used to distinguish between varying hardware technologies. Nowadays, generation includes both hardware and software, which together make up an entire computer system. There are five computer generations known till date. Here is given the features of five generation. First Generation: Vacuum Tubes (1940-1959) • • • • • • • • • • • • Program & data reside in the same memory Vacuum tubes were used to implement the function Unreliable Supported machine language only Very costly Generated a lot of heat Slow input and output devices Huge size Need of AC Non-portable Consumed a lot of electricity Some computers of this generation were −ENIAC , EDVAC, UNIVAC Second Generation: Transistors (1959-1965) • • • • • • • • • • • • Use of transistors FORTAN is used Separate I\O processor were developed to operate in parallel with CPU Reliable in comparison to first generation computers Smaller size as compared to first generation computers Generated less heat as compared to first generation computers Consumed less electricity as compared to first generation computers Faster than first generation computers Still very costly AC required Supported machine and assembly languages Some computers of this generation were −IBM 1620, IBM 7094, CDC 1604 Third Generation: Integrated Circuits (1965-1971) • • • • • • • • • IC technology improved Multiprogramming, pipelining concepts were incorporated Cache & virtual memory concepts were developed Better speed and could calculate data in nanoseconds. Commercial production increased. Used mouse and keyboard for input. Consumed lesser electricity Supported high-level language Some computers of this generation were − IBM-360 series Fourth Generation: VLSI Microprocessors (1971-1980) • • • • CPU termed as microprocessor Intel, Motorola, national semiconductors started developing microprocessor Interconnection of different computer for better communication LAN ,MAN , WAN Digital signal processor were also developed Fifth Generation: ULSI Microprocessors (1980-Present) • • • • • • • ULSI technology Development of true artificial intelligence Development of Natural language processing Advancement in Parallel Processing Advancement in Superconductor technology More user-friendly interfaces with multimedia features Availability of very powerful and compact computers at cheaper rates AI includes − • • • • • Robotics Neural Networks Game Playing Development of expert systems to make decisions in real-life situations Natural language understanding and generation Some computer types of this generation are −Desktop, Laptop, NoteBook Microprocessor Generation: 1st Generation: This was the period during 1971 to 1973 of microprocessor’s history. In 1971, INTEL created the first microprocessor 4004 that would run at a clock speed of 108 KHz. During this period, the other microprocessors in the market including Rockwell international PPS-4, INTEL-8008 and National semiconductors IMP-16 were in use. But, all these were not TTL compatible processors. 2nd Generation: This was the period during 1973 to 1978 in which very efficient 8-bit microprocessors were implemented like Motorola 6800 and 6801, INTEL-8085 and Zilogs-Z80, which were among the most popular ones. Owing to their superfast speed, they were costly as they were based on NMOS technology fabrication. 3rd Generation: During this period 16 bit processors were created and designed using HMOS technology. From 1979 to 1980, INTEL 8086/80186/80286 and Motorola 68000 and 68010 were developed. Speeds of those processors were four times better than the 2nd generation processors 4th Generation: From 1981 to 1995 this generation developed 32 bit microprocessors by using HCMOS fabrication. INTEL-80386 and Motorola’s 68020/68030 were the popular processors. 5th Generation: From 1995 to until now this generation has been bringing out high-performance and high-speed processors that make use of 64-bit processors. Such processors include Pentium, Celeron, Dual and Quad core processors. Coprocessor : A coprocessor is a special set of circuits in a microprocessor chip that is designed to manipulate numbers or perform some other specialized function more quickly than the basic microprocessor circuits could perform the same task. A coprocessor offloads specialized processing operations, thereby reducing the burden on the basic microprocessor circuitry and allowing it to work at optimum speed. Features of coprocessor : • • • • • • • Floating point arithmetic Graphics Signal processing String processing Encryption High performance I/O interfacing Advantages: • In the intelligent monitor interface, the coprocessors monitors the instruction stream by obtaining commands directly from the bus at the same as the main microprocessor. This has the obvious advantage of requiring no additional bicycle to pass the content of the instruction word to the processor. • The coprocessor helps to offload the process intensive freeing the memory for the processor to work with. • Coprocessor helps to work with high speed calculations to maintain the system performance. • Coprocessor increases the processing rate of the system. Disadvantages: • Each coprocessor in the system must duplicate the bus monitoring circuitry and instruction queue, tracking all branches, wait states, operand fetches and instruction fetches. • Once the main processor defects a coprocessor instruction, the main has to use bus bandwidth & timing to transmit the command to the appropriate processor. Physical Memory : The physical memory is the memory available in the system in the form of memory cards in various slots of system. The physical address space is associated with this type of memory. The Physical address space across the all the memory cards is handled by kernel VMM. Logical Memory : Logical memory enables the user to use large amount of memory to store data. It defines way to organize the physical memory such as RAM and cache. This enables the Operating System to arrange memory into a logical manner such as assigning a logical address. Logical address is a memory location and it is accessed by an application program. The system maps the logical address to real physical storage address. During the execution of the program, same logical address can be mapped to many different physical addresses. Real mode : Real mode is called 8086 mode because it is based on the 8086 and 8088 processor.The orginal IBM pc include an 8088 processor that could execute 16-bit instructions using 16-bit internal registers and could address only 1 MB of memory using 20 address lines.For example DOS and DOS software(Disk operating system) . All software running in real mode must use only 16-bit instructions and live within the 1MB memory architecture it supports. Software of this type is usually single-tasking that is only one program can run at a time. Protected mode : The 80286 introduced something into the X86 architecture called protected mode. Protected mode is an operational mode of the INTEL 80286-Compatible CPU It permits system software to use feature such as virtual memory paging and safe multi-tasking. There is no 1MB limit in protected mode. All of the major operating systems today use protected mode. Microprocessor: A microprocessor is an integrated circuit (IC) which incorporates core functions of a computer’s central processing unit (CPU). It is a programmable multipurpose silicon chip, clock driven, register based, accepts binary data as input and provides output after processing it as per the instructions stored in the memory. The very first microprocessor is considered to be intel 4004. It was released in 1971 & was a 4 bit processor. Fig: Block diagram of a microprocessor Microprocessor section : ALU Control Unit Register Arithmetic Logic Unit (ALU) : Arithmetic logic units (ALUs) in microprocessors allow computers to add, subtract, multiply, divide and perform other logical operations at high speeds. Thanks to advanced ALUs, modern microprocessors and GPUs (graphics processing units) are able to perform very complicated operations on large floating-point numbers. Control Unit : The control unit (CU) is a component of a computer's central processing unit (CPU) that directs the operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and output devices on how to respond to a program's instructions. Register : Register is a small high speed named memory. It consists of a set of binary storage cells called flip-flops with parallel reading or writing or both the facilities. The number of bits in a register depends on the type and address of the data. Register plays a major role in CPU operations. Microprocessor picks up data from one of the registers for doing arithmetic or logical operation. Once the operation is over, it stores the result in a register. Data are usually loaded from memory to register. Similarly the resultant data will be loaded from registers to memory. Types of microprocessor based on register : There are two types of microprocessor based on register. They are 1. 2. Accumulator based Register based Difference between Accumulator and register based Microprocessor Accumulator based MP Register based MP All operands are held in accumulator. Register is used to hold memory and data. Result after arithmetic and logic operation stored in the accumulator. Stored in the register. One address instructions are very predominate in this organization. The number size types of register vary from one mp to another. 8-bit mp is usually accumulator based. 16-bit and 32-bit usually register based. Lower speed. Higher speed. Data transfer are performed via accumulator. Via register. Are made by NMOS technique. Are Made by HMOS technique Example intel- 8085 Motorola-6800 Example intel-8086 80386 Motorola-68020,68030 Microcontroller : A microcontroller is a computer present in a single integrated circuit which is dedicated to perform one task and execute one specific application. It contains memory, programmable input/output peripherals as well a processor. Microcontrollers are mostly designed for embedded applications and are heavily used in automatically controlled electronic devices such as cellphones, cameras, microwave ovens, washing machines, etc. Block diagram of Microcontroller : Fig: Microcontroller Difference between Microcontroller and Microprocessor : Microcontroller Microprocessor CPU, RAM, ROM, I/O and timer are all on a single chip CPU is stand-alone, RAM, ROM, I/O, timer are separate fix amount of on-chip ROM, RAM, I/O ports designer can decide on the amount of ROM, RAM and I/O ports. Single-purpose general-purpose for applications in which cost, power and space are critical expensive Low processing power High processing power Low power consumption High power consumption Instruction sets focus on control and bit-level operations Instruction sets focus on processingintensive operations Typically 8/16 bit Typically 32/64 – bit Typically single-cycle/two-stage pipeline Typically deep pipeline (5-20 stages) Difference between Compiler and Assembler Compiler Assembler Generates the assembly language code or directly the executable code Generates the relocatable machine code Input is the Preprocessed source code Input is the Assembly language code Output is the assembly code generated by the compiler is a mnemonic version of machine code Output is The relocatable machine code generated by an assembler is represented by binary code compilers can be written in a way that whereas with assemblers the two are separates the "front-end" always the same. (corresponding to the programming language) and the "back-end" (corresponding to the computer architecture) The compilation phases are lexical analyzer, syntax analyzer, semantic analyzer, intermediate code generation, code optimization, code generation. Assembler makes two passes over the given input. Difference between 16 & 32 bit processor : 16 bit 32 bit A 16-bit register can store 216 different values. A 32-bit register can store 232 different values. If ALU is 16 bits , then it can perform If ALU is 32 bits , then it can perform operation on 16 bits data at a time. operation on 32 bits data at a time. If register is 16 bits , then it can store If register is 32 bits , then it can store 16 bits data at a time. 32 bits data at a time. If data bus is 16 bits , then it can pass If data bus is 32 bits , then it can pass 16 bits data at a time. 32 bits data at a time. If address bus is 16 bits , then it can pass 16 bits address of data at a time. If address bus is 32 bits , then it can pass 32 bits address of data at a time. Register in CPU : Register are used to quickly accept, store, and transfer data and instructions that are being used immediately by the CPU. These registers are the top of the memory hierarchy, and are the fastest way for the system to manipulate data. In a very simple microprocessor, it consists of a single memory location, usually called an accumulator. Registers are built from fast multiported memory cell. Types of register in CPU : Memory Address Register (MAR): This register holds the address of memory where CPU wants to read or write data. When CPU wants to store some data in the memory or reads the data from the memory, it places the address of the required memory location in the MAR. Memory Buffer Register (MBR): This register holds the contents of data or instruction read from, or written in memory. The contents of instruction placed in this register are transferred to the Instruction Register, while the contents of data are transferred to the accumulator or I/O register. I/O Address Register (I/O AR): I/O Address register is used to specify the address of a particular I/O device. I/O Buffer Register (I/O BR): I/O Buffer Register is used for exchanging data between the I/O module and the processor. Instruction Register (IR): Once an instruction is fetched from main memory, it is stored in the Instruction Register. The control unit takes instruction from this register, decodes and executes it by sending signals to the appropriate component of computer to carry out the task. Accumulator Register(AC): The accumulator register is located inside the ALU, It is used during arithmetic & logical operations of ALU. The control unit stores data values fetched from main memory in the accumulator for arithmetic or logical operation. This register holds the initial data to be operated upon, the intermediate results, and the final result of operation. The final result is transferred to main memory through MBR.