Chapter 2 ECE 382-Microprocessor

download Chapter 2 ECE 382-Microprocessor

of 6

Transcript of Chapter 2 ECE 382-Microprocessor

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    1/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    Chapter 2 Microprocessor, Memory and I/O

    OVERVIEW

    Three major differences between microprocessors.

    - The length of the microprocessors data word.- The size of the memory which the microprocessor can directly address.- The speed which the microprocessor can execute instructions.

    Some of additional architectural differences are:

    - The number of register available to the programmer.- The different types of register available to the programmer.

    - The different types of instructions available to the programmer.- The different types of memory addressing modes available to the programmer.

    - The different types of support circuits available to the system designer.- Compatibility with readily available development, system and applications software.

    - Compatibility with hardware development systems.

    These differences make some microprocessors better for some applications and some othermicroprocessors better for other applications. Some microprocessors are better because

    they appeal to the user more than another which might work equally well in the same

    situation.

    2.1 WORD LENGTHS

    The microprocessor started as a 4-bit device. It has progressed to an 8 bit, a 16 bit, a 32 bit

    and now a 64 bit device. A microprocessor with a longer word length will solve moreproblems faster. Therefore, a longer word length should give a better solution to all

    problems. However, the consideration of product cost is important. The real performanceissue is cost, not horse power. In almost every case, the longer the data word, the more the

    microprocessor and its support components cost.

    2.1.1 The 4 bit microprocessor applicationsThe 4 bit microprocessors are very good for low-cost and simple applications.

    Students will find the 4 bit microprocessor in- Toy : robots, remote-controlled cars, hand held games

    - Calculators : financial, scientific, database- Power tool controllers : speed controls, sequencers, measurement devices

    - Simple : microwave ovens, telephone dialers, smart thermostats, shortwavescanners, TV remote controls

    - Computer peripherals : keyboard scanners, simple printers, clocks

    2.1.2 The 8 bit microprocessor applications

    - Toys : video games, programmable robots- Complex intelligent product controllers : VCR control and programming,

    security systems, lighting system controllers

    - Computer peripherals: video display, higher-speed printers. Modems, plotters,communication controllers.

    - Industrial controllers : robotics, processing control, sequence control, machine

    tool control- Instruments : logic analyzers, communication analyzers, disk drive testers, digital

    oscilloscopes, smart voltmeters

    1

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    2/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    The 16 bit, 32 bit and 64 bit microprocessors are frequency found in graphic oriented CADand CAM systems. The 32 bit and 64 bit microprocessors feature very fast operation,

    extreme computing power, and megabytes, or even gigabytes, of main memory-addressingspace.

    2.2 ADDRESSABLE MEMORY

    The amount of memory addressing capability needed depends on the application you have.Usually, the larger the microprocessors data word, the larger the main memory space it can

    address. In a simple microprocessor-base system, the program steps are stored in ROM and

    the variable data is stored in RAM.

    3.2 GENERALIZED MICROPROCESSOR UNIT (MPU)

    The microprocessor Unit (MPU) is a programmable logic device with a designed set ofinstructions.

    Review: CPU reads/fetches each instruction (one at a time), from memory andperforms data manipulation specified by the instruction. It also reads data from input

    devices, and writes (or sends) data to output devices.

    There are two categories of MPU communication process and related operations.- MPU (or program) initiated operations- Peripheral (or externally) initiated operations

    2.3.1 MPU operation

    - A group of logic circuits

    - A set of signals to transfer information- Control signals for timing

    - Clock circuitry

    Microprocessor Buses and Signals

    Bus = a group of signal lines activated together to provide information

    The MPU-initiated operations1. Memory read : Reads data (binary information) from memory

    2. Memory write : Writes data into memory3. I/O Read : Accepts data from input devices

    4. I/O Write : Send data to output devices

    How does the MPU identify a memory register or an I/O device?- The MPU identifies each memory register or I/O by a binary number called an address.

    How does the MPU inform the peripherals when it is ready to read or write data?- It does by sending out appropriate timing signals called signals before it transfer data.

    The steps performing MPU operations.1. Identify the memory location or the peripheral with its address.2. Provide timing or synchronization signal.

    3. Transfer binary data.

    To perform the operations described above, the MPU requires three set of communicationbuses lines:

    1. Address bus: identify the memory location

    2

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    3/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    2. Data bus: transfer data3. Control lines: timing signals

    Picture 2.1 : MPU operation

    Address bus

    How large is this address?- It depends upon the internal design of microprocessor and available pins on a chip (8,

    16, 20, or more bits).

    Data busThese lines are used to transfer data are bidirectional. The size of the data bus

    determines how large a binary number can be transferred and processed at a time. The8085 and the Z80 have eight data lines and called 8 bit microprocessors. On the other

    hand, the 8086, the 80286, and the Z8000 have 16 data lines and are called 16 bit

    microprocessors.

    Control signals

    These are individual signal lines generated by the MPU to indicate its operations.The MPU generates a specific signal for each of its four operations

    - Memory Read

    3

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    4/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    - Memory Write- I/O Read

    - I/O Write

    These are timing signals that are used to enable, or activate, peripherals.

    2.3.2 External Request Signals

    - Reset: Start again from the beginning.- Interrupt: Stop the ongoing process temporarily; do something now and then go

    back to the original process.- Wait: When memory response time is too slow to respond to the speed of the MPU,

    this signal can be used to delay the MPU operations.- Bus request: When the MPU operations are too slow compared to the speed of a

    peripheral, the peripheral can request the use of the buses.

    Request Acknowledge SignalsThe MPU needs to inform the external peripheral that it is ready to accept the request.

    To indicate its response to some of these external requests, the MPU needs additionalsignals.

    2.3.3 Clock Signals and Power

    Clock

    Power Ground

    The timing is very critical in all its operations. Therefore, the MPU needs circuits thatgenerate clock signals.

    2.3.4 Microprocessor Internal Architecture

    When the microprocessor executes instructions, it does a continuous sequence of fetch,

    decode, and execute operations.

    Fetching an instructionThe microprocessor places a memory address on the address bus and reads binary

    information using the data bus. Therefore, it needs a register that can hold memoryaddresses and increment these addresses after the fetching is complete, a sort of memory

    pointer.

    Decoding an instructionOnce an instruction byte is fetched, it needs to be decoded to answer the following:

    - Is it a complete instruction? If not, how many more bytes need to be fetched?- What type of operation is required and on what data?

    Executing an instruction

    The type of data manipulation the MPU can perform depends on its internal microprograms, that is, on its instruction set. These operations can be classified as data copy

    (transfer), arithmetic/logic operations, and decision making. For example, to subtract twonumbers, both numbers must be loaded into registers. After the subtraction, it is necessary

    to indicate whether the result is positive, negative, or zero. This can be indicated by settingor resetting flip-flops called flags.

    4

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    5/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    2.3.5 Review of Important Concepts

    Picture 2.2 : MPU Internal Structure

    5

  • 7/30/2019 Chapter 2 ECE 382-Microprocessor

    6/6

    ECE 382-MICROPROCESSOR SYSTEMS & ASSEMBLY LANGUAGE CHAPTER TWO

    To communicate with memory and I/O devices, the MPU should have the following sixgroups of signals:

    1. Address bus to send the address of a memory register or an I/O.2. Data bus to transfer data between the MPU.

    3. Control signals to identify its operations and provide timing.4. External Request signal lines to interrupt the MPU operations.

    5. Request Acknowledge signals to respond to the requests by peripherals.6. Clock signals to provide timing and power to operate circuits.

    To process internally, the MPU should include the following:

    1. Instruction Decoder to decode the fetched binary information.

    2. Registers to store binary data.3. Registers as memory pointers for addressing memory registers.

    4. ALU to perform arithmetic and logic operations.

    5. Flags (flip-flops) to indicate data conditions for decision making.

    6