Вы находитесь на странице: 1из 46

68000 Microprocessor 68000

Microprocessor SEE3223
Semester II, Session 2009/2010 14, December 2009 - 25, April 2009

Kamal Khalil
Room: P04-125 Ext: 35277 HP: 0197123004 Email: kamal@fke.utm.my, kamalkhalil2008@gmail.com

Faculty of Electrical Engineering

Universiti Teknologi Malaysia

Kamal Khalil

Microprocessor SEE3223
Aim

68000 Microprocessor

68000

This subject introduces the principle and the usage of microprocessor. Few topics that are emphasized are processor architecture, assembly language and basic interfacing in a microprocessor-based systems.

Learning Outcomes
At the end of this course, students will be able to : Describe and differentiate all the component of microprocessorbased systems. Analyze and design 68k assembly language programs. Analyze and design 68k microprocessor systems. Work with IDE and communicate effectively in a team to solve complex 68k design problems.

Kamal Khalil

1-2

SEE3223 Microprocessor Systems

68000 Microprocessor

68000

Whats in this course:


Assembly language programming Microprocessor concepts Hardware interfacing Number representation, coding, registers, state machines Realization of simple logic circuits Integrated circuit technologies Designing with MSI components Flip-Flops Counters and sequential MSI components Register transfer logic

Pre-Requisites

Kamal Khalil

1-3

Course Policy

68000 Microprocessor

68000

Attendance is compulsory. You are responsible for whatever is taught in the lecture. If you miss a class, it is your responsibility to find out about assignment, quizzes and exam from elearning. Punctuality is expected. Makeup quizzes will not be given except in the case of actual emergencies with written evidence. You are encouraged to collaborate (not copy) on assignment problems with your "study buddies.

Kamal Khalil

1-4

Grading Policy
Assessment Breakdown:
6

68000 Microprocessor

68000

Quizzes (best 6-out-of-8) x 8% + homework (8%) = 40% 1 Group Assignment = 10% Final = 50%

Kamal Khalil

1-5

Material

68000 Microprocessor

68000

Lecture notes Will be posted


Textbooks Antonakos, J.L. (2004), The 68000 Microprocessor: Hardware and Software Principles and Applications, 5th Ed., Prentice Hall. Muhammad Munim (2000), Modul Pengajaran Mikropemproses 68000, UTM.
1-6

Kamal Khalil

Module 1
Microprocessor-Based Systems

Microprocessor-Based Systems

68000 Microprocessor

68000

Aims

To review the main elements of a microprocessor system.

Intended Learning Outcomes

At the end of this module, students should be able to:

Define and explain important terms associated with both hardware and software elements of a microprocessor system Tell the difference between general purpose computing and embedded computing List down the major components inside a computer & processor Tell the difference between computer, processor, microprocessor and microcontroller Explain instruction execution cycles of a generic microprocessor

Kamal Khalil

1-8

What is Computer ?

68000 Microprocessor

68000

Computer

Data Processing

Data Storage

1-9

Basic Functions of Computer

68000 Microprocessor

68000

Data Processing Data Storage Data Movement Control

Kamal Khalil

1-10

Computer Classifications

68000 Microprocessor

68000

Classification of computers:

Servers:

Are the modern form of what was once mainframes, minicomputers, and supercomputers, and are accessed only via a network. Servers are oriented to carrying large workload, which may consist of either single complex applications, usually a scientific or engineering application, or handling many small jobs, such as would occur in building a large Web server.

Desktops:

The best known form of computing and are characterized by the PC. Desktops emphasize delivering good performance to a single user at low cost. They are one of the largest market for computers, and the evolution of many computing technologies is driven by this class of computing, which is only about 30 years old!.
Are small mobile computer, which usually weighs 2-18 pounds (1-6 kg), depending on size, materials, and other factors. usually they run on a single main battery or from an external AC/DC adapter which can charge the battery while also supplying power to the computer itself.
1-11

Laptops:

Kamal Khalil

Embedded Systems

68000 Microprocessor

68000

Embedded computer: A computer inside another device used for running one predetermined application or collection of software. They are the largest class of computers and span the widest range of applications and performance. Embedded computers include: Washing machine. Cell phones. Personal Digital Assistant (PDA). Automatic Teller Machine (ATM), etc Embedded computers are account for > 99% of microprocessors applications. Desktop processors (Intel Pentium, AMD Athlon, PowerPC, etc) combined is only 1%
1-12

Other Processors in Embedded Systems

68000 Microprocessor

68000

