49
ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION Microprocessor Programming and Interfacing Dr. Runa Kumari Assistant Professor EEE Department BITS Pilani Hyderabad Campus

CS EEE F241 Introduction Jan 16th 2016

Embed Size (px)

DESCRIPTION

micro p slide

Citation preview

Page 1: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Microprocessor Programming

and Interfacing

Dr. Runa Kumari

Assistant Professor

EEE Department

BITS Pilani Hyderabad Campus

Page 2: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

About the Course

2 1/19/2016

Course No. : CS/ECE/EEE/INSTR F241

Course Title : Microprocessor Programming & Interfacing

Instructor-in-charge : Dr. Runa Kumari

Lecture Class Timings : Tue, Thus, Sat 11:00 to 11:50 AM

at F102 and F105

Tutorial Timing : Thursday 8.00 Am at F102, F103 and F105

Lab Timings : Mon, Tue, Wed, Thus, Fri 15:00 to 17:00

Tue, Thus, Sat - 9:00 to 11:00 AM at D-329

Page 3: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

1/19/2016 3

Course description

• Study of Programmer model of X86 processors, processor

architecture, addressing modes and instructions set of X86

processors.

• Assembly programming using different instructions,

subroutines and macros etc.

• Concept of Interrupts.

• Memory Interfacing.

• Programmable peripheral devices.

Page 4: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

1/19/2016 4

Text Books

Text Book:

Barry B Brey, The Intel Microprocessors .Pearson, Eight Ed.

2009.

Reference Book:

Douglas V Hall, Microprocessor and Interfacing, TMH,

Second Edition.

Page 5: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

1/19/2016 5

COURSE PLAN

Lec.

No. Topic to be covered Learning Objective

Ref. To Text

Book and

Reference Book

1

Compute Architecture,

Memory & I/O organization,

CISC/RISC processors

Introduction to Microprocessor

and Microcomputers

Ch-1 (T1, R1)

2-3 8086 Microprocessor Microprocessor & its

architecture

Ch-2 (T1, R1)

4-6 Addressing Modes Assembly Programming Ch-3 (T1)

7-12

Instruction Set & ALP Assembly Programming Ch-4-6, 8 (T1)

13-15 Pin Out, Modes of operation,

Clocking, Buses

8086/8088 Hardware

Specifications Ch-9 (T1)

Page 6: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

1/19/2016 6

COURSE PLAN

16-19

Memory Devices, Address

Decoding- Memory Interface 8086-

80386

Memory Interface Ch-10 (T1)

20-23

Basic I/O interfacing (I/O mapped

I/O and Memory mapped I/O)

I/O port address decoding

I/O Interfacing

Ch-11.1, 11.2

(T1)

24-26 Types of interrupts, Vector tables,

Priority Schemes Interrupts

Ch-12.1, 12.2

(T1)

27-29 8255,8254,ADC,DAC, 8259 Programmable Peripheral

Devices

11.3-11.6, &

12.3-12.6 (T1)

30-31

Basic Operation, 8237, Shared Bud,

Disk Memory Systems, Video

Displays

DMA controller Ch-13 (T1)

32-33 ISA, PCI, Com, USB,AGP Bus Interface Ch-15 (T1)

34-36 80186-80286 Advanced microprocessor Ch-16 (T1)

37-39 80386-80486 Advanced microprocessor

Ch-17 (T1)

Page 7: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

EVALUATION SCHEME

1/19/2016 7

Component Duration Marks Date & Time Evaluation type

Test-I 60 min 45 29/02/2016

4:00-5:00 PM Closed Book

Test-II 60 min 45 09/04/2016

4:00-5:00 PM Open Book

Surprise Quiz 15 min each 45 Closed Book

Lab 2Hrs/week 45 - Open / Closed Book

Compre. Exam. 3 hours 120 12/05/2016 AN

Open Book

Total 300

Page 8: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

1/19/2016 8

Chamber Consultation: Room No. D322

Mon-Sat: 12:00 to 13:00 P.M

email: [email protected]

