You are on page 1of 29

SYSTEM MICROPROCESSOR AND MICROCONTROLLER (E 4160)

NAME : PUAN NORMALA BINTI RAHMAT H/P NO : 013-4897745 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

3 CREDITS HOURS THEORY (2 HOURS) LABORATORY (2 HOURS) MODULE WEIGHTED: Quiz 6 (25%) Assignment 5 (30%) Practical Work 6 (30%) Test 3 (15%)

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

TOPIC 1
INTRODUCTION OF MICROPROCESSOR

TEACHING OBJECTIVE
EXPLAIN BASIC COMPONENTS OF A COMPUTER SYSTEM USING BLOCK DIAGRAMS:
a) b) c) d) e) CPU MAIN MEMORY SECONDARY MEMORY INPUT UNIT OUTPUT UNIT

EXPLAIN EVOLUTION OF MICROPROCESSOR:


a) 4-BYTE b) 8-BYTE c) 16-BYTE d) 32-BYTE e) 64-BYTE

BASIC COMPUTER SYSTEM


Every computer contains five essential elements or units: the arithmetic logic unit (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 or information 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

BASIC COMPUTER SYSTEM

Figure 1.1 : Block Diagram Of a Basic Computer System

BASIC COMPUTER SYSTEM


ARITHMETIC LOGIC UNIT (ALU) Arithmetic and logic operations are performed on data here. Type of operation is determined by signal from 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 to either: 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 the computer is to perform. the data that are to be operated on by the program. As storage for intermediate and final results of arithmetic operation (arrow 4). Operation of the memory (either Read or Write) is controlled by the control unit (arrow 6). Appropriate address code is fed by control unit (arrow 7) to determine the location in the memory. Data/information can be inputted into memory from: ALU (arrow 4). Input Unit (arrow 8). Control Unit (arrow 7). Data information can be fetched from memory 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 of control unit (arrow 6).

BASIC COMPUTER SYSTEM


INPUT UNIT Consists of all of the devices used to take information and data from the external environment to be inputted into the computer system. These inputted information/data is sent to either: Memory Unit (arrow 8) or ALU (arrow 3). The operation will be controlled by signal from Control Unit (arrow 10). The input is used to enter the program and data into the memory unit prior to starting the computer. Some of the common input devices : keyboards, toggle switches, modems, magnetic strip readers, magnetic disc units, magnetic tape units, and analog-todigital converters (ADCs). Example of application : when a key is pressed, the keyboard will send via input unit to the computer system. OUTPUT UNIT Consists of all the devices used to transfer information and data from computer system to the external environment. These outputted information/data is fetched 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 or tape units, video monitors, and digital-to analog converters (DAC s). Example of application: computer will send via output unit to printer for display.

BASIC COMPUTER SYSTEM


INTERFACING UNIT The devices that make up the input and outputs units are called peripherals because they are external to the rest of the computer. The most important aspect of peripherals involves interfacing. Computer interfacing is specifically defined as transmitting digital information between a computer and its peripherals in a compatible and synchronized way. CONTROL UNIT It directs the operation of all the other units by providing timing and control signals. The unit contain logic and timing circuits that generate the proper signals necessary to execute each instruction in a program. The control unit fetches instruction codes (in binary codes) from memory, the decodes the codes into instructions subsequently execute operations. CENTRAL PROCESSING UNIT (CPU) When both ALU and control units are combined, this unit is called Central Processing Unit (CPU). It is also called the brain of the computer system. 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.

MICROCOMPUTER SYSTEM
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 CPU of 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

Figure 1.2 : Basic Element Of a Microcomputer

MICROCOMPUTER SYSTEM
The main elements of the internal contructions and function are similar. However, the following outlines some important features in mode specific manner of a microcomputer system as a comparison to the basic computer system. CENTRAL PROCESSING UNIT (CPU) A silicon chip that works as heart of the computer. Receive instructions from memory to implement a task. MEMORY UNIT Store data and programs. Divided into two (2) main categories: a) PRIMARY MEMORY RAM (Random Access Memory) Data can be read and stored. However the stored data will disappear when the power supply is 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 supply is disconnected.