Embedded Controllers: More powerful (32 bits) than microcontrollers (8 bits) Normally contains only processor and input/output, memory is external Digital Signal Processors: Embedded processors optimized for digital signal processing Commonly found in hand-phones, modems, communications systems Graphics Processors: Very powerful processors found in graphics cards of workstations Programmable Logic Controllers: Microprocessor boards usually found in industrial applications

Kamal Khalil

1-13

General Purpose Computing vs Embedded Systems


General Purpose
Intended to run a fully general set of applications

68000 Microprocessor

68000

Embedded
Runs a few applications often known at design time

End-user programmable
Faster is always better

Not end-user programmable


Operates in fixed run-time constraints, additional performance may not be useful/valuable Differentiating features: Power Cost (eg RM2 vs RM2.50) Size Speed (must be predictable)

Differentiating features: Speed (need not be fully predictable) Software compatibility Cost (eg RM1300 vs RM5k per laptop)

1-14

To design a P System, we must know

68000 Microprocessor

68000

Fundamentals:

Whats inside a computer Whats inside a processor What happens in the processor when its running a program What do we need to write a program How to create a program How to run a program How to fix a program error

Programming:

Hardware design:

Timing diagrams Interfacing with other chips

Kamal Khalil

1-15

68000 Microprocessor

Structure / Major Components of a Computer

68000

1-16

A Computer System Simplified View


Stores and retrieves data Controls the operation of the computer Performs its data processing functions

68000 Microprocessor

68000

Moves data between the computer and its external environment

CPU

Memory

Input/Output

Address bus
Provides communication Data bus Control bus among CPU, main memory and I/O

An embedded system also has the same structure but at a smaller size

1-17

What is Microprocessor ?
Central Processing Unit (CPU): Control the operation of the computer and performs its data processing functions; often simply referred to as PROCESSER

68000 Microprocessor

68000

CPU

1-18

Processor or Central Processing Unit (CPU)

68000 Microprocessor

68000

Menyimpan maklumat

Memproses

Daftar
Bas dalama n

ALU
Bas alamat

Bas data

Unit kawalan
Bas kawalan

Mengawal
1-19

Structure of CPU
The Central Processing Unit (or P)
To synchronize and control the overall operation of the P system

68000 Microprocessor

68000

To decode instruction and pass the necessary control signals to CU

Control Unit & Instruction Decoder perform the arithmetic and To Arithmetic/Logic Unit
A set of internal storage locations within the CPU

logical operations within the CPU

Registers

1-20

Registers
Control & Status Registers User-Visible Registers

68000 Microprocessor

68000

Program Counter Instruction Register ... ...

General-Purpose Reg. Address Register Data Register Flag Register

A register is a storage device that holds a word exactly like a memory location. In principle, theres no difference between a location in memory and a register. Registers are located within the CPU and can be accessed faster than memory locations.

1-21

Registers: 68000 Processor

68000 Microprocessor

68000

Program Counter (PC)


Keeps track of program execution Address of next instruction to read from memory May have auto-increment feature or use ALU Some manufacturers call this register the Instruction Pointer (IP) Invisible to programmer Contains current instruction Includes ALU operation and address of operand Stores data. For simple P, it may be called accumulators. Stores address of data. For special areas of memory, it may be called index registers, stack pointers or base registers.
1-22

Instruction Register (IR)

Data Registers

Address Registers

The ALU

68000 Microprocessor

68000

Performs arithmetic & logic operations on several bits simultaneously The number of bits is a most important factor determining the capabilities of the processor Typical sizes:
4

bits (very small microcontroller: remote controllers) 8 bits (microcontrollers: 68HC05, 8051, PIC) 16 bits (low-end microprocessors: Intel 8086) 32 bits (most popular size today: Pentium, PowerPC, 68000, ARM, MIPS) 64 bits (servers: IBM POWER & PowerPC G5, AMD Opteron, Intel Itanium)
Kamal Khalil 1-23

Memory
Memory Address-1 Memory Address-2 Memory Location-1

68000 Microprocessor

68000

Memory Location-2

1 byte = 8-bit data

1 word= 2 bytes
1 double = 2 words Memory Address-n Memory Location-n

Number of addresses 2N (where N is an integer)


1-24

Memory Devices

68000 Microprocessor

68000

Read-Only Memory

Non-volatile memory: contents is retained even without power In embedded systems, used to store application programs and test routines Contents can be set by fixing it during manufacturing or burning it using a programming device Common types include MROM, PROM, EPROM and flash memory Erasable types can only be rewritten a fixed number of times Contents lost without power (volatile memory) Used to store temporary data. In embedded system, very little RAM is required. Some systems dont even have RAM at all! No limit to number of writes the device can handle Fast writes (unlike EPROM/EEPROM) Two major types are SRAM and DRAM
1-25

