Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.

Slides:



Advertisements
Similar presentations
Intel 8086.
Advertisements

8086 Ahad.
The CPU The Central Presentation Unit What is the CPU?
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Registers of the 8086/ /2002 JNM.
There are two types of addressing schemes:
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Computer Organization and Architecture
Parul Polytechnic Institute
Introduction to 8086 Microprocessor
Microprocessor Fundamentals Week 5 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
CHAPTER 5 INTRODUCTION TO ASSEMBLY LANGUAGE 5.1 Introduction 5.2 The Computer Organization - Intel PC 5.3 Instruction Format 5.4 Addressing Mode 5.5 DEBUG.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
Vacuum tubes Transistor 1948 –Smaller, Cheaper, Less heat dissipation, Made from Silicon (Sand) –Invented at Bell Labs –Shockley, Brittain, Bardeen ICs.
80x86 Processor Architecture
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
Basic Operational Concepts of a Computer
An Introduction to 8086 Microprocessor.
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
8086 Internal Architecture
Block diagram of 8086.
Intel 8086 (8088) Microprocessor Structure
INTRODUCTION TO INTEL X-86 FAMILY
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Internal Programming Architecture or Model
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
Intel 8086 MICROPROCESSOR ARCHITECTURE
BITS Pilani Pilani Campus Pawan Sharma Lecture / ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
UNIT Architecture M.Brindha AP/EIE
Introduction to 8086 Microprocessor
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
Intel 8086 MICROPROCESSOR Architecture.
ADDRESSING MODES.
University of Gujrat Department of Computer Science
Intel 8088 (8086) Microprocessor Structure
Computer Architecture
..
Microcomputer & Interfacing Lecture 1
Symbolic Instruction and Addressing
University of Gujrat Department of Computer Science
CS149D Elements of Computer Science
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
8086 Ahad.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
CS 301 Fall 2002 Computer Organization
Symbolic Instruction and Addressing
Lecture 06 Programming language.
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
Basic components Instruction processing
Intel 8086.
Microprocessor Lecture 7 (8086 Registers).
Sec (2.3) Program Execution.
Presentation transcript:

Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008

© Mike Stacey 2007 Stored Program Concept (p1 & last week) Program stored in memory so that it can be changed Previously, program was part of the control unit and required “rewiring” in order to change it Who thought of this idea? Machine Language  μP recognises certain bit patterns representing instructions  The bit patterns are called machine language

© Mike Stacey 2007 Op-codes and Operands (p1) Machine language consists of 2 parts:  Op-code: first part of the instruction tells the μP what kind of basic operation will be carried out. Example: STORE, SHIFT, JUMP, ADD  Operand: The following bits provide information such as the data that is to be operated on and the place it will be stored MOV AX, BX  Moves (copies) data from register BX to AX

© Mike Stacey 2007 Machine Cycle (p1) 1.Fetch Instruction from memory 2.Decode Decode instruction – work out what to do with it by interpreting the op-code and operand fields 3.Execute Execute it – run it

© Mike Stacey 2007 Data, Addresses and Registers in the Z80 The Z80 uP uses 8 bit bytes for data and accesses this data using 16 bit addresses.  How many separate address locations are there? Registers inside the uP are used for storage of numbers  There are 8 bit registers for storing numbers the program is operating on and also 16 bit registers for storing addresses of data See page 1 for list of registers

© Mike Stacey 2007 Machine Cycle, how? (no ref) In general:  Within the control unit there are 2 special purpose registers: the program counter (instruction pointer IP) and the instruction register (IR).  Program counter: contains the address of the next instruction – keeps track of what step the execution is at  Instruction register holds the current instruction being executed

© Mike Stacey 2007 Machine cycle, how? (no ref) Control unit repeats the machine cycle, fetch, decode, execute Fetch: control unit knows where the next instruction is because its address is in the program counter. Control unit retrieves instruction from memory – places into instruction register, then increments the program counter…why?

© Mike Stacey 2007 Machine cycle, how? (no ref) Decode: control unit now decodes instruction which involves breaking the instruction into pieces. Execute: control unit then executes instruction by activating the appropriate circuitry for the task at hand. Example: the instruction might be an ADD – it would then invoke circuitry inside the ALU. Next step?

© Mike Stacey 2007 μP Components (P1,2,3…) Registers  Temporary storage of data or program General purpose: storage of data for ALU input and output. Control unit transfers data from memory to these registers, informs ALU where the data is and activates circuitry inside ALU Special purpose: such as program counters and instruction register  Registers are the fastest type of memory