Notices: CMS

Make–up: No make-up will be given for Surprise Quiz and Lab final Exam.

For Tests and Comprehensive Examination make-up examination will be given

only in extremely genuine cases for which prior permission of the instructor-in-

charge is required.

Page 9: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Motivation to Study Microprocessors

9 1/19/2016

Recent Development

– 64 bit laptop

– I5 and I7 processors

Job Market (Leading companies)

– Probably one of most easy and highly paid jobs

– Intel, AMD, Motrola, Sun Microsystems, Texas

Instruments, National Instruments, MIPS Technologies

– Many Microprocessor and Microcontroller based

Companies in India

Page 10: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

10 1/19/2016

Introduction to Microprocessors

Page 11: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Block diagram of a Computer System

CPU

ROM/- -/RAM

KBD Display

DISK Printer

ADDRESS/CONTROL/DATA BUS

Page 12: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

• First general-purpose, programmable electronic computer system

developed in 1946. (at University of Pennsylvania )

Electronic Numerical Integrator and Calculator (ENIAC), a

huge machine.

over 17,000 vacuum tubes;

500 miles of wires

weighed over 30 tons

about 100,000 operations per second

History

Page 13: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

ENIAC - The first Electronic computer (1946)

Page 14: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Programmed by rewiring its circuits.

process took many workers several days

workers changed electrical connections on

plug-boards like early telephone switchboards

Required frequent maintenance.

vacuum tube service life a problem

Page 15: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

December 23, 1947, John Bardeen, William Shockley,

and Walter Brattain develop the Transistor at Bell

Labs.

Page 16: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

The First Integrated Circuit – Jack Kilby, Texas Instruments

1 Transistor and 4 Other Devices on 1 Chip

In the year 1958

Page 17: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

The Intel 4004 – 2,300 Transistors, 1 MHz operation

THE FIRST COMPUTER ON A SINGLE CHIP

BEGINNING OF LARGE SCALE INTEGRATION TECHNOLOGY

The First Microprocessor -- 1971

Page 18: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

• The world's first microprocessor, the Intel 4004, was a

4-bit microprocessor-a programmable controller on a

chip.

• It addressed a mere 4096 (12 address lines) 4-bit

memory locations.

• Its instruction set contained only 45 different

instructions.

Page 19: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

First General-Purpose Microprocessor -- 1974

8-Bit Intel 8080 and 8085 , Intel Corporation – 4,500

Transistors

Page 20: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Intel 8086 microprocessor (1978)

Page 21: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

• Microprocessors that are common today include the

8086/8088, which were the first 16-bit

microprocessors.

• Following these early 16-bit machines were the 80286,

80386, 80486, Pentium, Pentium Pro, Pentium II,

Pentium III, Pentium 4, and Core2 processors.

• The architecture has changed from 16 bits to 32 bits

and to 64 bits.

Page 22: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

One of the Most Powerful 16-Bit Microprocessors --

1979

The Motorola 68000

WELL INTO THE LARGE SCALE INTEGRATION ERA

22

Page 23: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Intel Pentium (IV) microprocessor 2000

In the early 1970s, CMOS technology replaced NMOS-only

logic which started suffering from high power consumption.

Ever since, CMOS has been the dominant digital technology.

Page 24: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

24 1/19/2016

Introduction to Microprocessors

Memory

I/O Interface

Data bus

Processor

Address bus

Control bus

IO device IO device

Page 25: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

25 1/19/2016

Introduction to Microprocessors

CPU on a Single VLSI Chip

WHAT HAPPENS WHEN YOU TURN ON YOUR COMPUTER ?

BIOS –Basic Input Output System

• Resident in ROM

Orchestrates loading the computer's operating system from the hard disk drive

into RAM

OS Loads Program from Disk (Secondary Storage) to RAM (Primary Storage)

(Program -Set of Instructions –Executed by μp)

Page 26: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

26 1/19/2016

Instructions in Microprocessor

WHAT IS INSTRUCTIONS?

Tells the μp what action to perform