Random Access Memory


Kamal Khalil

Data & Address Buses


1. Smallest transferable amount of data from memory to CPU (and vice versa) is one byte. 2. Each byte has a unique location or address. 3. The address of each byte is written in hexadecimal (hex). For 68000, the prefix $ means a hex value. 4. The range of addresses accessible by the processor is the memory space. (Limited by the size of the address bus). 5. From the programmers point of view, 68000 address bus is 24 bits wide. Memory space is 0 to 224-1 (16777216 or 16 Megabyte) Written in hex as $000000 to $FFFFFF.
24-bit address bus

68000 Microprocessor

68000

CPU
16-bit data bus

Memory

Data bus 16 bits

15 $000000 Address bus 24 bits 224-1= 8M locations

$FFFFFF
1-26

Memory Read/ Write Operation


0000 0001 0002 0003 10100000

68000 Microprocessor

68000

0002

Bas alamat

00110010 01011111 11111111 0004 00000001

Bas data

01011111

FFFF 11111111 Perintah BACA

0003

Bas alamat

0000 0001 0002 0003

10100000 10000001

10000001

00110010 01011111 11111111 0004 00000001

Bas data FFFF 11111111

Perintah TULIS

1-27

Memory Read/ Write Operation

68000 Microprocessor

68000

Big-endian order: Words are stored with the lower 8-bits in the higher of the two storage locations g As opposed to little-endian processors, like the Intel 80x86 family

1-28

Memory Map

68000 Microprocessor

68000

System memory map summarizes the memory locations available to the programmer Must know the following before we can write any program

$000000 $001FFF $002000 $01FFFF $002000

Interrupt vectors

ROM RAM
$01FFFF $020000

RAM start and end ROM start and end I/O devices

Unused
$FFFBFF $FFFC00

Very different from writing a program in C where we dont have to know all this

I/O devices
$FFFFFF

The memory map of a typical system

Kamal Khalil

1-29

Microprocessor Basic concept


Address bus

68000 Microprocessor

68000

16-bit / 32-bit / 64-bit wide

CPU

Data bus

bidirectional 8-bit / 16-bit / 32-bit / 128-bit

Control bus

Timing signals, ready signals, interrupts etc

Microprocessor, by-itself, completely useless must have external peripherals to Interact with outside world
1-30

Microprocessor Basic concept


Address Control

68000 Microprocessor

68000

CPU

Boot ROM
Used at startup

Instruction (program) ROM

Data RAM

Transducers

Keyboard Screen UART Parallel interface etc

Data

Microprocessor, by-itself, completely useless must have external peripherals to Interact with outside world
1-31

Microcontroller Basic concept


Address Control

68000 Microprocessor

68000

CPU

Boot ROM

Program ROM

Data RAM

Transducers

Some I/O

Data

Microcontroller - put a limited amount of most commonly used resources inside one chip
1-32

Microprocessor vs Microcontroller

68000 Microprocessor

68000

Microprocessor: A chip that contains only the processor Need other chips to make a working system More flexible Can have very few I/O or many I/O devices using the same processor chip

Microcontroller: A chip that contains all the components of a computer processor, memory and input/output Less flexibility Less component count in system Less powerful

No matter what is the system size, the most important component is still the processor.

1-33

Software

68000 Microprocessor

68000

Computer software

Computer programs are known as software Sequence of instructions that perform a task Think of it like playing music The simplest operation performed by the processor Think of it as a note coming from a musical instrument Fetch an instruction from memory Decode the instruction Execute the instruction Repeat
1-34

Program:

Instruction:

How the computer works:

Kamal Khalil

Machine & Assembly Language

68000 Microprocessor

68000

Machine instruction

A sequence of binary digits which can be executed by the processor, e.g. 0001 1011. Hard to understand for human being

Assembly language

An assembly program consists of assembly instructions An assembly instruction is a mnemonic representation of a machine instruction e.g. MUL may stand for multiply Assembly programs must be translated into object code before it can be executed -- translated by an assembler. Assemblers can be of two types: cross assembler and native assembler. Cross assembler runs on one computer and generates machine instructions that will be executed by another computer that has different instruction set, e.g. freeware ASM68K. Native assembler runs and generates instructions for the same computer. Drawbacks of assembly programs are:

dependent on hardware organisation, difficult to understand long programs, low programmer productivity
1-35

Kamal Khalil

High-level language (HLL)

68000 Microprocessor

68000

High-Level Language
Syntax of a high-level language is similar to English

translator is required to translate the program written in a high-level language into object code -- done by a compiler. There are cross compilers that run on one computer but translate programs into machine instructions to be executed on a computer with a different instruction set. Main drawback is slower execution speed of the machine code obtained after compiling an HLL program. However, C language has been extensively used in microcontroller programming in industry.
Kamal Khalil 1-36

