topic 1 (e 4160) part a

Upload: alang2010

Post on 07-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    1/29

    SYSTEM MICROPROCESSOR AND

    MICROCONTROLLER

    (E 4160)

    NAME : PUAN NORMALA BINTI RAHMAT

    H/P NO : 013-4897745

    3 CREDITS HOURS

    THEORY (2 HOURS)

    LABORATORY (2 HOURS)

    MODULE WEIGHTED:

    Quiz 6 (25%)

    Assignment 5 (30%)

    Practical Work 6 (30%)

    Test 3 (15%)

    TOPICS IN THIS MODULE

    INTRODUCTION TO MICROPROCESSOR

    INTRODUCTION OF MICROCONTROLLER

    INTRODUCTION TO ASSEMBLY LANGUAGE

    (INSTRUCTION SET)

    MICROPROCESSOR/MICROCONTROLLER

    INSTRUCTION SET AND BUILDING A

    PROGRAM

    MEMORY SYSTEM

    INPUT OUTPUT AND INTERFACING

    16-BYTE AND 32-BYTE MICROPROCESSORS

    MICROCONTROLLER USAGE

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    2/29

    Practical Contribute Marks : 100

    Attendance : 10 Practical Works : 25

    Knowledge

    Technical Skills

    Professionalism & Etchics

    Social Skills

    Report :

    Formatting = 10

    Theory (Send through CIDOS) = 10

    Results (Outputs) = 25

    Discussion (based on results) = 10

    Conclusion = 10

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    3/29

    TOPIC 1

    INTRODUCTION OF MICROPROCESSOR

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    4/29

    TEACHING OBJECTIVE

    EXPLAIN BASIC COMPONENTS OF A COMPUTER SYSTEMUSING BLOCK DIAGRAMS:

    a) CPU

    b) MAIN MEMORY

    c) SECONDARY MEMORY

    d) INPUT UNIT

    e) OUTPUT UNIT

    EXPLAIN EVOLUTION OF MICROPROCESSOR:

    a) 4-BYTEb) 8-BYTE

    c) 16-BYTE

    d) 32-BYTE

    e) 64-BYTE

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    5/29

    BASIC COMPUTER SYSTEM

    Every computer contains five essential

    elements or units: the arithmetic logicunit (ALU), the memory unit, the input

    unit and the output unit.

    The arrows in this diagram indicate the

    direction in which data, information, or

    control signals are following.

    2 different size arrows are used:

    the larger arrows represent data orinformation that actually consists

    of a relatively large number of

    parallel lines

    smaller arrows represent control

    signals that are normally only one

    or a few lines

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    6/29

    BASIC COMPUTER SYSTEM

    Figure 1.1 : Block Diagram Of a Basic Computer System

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    7/29

    ARITHMETIC LOGIC UNIT (ALU)

    Arithmetic and logic operations areperformed on data here.

    Type of operation is determined by signalfrom control units (arrow 1).

    The input data can come from either:

    memory unit (arrow 2) or

    input unit (arrow 3)

    Result of operation is transferred toeither:

    memory unit for storage (arrow 4) or

    output unit (arrow 5)

    MEMORY UNIT

    Memory unit stores group of binary digits(word) that can represent:

    instructions (program) that thecomputer is to perform.

    the data that are to be operated onby the program.

    As storage for intermediate and finalresults of arithmetic operation (arrow 4).

    Operation of the memory (either Read orWrite) is controlled by the control unit(arrow 6).

    Appropriate address code is fed by controlunit (arrow 7) to determine the location inthe memory.

    Data/information can be inputted intomemory from:

    ALU (arrow 4).

    Input Unit (arrow 8).

    Control Unit (arrow 7).

    Data information can be fetched frommemory and sent to:

    ALU (arrow 2).

    Output Unit (arrow 9).

    Control Unit (arrow 11). The operation (either Read or Write) of

    the memory is controlled by signal ofcontrol unit (arrow 6).

    BASIC COMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    8/29

    INPUT UNIT

    Consists of all of the devices used to takeinformation and data from the externalenvironment to be inputted into thecomputer system.

    These inputted information/data is sent toeither:

    Memory Unit (arrow 8) or

    ALU (arrow 3).

    The operation will be controlled by signalfrom Control Unit (arrow 10).

    The input is used to enter the programand data into the memory unit prior tostarting the computer.

    Some of the common input devices :keyboards, toggle switches, modems,

    magnetic strip readers, magnetic discunits, magnetic tape units, and analog-to-digital converters (ADCs).

    Example of application : when a key ispressed, the keyboard will send via inputunit to the computer system.

    OUTPUT UNIT

    Consists of all the devices used to transferinformation and data from computersystem to the external environment.

    These outputted information/data isfetched from either:

    Memory Unit (arrow 9) or

    ALU (arrow 5).

    The operation will be controlled by signal

    from control unit (arrow 12). Some of the common output devices: LED

    readouts, indicator lights, printers, disk ortape units, video monitors, and digital-toanalog converters (DAC s).

    Example of application: computer willsend via output unit to printer for display.

    BASIC COMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    9/29

    INTERFACING UNIT

    The devices that make up the input and

    outputs units are called peripheralsbecause they are external to the rest ofthe computer.

    The most important aspect of peripheralsinvolves interfacing.

    Computer interfacing is specificallydefined as transmitting digital informationbetween a computer and its peripherals ina compatible and synchronized way.

    CONTROL UNIT

    It directs the operation of all the otherunits by providing timing and controlsignals.

    The unit contain logic and timing circuits

    that generate the proper signals necessaryto execute each instruction in a program.

    The control unit fetches instruction codes(in binary codes) from memory, thedecodes the codes into instructionssubsequently execute operations.

    CENTRAL PROCESSING UNIT (CPU)

    When both ALU and control units are

    combined, this unit is called CentralProcessing Unit (CPU).

    It is also called the brain of the computersystem.

    In a microcomputer the CPU is usuallyimplemented on a single chip, which is themicroprocessor.

    Some system may need several additionalchips to be connected to a microprocessorchip to make the CPU.

    BASIC COMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    10/29

    In a microcomputer the CPU is usually

    implemented on a single chip, which is the

    microprocessor.

    Some system may need several additional

    chips to be connected to a microprocessor

    chip to make the CPU.

    It is common to refer to the

    microprocessor as the MPU

    (microprocessor unit), since it is the CPUof the microcomputer.

    The basic interconnection of these units is

    shown in Figure 1.2. It is noted that the

    microcomputer preserves the

    characteristic of a basic computer system,

    but with smaller capabilities.

    A simple comparison, mainframe is a

    computer system, where as personal

    computer is a microcomputer.

    However, the advancement in

    microprocessor technology has

    increased the capabilities of

    microcomputer

    MICROCOMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    11/29

    Figure 1.2 : Basic Element Of a Microcomputer

    MICROCOMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    12/29

    The main elements of the internalcontructions and function are

    similar. However, the following outlines

    some important features in modespecific manner of amicrocomputer system as acomparison to the basic

    computer system.

    CENTRAL PROCESSING UNIT (CPU)

    A silicon chip that works asheart of the computer.

    Receive instructions from

    memory to implement a task.

    MEMORY UNIT

    Store data and programs.

    Divided into two (2) maincategories:

    a) PRIMARY MEMORY

    RAM (Random Access Memory)

    Data can be read and stored. However the stored data will

    disappear when the power supplyis disconnected.

    ROM (Read Only Memory)

    Data can only be read but cannot

    be written into it. The stored data will not

    disappear when the power supplyis disconnected.

    MICROCOMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    13/29

    b) SECONDARY MEMORY

    RAM can only keep data in temporarybasis.

    We need a permanent storage, which isalso called secondary storage.

    Example of secondary storage are floppydisc and hard disk. Another type isCDROM (Compact-disc ROM), which canstore up to 600 million characters and it is

    suitable for storing huge size ofinformation.

    INPUT AND OUTPUT UNIT (I/O UNIT)

    I/O unit contains the interface circuitsneeded to allow the peripheral toproperly communicate with the rest of thecomputer.

    In some cases these interface circuits areLSI chips designed by the MPUmanufacturer to interface the MPU to avariety of I/O devices. In other cases the

    interface circuits may be as simple asbuffer register.

    I/O unit allows user (externalenvironment) to communicate with thecomputer system via interface unit thatconnected to the peripheral devices. Theperipheral devices such as keyboard,printer, sensor that measuring vehicle

    speed etc. The port size of I/O unit is equivalent to

    the data bus size of the microprocessor.

    MICROCOMPUTER SYSTEM

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    14/29

    MICROCOMPUTER SYSTEM WITH MICROPROCESSOR

    INTEL 8085

    Figure 1.3 : Microcomputer System With Microprocessor Intel 8085

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    15/29

    MICROCOMPUTER SYSTEM WITH MICROPROCESSOR

    MOTOROLA MC 68000

    Figure 1.4 : Microcomputer System With Microprocessor Motorola MC68000

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    16/29

    Table 1.1 : Evolution Of Microprocessor Between Intel and Motorola

    EVOLUTION OF MICROPROCESSOR

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    17/29

    Figure 1.5 : Evolution Of Microprocessor Between Intel and Motorola

    EVOLUTION OF MICROPROCESSOR

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    18/29

    Table 1.2: M68000 Family Summary

    ATRRIBUTE OF M 68000 FAMILY

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    19/29

    TEACHING OBJECTIVE

    EXPLAIN THE MEANING OF THE TERMS OF:

    a) NIBBLE

    b) BYTE

    c) WORD

    d) LONG WORD

    EXPLAIN FETCHING AND EXECUTION CYCLES.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    20/29

    The capacity of a microprocessoris normally

    referred to how many bits of data can behandled at one time, or what is the memorysize (the amount of data cells of memory,determined by the amount of addresslines/bits) accessible by the system. Thus itis important to have a great understandingabout data size.

    Data size is a mean of measure to determine

    how much data can be stored in a single cellof memory. Imagine you are looking at thepost boxes at a post office. Each box canstore a certain amount of letter (assumed allletters have equal size). The size of each postbox the greater numbers of letter can bestored. Similarly in memory storage, amemory storage can be distributed intomany single cell with equal data size. In

    digital form, the smallest size of a single cellis called 1 bit.

    If a single cell can store 4 bit of data, the cellsize is called Nibble. Subsequently 8 bits iscalled Byte, 16 bits is Word and 32 is LongWord.

    A single cell sized 1 bit can store either logic0 or logic 1. In other word, two differentsituations can be stored or represented.Thus the range of data is 0-1.

    Data size : n = 1

    Data capacity : 2n = 21 = 2

    Range : 0 - 1

    A single cell sized 4 bit (Nibble) can store 16possible situations.

    Data size : n = 4Data capacity : 2n = 24 = 16

    Range : 0 - 15

    DATA SIZE : NIBBLE, BYTE, WORD, LONG

    WORD.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    21/29

    Figure 1.6 : Different Data Sizes

    DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    22/29

    Table 1.3: Types of data

    DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    23/29

    When a micro-computer systemperforms a task, there are

    basically two cycles to be

    implemented.

    Within the fetch cycle, there aretwo operations or sub-cycles, i.e.

    Read and Write.

    Figure 1.7 : Fetch And Execute Cycle

    OPERATION OF COMPUTER SYSTEM : FETCH AND

    EXECUTE CYCLES.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    24/29

    READ CYCLE

    CPU sends a signal via control bus. If the bus is busy, CPU is put on Wait state.

    If the bus is free, CPU will place instruction address on the address bus.

    This address will be decoded or translated by the circuitry in the memory or I/O

    interface.

    Finally the data at the specific address is obtained and is placed on the data bus.

    OPERATION OF COMPUTER SYSTEM : FETCH AND

    EXECUTE CYCLES.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    25/29

    OPERATION OF COMPUTER SYSTEM : FETCH AND

    EXECUTE CYCLES.

    Figure 1.8 : Shows The Whole Read Cycle In The Graphical Form

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    26/29

    WRITE CYCLE

    Write cycle enables CPU sends data to the memory or I/O devices.

    CPU will send a signal (request to write) to the control bus.

    If the data bus is free, the data is placed on the data bus, whereas the location

    address will be placed on the address bus.

    CPU will then send the data to the destination with respect to the address.

    OPERATION OF COMPUTER SYSTEM : FETCH AND

    EXECUTE CYCLES.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    27/29

    OPERATION OF COMPUTER SYSTEM : FETCH AND

    EXECUTE CYCLES.

    Figure 1.9 : Shows The Whole Write Cycle In The Graphical Form

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    28/29

    Before a computer system is switched

    ON, CPU and RAM store no data.Contrary, ROM permenantly stores a

    short program for initializing the

    computer system.

    When the computer is switched ON,

    CPU will read data/program that stored

    in ROM, two tasks is performed.

    First, devices that are readily

    connected to the computer will be

    reset to a standby mode.

    Second, system programs from

    permenant storage will be

    transferred to the RAM.

    System program will display instructions

    to guide the user to proceed

    accordingly.

    Then this process will be happen

    automatically (see Figure 1.10):

    HOW TO PROGRAM EXECUTE

    InstructionRegister

    Instruction

    Decoder

    ProgramCounter

    Instructions and Data

    MemoryAddressDecoder

    56

    7

    8

    1

    2 3

    4

    Microprocessor Memory

    Figure 1.10: How CPU Fetch The Data From Memory.

  • 8/4/2019 TOPIC 1 (E 4160) PART A

    29/29

    a) Address Memory for the first instruction

    will be put on the Program Counter (PC).b) Then PC will put the address memory to

    the address bus.

    c) Then address memory will send to the

    memory.

    d) This address memory will be recognize

    after that all the instruction word or datastored in this address memory will be

    transferred to the CPU by data bus.

    e) Before CPU processed the information,

    the according instruction will be storage

    in the Instruction Register (IR) while the

    data will be keep in the Accumulator.

    f) Then CPU will be decoded the instruction

    word from binary code to operation form.The decoded process is done by

    Instruction Decoder (ID).

    g) After CPU understand what will be done

    or execute, example addision operation,

    then ALU will be involved.

    h) While the first instruction completed, thePC will be added and CPU was ready to

    execute the next instruction.

    HOW TO PROGRAM EXECUTE