© Mike Stacey 2007 Many steps for simple instructions (no ref) Instruction: Add 2 values 1.Get one of the values from memory and store in a register 2.Get the other value from memory and store in another register 3.Activate addition circuits in ALU with registers in steps 1 and 2 as inputs and another register to hold the output 4.Store result in memory (transfer from output register to memory) 5.Stop

© Mike Stacey 2007 Memory Hierarchy (no refs) Disk Main Memory (RAM) Cache µP Registers Data immediately applicable to operation at hand Data required in near future Data required in VERY near future Data not required in near future

© Mike Stacey µP (p3-5) Contains 2 primary register groups 1.Bus Interface Unit (BIU): calculates addresses and handles all transfers of data and addresses for the Execution Unit. All information to/from the address and data busses takes place via the BIU. 2.Execution Unit (EU): Execution Unit receives program instruction codes and data from BIU (via instruction queue), decodes and executes these instructions and stores results in the general registers.

© Mike Stacey 2007 BIU (p3-4) Fetches instructions from memory and places into FIFO queue registers from where the EU retrieves them Can fetch up to 6 ahead of time Can be fetching instructions at the same time as EU is executing them – called pipelining Each program contains addresses for code, data, extra and stack memory areas BIU contains segment registers for memory addressing  Code segment (CS): program code  Data segment (DS): program data  Extra segment (ES): string operations  Stack segment (SS): stack operations (a stack is a type of data structure) Also contains the instruction pointer (IP) or program counter (PC) register

© Mike Stacey μP (p3)

© Mike Stacey 2007 Example MOV, AX, [2456]: moves data from address 2456 into register AX. However 2456 is not the physical address of the data.  BIU grabs the instruction and calculates the physical address of the data that is to be moved  Supplies the physical address of the data to the EU so the EU knows where to get the data from (in RAM) Look at the diagram on page 3. The adder and the segment registers are used for the calculation of the physical address.

© Mike Stacey 2007 Segment Registers and Addressing Memory (p3-4) – Memory Segmentation Code, Data, Stack, Extra segments Each segment contains different types of data or instructions 8086 has a 20 bit internal address bus so it can address 2 20 (1MB) locations (each containing 1 byte) The CS, DS, SS and ES registers contain the base addresses of each 64KB segment If DS register contains 2456 then 2456 is shifted left by 4 bits to give – this is the start (base) address for the data segment

© Mike Stacey 2007 Addressing Memory (p3 & p11) Code Stack Data Extra 64kB Base address: 490B0 Physical address: 4B506 Effective add.: CS SS DS:490B ES MEMORY SEGMENT REGISTERS Memory divided into logical areas needed for program addressing Each segment holds 64kB Base address: XXXX0

© Mike Stacey 2007 Effective address and physical address (p4) Effective address: offset from base address Base address: start address for segment Physical address: actual physical address in memory Data segment address: 490B Data segment base address: 490B0 Effective address (EA): Physical address: 4B506 See example p4. Also see example instruction: MOV,AX,[2456]

© Mike Stacey 2007 example.com Identify the registers, code segment base address and effective address of each instruction byte.

© Mike Stacey 2007 Instruction Pointer Register (p4) The Instruction Pointer register holds the 16-bit address of the next instruction byte, relative to the base address contained in the Code Segment register CS. The logical address is written as CS:IP. For example if CS = 034F and IP = 001C then the physical address of the next instruction to be fetched from memory is 034F C = 0350C so the logical address would be written as 034F:001C

© Mike Stacey 2007 The Execution Unit (p4-5) Contains:  ALU  Control Unit (CU)  Flag Register: see p5 table, status and control flags  General Purpose Registers AX, BX, CX, DX: each can be 1 x 16 bit or 2 x 8 bit regs. Example: AL and AH – low and high bytes for AX Stack Pointer Registers BP and SP: contain offset addresses which are used in conjunction with SS register to access data on the stack, see example p5.  Index Registers

© Mike Stacey 2007 Review Questions & Prac. Do questions 1 – 7. Complete debug pracs 1 & 2 then begin debug prac 3. Note:  Format your text file prac results carefully according to guidelines provided by the teacher  Organise your work logically into weekly directories on your flash disk  Back up your work at home onto hard disk or another flash disk! This is your own responsibility. If the work is lost, it hasn’t been done.