Instruction Cycle (Fetch-Execute)


68000 Microprocessor

68000

The processor executes instructions one-by-one according to the sequence found in memory Everything is controlled by, what else, the control unit in the CPU. To execute an instruction, the processor must fetch it from memory. The complete steps the processor takes to execute one instruction is the instruction cycle or the fetch-execute cycle

Fetch

Execute

Kamal Khalil

1-37

Instruction Cycle Details

68000 Microprocessor

68000

On program start:
0. Load the program counter (PC) with the address of the first instruction

Fetch phase:
1. Read the instruction and put it into the instruction register (IR) 2. Control unit decodes the instruction; updates the PC for the next instruction

Execute phase:
3. 4. 5. 6. Find the data required by the instruction. Perform the required operation. Store the results. Repeat from Step 1.

Kamal Khalil

1-38

Instruction Cycle

68000 Microprocessor

68000

Kamal Khalil

1-39

Instruction Sequencing

68000 Microprocessor

68000

Example an instruction to add the contents of two locations (A and B) and place result in a third register (C) Before you do anything: set PC to point to 1st instruction in the sequence
Addr Instructions

Program Counter (PC) 12 Instruction Register (IR) Data Register 0 (D0)

12
14 16

MOVE
ADD MOVE

A,D0
B,D0 D0,C

100
102 104
Kamal Khalil

(A) = 4
(B) = 5 (C)
1-40

Instruction Sequencing

68000 Microprocessor

68000

Program Counter (PC) 14 Instruction Register (IR) MOVE A,D0 Data Register 0 (D0) 4

Addr Instructions 12 14 16 MOVE ADD MOVE 100 102 104 (A) = 4 (B) = 5 (C) A,D0 B,D0 D0,C

Kamal Khalil

1-41

Instruction Sequencing

68000 Microprocessor

68000

Program Counter (PC) 16 Instruction Register (IR) ADD B,D0 Data Register 0 (D0) 9

Addr Instructions 12 14 16 MOVE ADD MOVE 100 102 104 (A) = 4 (B) = 5 (C) A,D0 B,D0 D0,C

Kamal Khalil

1-42

Instruction Sequencing

68000 Microprocessor

68000

Program Counter (PC) 18 Instruction Register (IR) MOVE D0,C Data Register 0 (D0) 9

Addr Instructions 12 14 16 MOVE ADD MOVE 100 102 104 (A) = 4 (B) = 5 (C) = 9 A,D0 B,D0 D0,C

Kamal Khalil

1-43

Contemporary Computers
T ype Disposable computer Embedde d computer Gam e computer Personal computer Server Collection of Workstations Mainframe Super computer Price ( $ ) 1 10 100 1K 10 K 100 K 1M 10 M Example application Greeting cards Watches, cars, appliances Home video games Desktop or porable computer t Network server Departmental minicomputer Batch data processing in bank Long range weather prediction

68000 Microprocessor

68000

Generation 1 2 3 4 5

Approximate Dates 1946-1956 1956-1967 1967-1978 1978-1989 1989- ?

Technology Vacuum tube Transistor Small & medium scale integration VLSI ULSI

Typical Speed (Operations/second) 40,000 200,000 1,000,000 10,000,000 100,000,000

Kamal Khalil

1-44

Selecting a Microprocessor

68000 Microprocessor

68000

Choose the right one for your application


Primary criteria: Cost, Power, Size, Speed Others: package options, integrated peripherals, potential for future growth development environment - good compiler and debugger availability evaluation boards in-circuit emulators for those with deep pockets Operating system availability Code density: affects power consumption, performance and system cost Hardware availability: make sure you can actually purchase the microcontroller before designing it in Prior expertise, licensing, etc
1-45

Choose one with good software development support


Other considerations

Kamal Khalil

Summary

68000 Microprocessor

68000

Microprocessors and embedded controllers are a ubiquitous part of life today Concept of a microprocessor & microcontroller Understand how a P works Headhunters report that EEs familiar with C, P design are in the highest possible demand Web Resources:

How Microprocessors Work:


http://computer.howstuffworks.com/microprocessor.htm http://www.intel.com/education/mpworks/ http://www.cse.psu.edu/~cg471/03f/hw/pj5/how-micro.html http://www.sasktelwebsite.net/jbayko/cpu.html http://www-128.ibm.com/developerworks/library/pa-microhist.html


1-46

Great Microprocessors of the Past and Present:

Great Moments in Microprocessor History:

Kamal Khalil

Вам также может понравиться