micro intro 1 lecture 1

Upload: blooms116

Post on 14-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Micro Intro 1 Lecture 1

    1/61

    Basic Processor Architecture andIntroduction to 8085

    1

    Ramesh BhakthavatchaluDepartment of ECE

    EC312 - Microprocessors

    [email protected]

  • 7/27/2019 Micro Intro 1 Lecture 1

    2/61

    WELCOME

    wORLD oF miCRoProCEssoRS

  • 7/27/2019 Micro Intro 1 Lecture 1

    3/61

    Foundation

    What is a Digital Signal? Basic Blocks of Digital

    Systems

    Decoder, Encoder, MUX,DEMUX, Flip Flop,

  • 7/27/2019 Micro Intro 1 Lecture 1

    4/61

    Foundation What is a Digital Signal?

    Add slides from Digital

  • 7/27/2019 Micro Intro 1 Lecture 1

    5/61

    Foundation Basic Blocks of Digital

    Systems

    Design

  • 7/27/2019 Micro Intro 1 Lecture 1

    6/61

    Foundation Decoder, Encoder, MUX,

    DEMUX, Flip Flop,

    Design

  • 7/27/2019 Micro Intro 1 Lecture 1

    7/61

    Computer A computer is a machine

    It processes information according to alist ofinstructions.

    form) and software (instructions).

    The information that is processed is

    called data.

  • 7/27/2019 Micro Intro 1 Lecture 1

    8/61

    Computer Parts & Peripherals

    CPU + Memory

  • 7/27/2019 Micro Intro 1 Lecture 1

    9/61

    Computer - PC

    The hardware has 4 parts.

    CPU Controller / Manager of the System

    Memory Stores instructions and data

    I/O Devices Keyboard, Monitor, etc.

    System bus Connects all above.

    The Software has 2 parts

    An operating system base (windows, etc)

    Application software (MS office, matlab,

    etc.)

  • 7/27/2019 Micro Intro 1 Lecture 1

    10/61

    Computer - Simple diagram

  • 7/27/2019 Micro Intro 1 Lecture 1

    11/61

    Computer

    (Memory)CPU = ALU + CU

    (Output)Monitor

    PROCESS

    RESULTS

    PROGRAMS/DATA

    Output devices can be monitor(CRT, LCD), projector, printer,etc.

    MICROPROCESSOR

    (Input)Keyboard

    COMMANDS

    Input devices can be KB, Mouse,scanner, barcode reader,sensors, etc

  • 7/27/2019 Micro Intro 1 Lecture 1

    12/61

    CPU

    The Central Processing Unit (CPU)

    executes the sequence of stored instructions

    called programs.

    The information to be processed is received

    from Input devices or Memory. The entire computer system operation

    including controlling all the devices and allcomputations involved are performed by

    the CPU.

  • 7/27/2019 Micro Intro 1 Lecture 1

    13/61

    Microprocessor (P)

    CPU has 3 units:- Arithmetic Logic Unit(ALU), Control Unit (CU) and Register Array.

    ALU CU REG.

    A CPU inside a single chip is called aMicroprocessor (uP).

    MICROPROCESSORARRAY

  • 7/27/2019 Micro Intro 1 Lecture 1

    14/61

    Microcomputer - PC

    Any computer which uses a

    microprocessor as its CPU

    (central processing unit) is

    called a microcomputer.

    All personal computers (PC)we see everyday are microcomputers.

    Alternately, we can say, any devicewhich works as CPU of a microcomputer

    is called a microprocessor.

  • 7/27/2019 Micro Intro 1 Lecture 1

    15/61

    Classification of Computers

    1.Large Computers

    Large, general purpose, multi user, multi

    tasking Perform complex scientific and engineering

    calculation, handling records for large

    v . Supercomputer, Mainframe

    2.Medium Size Computer (Mid range)

    Minicomputer Slower, smaller memory capacity than

    mainframe (ex: IBM AS 400 (1970s))

  • 7/27/2019 Micro Intro 1 Lecture 1

    16/61

    3. Microcomputer

    All Personal Computers (1970s ..)

    Work Stations

    Classification of Computers

    Single board

    Single chip microcomputer uC-Microcontrollers Embedded Systems

  • 7/27/2019 Micro Intro 1 Lecture 1

    17/61

    Microcomputer - PC

    Microcomputer is a microprocessor based

    system. It includes the following:

    - Microprocessor, Input/Output and Memory Components are connected through a

    communication path called a bus

    17

    How we can differentiate microcomputer anda microprocessor?

    uP is one component of the microcomputer

    The CPU functions of the microcomputerare performed by the uP

    The term peripherals is used for I/O devices.

  • 7/27/2019 Micro Intro 1 Lecture 1

    18/61

    uP based System Architecture

    (Microcomputer)

  • 7/27/2019 Micro Intro 1 Lecture 1

    19/61

    that reads binary instruction from a storagedevice called memory,

    accepts binary data as input and

    process data according to the instructions,and provides results as output.

    Microprocessor

    multipurpose, programmable, clock driven, register-based electronic device

    Manufactured by using LSI or VLSI technology Operation is similar to human brain

    19

  • 7/27/2019 Micro Intro 1 Lecture 1

    20/61

    How we can differentiate CPU & uP ?

    The ALU + CU of a microcomputer is

    called as CPU. (Central Processing Unit)

    CPU is implemented on one or more

    Microprocessor

    circuit boards to perform the computingfunctions

    When CPU is made on a single chip uP it is called as microprocessor

    20

  • 7/27/2019 Micro Intro 1 Lecture 1

    21/61

    ALU :- Perform various computing functions

    such as arithmetic operations (Addition &

    Subtraction) and logic operations(AND/OR/EXOR) etc.

    Re ister Arra :- Store data tem oraril durin

    Microprocessor

    execution of a program and are accessible tothe user through an instruction

    Control Unit :- Provides necessary timing and

    control signals to all the operations. Controls

    the flow of data b/w uP, memory and

    peripherals.21

  • 7/27/2019 Micro Intro 1 Lecture 1

    22/61

    The typical processor system consists of:

    CPU (central processing unit)

    ALU (arithmetic-logic unit) Control Logic Registers, etc

    Microprocessor

    22

    Input / Output interfaces

    Interconnections between these units:

    Address Bus Data Bus Control Bus

  • 7/27/2019 Micro Intro 1 Lecture 1

    23/61

    Communication path between the uP and

    peripherals

    Group of wires to carry bits

    System Bus

    All peripherals share the same bus

    uP communicates with only one

    peripheral at a time

    Timing is provided by the CU of the uP.

  • 7/27/2019 Micro Intro 1 Lecture 1

    24/61

    System Bus

    address bus: carries theaddress (or) points the locationwithin the memory that isein accesse

    data bus: carries the datavalue being communicated

    control bus: describes theaction on the address and

    data buses24

  • 7/27/2019 Micro Intro 1 Lecture 1

    25/61

    CPU-Core of the processor, whereinstructions are executed

    High-level language:

    = + Assembly language:add r1 r2 r3 Machine language:0001001010111010101

    25

  • 7/27/2019 Micro Intro 1 Lecture 1

    26/61

    Problems

    "There is only one group of

    people who don't haveproblems and they're all dead.

    Problems are a sign of life.So the more problems you

    have, the more alive you are."

    - Norman Vincent Peale26

  • 7/27/2019 Micro Intro 1 Lecture 1

    27/61

    Memory

    Place where instructions and data

    are stored

    Organized in arrays of locations

    addresses each storin one b te 8

    bits) in general

    A readoperation to a particular

    location (address) always returns thelast value stored in that location

    (address)27

  • 7/27/2019 Micro Intro 1 Lecture 1

    28/61

    Memory stores binary information as instruction and

    data in 2 sections

    Read only Memory (ROM) Program in ROM can only be read, not altered.

    Memory

    Read/Write Memory (RAM Random Access

    Mem.)

    User Memory

    Stores user program & data

    Information stored can be easily read and altered

  • 7/27/2019 Micro Intro 1 Lecture 1

    29/61

    Consider the monitor program, generally

    stored in ROM

    This program interprets the information

    entered throu h a ke board and

    Memory

    provides equivalent binary to the uP.

    The monitor programs monitors the

    Hex Key and stores data in R/W

    memory29

  • 7/27/2019 Micro Intro 1 Lecture 1

    30/61

    No of address lines and memory size

    Assume each location can store 1 byte

    2 power 3 = 8 locations

    2 ower 5 =32 locations

    Memory Structure

    2 power 10 = 1024 locations = 1 KB

    2 power 20 = 1024 KB = 1MB

    2 power 30 = 1024 MB = 1 GB

    2 power 40 = 1024 GB = 1 TB

  • 7/27/2019 Micro Intro 1 Lecture 1

    31/61

    Memory Architecture

    Von Neumann

    Architecture

    Embedded processors are constructed into 2 mainarchitecture

    instructions and

    data from same

    memory

    Limits operating

    bandwidth

  • 7/27/2019 Micro Intro 1 Lecture 1

    32/61

    Harvard Architecture

    Two separatememory spaces for

    Memory Architecture

    Increases throughput

    Different program

    and data bus widthsare possible

    Ex: PIC uController.

  • 7/27/2019 Micro Intro 1 Lecture 1

    33/61

    Input/Output :-

    Also known as peripherals

    Communicating with the outside world through I/O

    In uts devices :- ke board switches ADC

    I/O Device (Peripherals)

    Transfer binary information from outside world to

    the uP

    Output devices:- LED, LCD, CRT, Video screen(monitor), XY Plotter, Magnetic Tape, DAC

    Transfer data from uP to the outside world33

  • 7/27/2019 Micro Intro 1 Lecture 1

    34/61

    I/O Device (Peripherals)

    Enable uP system to interact with the world Device interface (a.k.a. controller or adapter)

    hardware connects actual device to bus

    like memory that can be accessed over thebus.

    Readsmay not return last value written

    Writesmay have side effects Enable some

    operations of peripherals.

  • 7/27/2019 Micro Intro 1 Lecture 1

    35/61

    Fetch, Decode, Execute

    uP fetches the first instruction from the memory

    Decodes it

    Execute the instruction

    Microprocessor - Working

    ses e sys em us o e c e ns ruc on an a a

    from the memory in the entire process

    Uses registers to store data temporarily

    Performs the computing function in the ALU

    Sends out the result in binary using the same bus lines

    to the o/p.

  • 7/27/2019 Micro Intro 1 Lecture 1

    36/61

    Word - No: of bits uP recognizes and process at a time

    Machine Language

    uP communicates and operates in 0s & 1s instruction in binary language

    Assembly language

    Some Definitions

    Programmer writes the program in English words Symbolic code for each instruction, called mnemonics

    Assembler

    Program that translates the mnemonics entered from

    the keyboard into the corresponding binary machine

    codes of the uP36

  • 7/27/2019 Micro Intro 1 Lecture 1

    37/61

    - CPU is stand-alone

    - RAM, ROM, I/O, timerare separate

    - Designer can decide on the

    - CPU, RAM, ROM, I/Oand timer are all on asingle chip

    - Fixed amount of on-chip

    MicroprocessorMicroprocessorMicroprocessorMicroprocessor v/sv/sv/sv/s MicrocontrollerMicrocontrollerMicrocontrollerMicrocontroller

    amount o ,

    and I/O ports.

    - Versatile Applications

    - General-purpose

    - Ex. 8085,8086 mp,Motorola 6800, Intels

    8086, etc.

    - For applications inwhich cost, power andspace are critical

    - Single-purpose- Ex. 8051, PIC mc,Motorola MCs, Phillips,etc.

  • 7/27/2019 Micro Intro 1 Lecture 1

    38/61

    8085 Microprocessor Architecture

    Now we will examine these components more closelyby using the Intel 8085 microprocessor architecture

    as an example:

    38

  • 7/27/2019 Micro Intro 1 Lecture 1

    39/61

    The 8085 Bus Structure

    The 8-bit 8085 CPU (or MPU Micro Processing Unit)communicates with the other units using a 16-bit address

    bus, an 8-bit data bus and a control bus.

    39

  • 7/27/2019 Micro Intro 1 Lecture 1

    40/61

    The 8085 Bus Structure

    Address Bus

    Consists of 16 address lines: A0 A15

    Operates in unidirectional mode: The addressbits are always sent from the MPU to peripheral

    devices, not reverse.

    16 address lines are capable of addressing atotal of 216 = 65,536 (64k) memory locations.

    Address locations: 0000 (hex) FFFF (hex)

  • 7/27/2019 Micro Intro 1 Lecture 1

    41/61

    The 8085 Bus Structure

    What is the last address of

    a 4K memory starting ataddress 2000H? (December

    Answer : 2FFFH

  • 7/27/2019 Micro Intro 1 Lecture 1

    42/61

    The 8085 Bus Structure

    What is the last address of

    a 3K memory starting ataddress 31FFH?

    Answer : _____H

  • 7/27/2019 Micro Intro 1 Lecture 1

    43/61

    The 8085 Bus Structure

    Data Bus

    Consists of 8 data lines: D0 D7

    Operates in bidirectional mode: The data bits aresent from the MPU to peripheral devices, as wellas from the eri heral devices to the MPU.

    43

    Data range: 00 (hex) FF (hex)

    Control Bus

    Consists of various lines carrying the controlsignals such as read / write enable, flag bits.

  • 7/27/2019 Micro Intro 1 Lecture 1

    44/61

    The 8085: CPU Internal Structure

    The internal architecture of the 8085 CPU iscapable of performing the following operations:

    Store 8-bit data (Registers, Accumulator)

    44

    Test for conditions (IF / THEN)

    Sequence the execution of instructions

    Store temporary data in RAM during execution

  • 7/27/2019 Micro Intro 1 Lecture 1

    45/61

  • 7/27/2019 Micro Intro 1 Lecture 1

    46/61

    The 8085: Registers

    46

  • 7/27/2019 Micro Intro 1 Lecture 1

    47/61

    The 8085: CPU Internal Structure

    Registers

    Six general purpose 8-bit registers: B, C, D, E, H, L

    They can also be combined as register pairs toperform 16-bit operations: BC, DE, HL

    47

    Registers are programmable (data load, move, etc.)

    Accumulator

    Single 8-bit register that is part of the ALU !

    Used for arithmetic / logic operations the result isalways stored in the accumulator.

  • 7/27/2019 Micro Intro 1 Lecture 1

    48/61

    The 8085: CPU Internal Structure

    Flag Bits

    Indicate the result of condition tests.

    Carry, Zero, Sign, Parity, etc.

    Conditional o erations IF / THEN are executed

    48

    based on the condition of these flag bits.Program Counter (PC)

    Contains the memory address (16 bits) of the

    instruction that will be executed in the next step.

    Stack Pointer (SP)

  • 7/27/2019 Micro Intro 1 Lecture 1

    49/61

    Example: Memory Read Operation

    49

  • 7/27/2019 Micro Intro 1 Lecture 1

    50/61

    Example: Instruction Fetch Operation

    All instructions (program steps) are stored in memory.

    To run a program, the individual instructions mustbe read from the memory in sequence, and executed.

    Program counter puts the 16-bit memory address of the

    50

    instruction on the address bus

    Control unit sends the Memory Read Enable signal toaccess the memory

    The 8-bit instruction stored in memory is placed on the data

    bus and transferred to the instruction decoder

    Instruction is decoded and executed

  • 7/27/2019 Micro Intro 1 Lecture 1

    51/61

    51

  • 7/27/2019 Micro Intro 1 Lecture 1

    52/61

    52

  • 7/27/2019 Micro Intro 1 Lecture 1

    53/61

    Example: Instruction Fetch Operation

    53

  • 7/27/2019 Micro Intro 1 Lecture 1

    54/61

    54

  • 7/27/2019 Micro Intro 1 Lecture 1

    55/61

    55

    Ready is an input signal

    E l I t ti F t h O ti

  • 7/27/2019 Micro Intro 1 Lecture 1

    56/61

    Example: Instruction Fetch Operation

    56

    8085 Functional Block Diagram

  • 7/27/2019 Micro Intro 1 Lecture 1

    57/61

    8085 Functional Block Diagram

    57

    Q & A

  • 7/27/2019 Micro Intro 1 Lecture 1

    58/61

    Q & A

    Teacher : Tell me 1000 words

    in English without using thealphabet a.

    Student: Zero, One, Two,

    Three,Four,...Nine Ninty

    Nine.58

  • 7/27/2019 Micro Intro 1 Lecture 1

    59/61

    DISCUSSION

  • 7/27/2019 Micro Intro 1 Lecture 1

    60/61

    Upcoming Topics

    Assembly language Instructions set of 8085

    Simple Programs

    60

  • 7/27/2019 Micro Intro 1 Lecture 1

    61/61

    THANK YOU