MICROCOMPUTER SYSTEM
b) SECONDARY MEMORY
RAM can only keep data in temporary basis. We need a permanent storage, which is also called secondary storage. Example of secondary storage are floppy disc and hard disk. Another type is CDROM (Compact-disc ROM), which can store up to 600 million characters and it is suitable for storing huge size of information.

INPUT AND OUTPUT UNIT (I/O UNIT)


I/O unit contains the interface circuits needed to allow the peripheral to properly communicate with the rest of the computer. In some cases these interface circuits are LSI chips designed by the MPU manufacturer to interface the MPU to a variety of I/O devices. In other cases the interface circuits may be as simple as buffer register. I/O unit allows user (external environment) to communicate with the computer system via interface unit that connected to the peripheral devices. The peripheral 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 WITH MICROPROCESSOR INTEL 8085

Figure 1.3 : Microcomputer System With Microprocessor Intel 8085

MICROCOMPUTER SYSTEM WITH MICROPROCESSOR MOTOROLA MC 68000

Figure 1.4 : Microcomputer System With Microprocessor Motorola MC68000

EVOLUTION OF MICROPROCESSOR

Table 1.1 : Evolution Of Microprocessor Between Intel and Motorola

EVOLUTION OF MICROPROCESSOR

Figure 1.5 : Evolution Of Microprocessor Between Intel and Motorola

ATRRIBUTE OF M 68000 FAMILY

Table 1.2: M68000 Family Summary

TEACHING OBJECTIVE
EXPLAIN THE MEANING OF THE TERMS OF:
a) b) c) d) NIBBLE BYTE WORD LONG WORD

EXPLAIN FETCHING AND EXECUTION CYCLES.

DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD.


The capacity of a microprocessor is normally referred to how many bits of data can be handled at one time, or what is the memory size (the amount of data cells of memory, determined by the amount of address lines/bits) accessible by the system. Thus it is important to have a great understanding about data size. Data size is a mean of measure to determine how much data can be stored in a single cell of memory. Imagine you are looking at the post boxes at a post office. Each box can store a certain amount of letter (assumed all letters have equal size). The size of each post box the greater numbers of letter can be stored. Similarly in memory storage, a memory storage can be distributed into many single cell with equal data size. In digital form, the smallest size of a single cell is called 1 bit. If a single cell can store 4 bit of data, the cell size is called Nibble. Subsequently 8 bits is called Byte, 16 bits is Word and 32 is Long Word. A single cell sized 1 bit can store either logic 0 or logic 1. In other word, two different situations 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 16 possible situations.


Data size : n = 4 Data capacity : 2n = 24 = 16 Range : 0 - 15

DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD

Figure 1.6 : Different Data Sizes

DATA SIZE : NIBBLE, BYTE, WORD, LONG WORD

Table 1.3: Types of data

OPERATION OF COMPUTER SYSTEM : FETCH AND EXECUTE CYCLES.


When a micro-computer system performs a task, there are basically two cycles to be implemented. Within the fetch cycle, there are two operations or sub-cycles, i.e. Read and Write.

Figure 1.7 : Fetch And Execute Cycle

OPERATION OF COMPUTER SYSTEM : FETCH AND EXECUTE CYCLES.


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.

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

OPERATION OF COMPUTER SYSTEM : FETCH AND EXECUTE CYCLES.


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.

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

HOW TO PROGRAM EXECUTE


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):

Instruction Register

Instruction s and Data

Instruction Decoder 4 2 8 1 Program Counter 3 Memory Address Decoder

Microprocessor

Memory

Figure 1.10: How CPU Fetch The Data From Memory.

HOW TO PROGRAM EXECUTE


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 data stored 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, the PC will be added and CPU was ready to execute the next instruction.

You might also like