• Arithmetic, Logic Operation

• Read Data from Input Device

• Write to memory OR Output Device

• Reset

• Stop

Example: ADD A,B Assembly Language

A,B -Registers

Page 27: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

27 1/19/2016

Instructions in Microprocessor

HOW DOES A MICROPROCESSOR HANDLE AN INSTRUCTION?

Fetch Cycle

The fetch cycle takes the instruction required from memory, stores

it in the instruction register

Execute Cycle

The actual actions which occur during the execute cycle of an

instruction

Page 28: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Microprocessor Data

Bus

Control

signals

Add

Bus Microprocessor

-Fetches Instruction

-Executes Instruction

Page 29: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

29 1/19/2016

Introduction to Microprocessors

Page 30: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

30 1/19/2016

Introduction to Microprocessors

Page 31: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

31 1/19/2016

Size of Microprocessor

SIZE OF A MICROPROCESSOR

• Size of Data Bus

• Size of Registers

• Size of ALU

Page 32: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

32 1/19/2016

Microprocessor Bus

PROCESSOR BUS

ADDRESS BUS:

No of Address lines

• 20 lines –A19–A0

• 1 M Byte of memory can be addressed

DATA BUS:

No of Data lines

• 16 lines –D15–D0

• 64K

CONTROL LINES:

-Active low signals

• MEMR

• MEMW

• IOR

• IOW

Page 33: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

33 1/19/2016

Memory of Microprocessors

PROCESSOR MEMORY

• ROM

Non-Volatile

Read Only

• RAM

Volatile

Random Access Memory

MEMORY DATA SIZE

• Bit Organized

• Nibble Organized

• Byte Organized

Page 34: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Memory

Add Bus

Data Bus

Read

Write

Memory –

Registers to hold bits

Page 35: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

4 bits

Ex :

8 Registers

Address lines : 3 (Unidirectional)

Data lines : 4 (Bidirectional)

Page 36: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

36 1/19/2016

Processors

ISA (Instruction Set Architecture)

• Execution model

• Processor registers

• Address and Data formats

Microarchitecture

• Interconnections -various micro architectural elements of machine

• ALU

• Data Path

• Control Path

Physical Realization

Page 37: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

37 1/19/2016

Processors

WHAT IS THE EFFECT ?

• If Instructions is present anywhere

• Size of Instruction varies

-Complicates Instruction Decoder

ISA

CISC (Complex Instruction Set Computer)

Operands for Arithmetic/Logic operation can be in Register/ Memory

RISC (Reduced Instruction Set Computer)

Operands for Arithmetic/Logic operation only in Registers

Register –Register Architecture

Page 38: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

38 1/19/2016

RISC vs CISC

Goal: Multiply data in mem A with B

and put it back in A

CISC:

MUL A,B

RISC:

LDA R0,A

LDA R1,B

MUL R0,R1

STR A,R0

Page 39: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

39 1/19/2016

RISC vs CISC

CPU-SPEEDUP

1 Instruction Per Cycle (1 IPC)

Page 40: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

40 1/19/2016

Basic Parallel Techniques

• Pipelining

• Replication

INSTRUCTION PIPELINES

Instruction:

• Fetch

• Decode

• Execute

Page 41: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

41 1/19/2016

VLIW & SUPERSCALAR ARCHITECTURE

Page 42: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

42 1/19/2016

FLYNN’S TAXNOMY

SISD

SIMD

MISD

MIMD

SISD

Page 43: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

43 1/19/2016

FLYNN’S TAXNOMY

SIMD

Page 44: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

44 1/19/2016

FLYNN’S TAXNOMY

MISD

Page 45: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

45 1/19/2016

FLYNN’S TAXNOMY

MIMD

Page 46: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Core duo micro processor

Page 47: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Page 48: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

Quad- core microprocessor

Page 49: CS EEE F241 Introduction Jan 16th 2016

ELECTRICAL ELECTRONICS COMMUNICATION INSTRUMENTATION

49 1/19/2016

EVOLUTION OF MICROPROCESSOR