Microcomputer Architecture and Programming

Similar documents
Microprocessors/Microcontrollers

Chapter 1: Basics of Microprocessor [08 M]

Architecture of 8085 microprocessor

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Basics of Microprocessor

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

Lecture 2 Microcomputer Organization: Fig.1.1 Basic Components of Microcomputer

8086 INTERNAL ARCHITECTURE


MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag, Interrupt flag, Direction flag, and Sign flag.

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

1. Internal Architecture of 8085 Microprocessor

8/26/2010. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to Three Units of 8085

12-Dec-11. Gursharan Singh Maninder Kaur. Introduction to 8085 BLOCK DIAGRAM OF INTEL Introduction to Introduction to 8085

Chapter Introduction Chapter 1. a) Address translation b) Protection c) Program relocation. type's "««"** ***** ** various

8051 microcontrollers

8051 Microcontrollers

Internal architecture of 8086

Microprocessor Architecture

Pin Description, Status & Control Signals of 8085 Microprocessor

Introduction to Microprocessor

Micro computer Organization

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

THE MICROCOMPUTER SYSTEM CHAPTER - 2

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.

9/25/ Software & Hardware Architecture

8051 Overview and Instruction Set

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Intel 8086 MICROPROCESSOR ARCHITECTURE

The functional block diagram of 8085A is shown in fig.4.1.

3.1 Description of Microprocessor. 3.2 History of Microprocessor

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

Assembly Language Programming of 8085

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 3. Z80 Instructions & Assembly Language. Von Neumann Architecture. Memory. instructions. program. data

Introduction to Microcontrollers

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

MICROPROCESSOR B.Tech. th ECE

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

INTEL Architectures GOPALAKRISHNAN IYER FALL 2009 ELEC : Computer Architecture and Design

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMMUNICATION ENGINEERING REG 2008 TWO MARKS QUESTION AND ANSWERS

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

ENE 334 Microprocessors

E3940 Microprocessor Systems Laboratory. Introduction to the Z80

The due date for submitting this assignment has passed. 1) Which of the following statements regarding a microcomputer, a

EE 3170 Microcontroller Applications

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

MICROCONTROLLERS 8051

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

UNIT I. Differences between: Microcomputer, Microprocessor and Microcontroller

Microcontrollers. Microcontroller

Computer Architecture 2/26/01 Lecture #

م.م. ماجد عيدان. Introduction to microprocessor and microcomputer

Introduction to Computers - Chapter 4

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

Digital IP Cell 8-bit Microcontroller PE80

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

History and Basic Processor Architecture

MICROPROCESSOR MCQs. 1) What does the microprocessor comprise of? a. Register section b. One or more ALU c. Control unit d.

In this tutorial, we will discuss the architecture, pin diagram and other key concepts of microprocessors.

Segment 1A. Introduction to Microcomputer and Microprocessor

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

UNIT-I. 1.Draw and explain the Architecture of a 8085 Microprocessor?

1. Internal Architecture of 8085 Microprocessor

ECED3204: Microprocessor Part I--Introduction

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

EE 308: Microcontrollers

1. What is Microprocessor? Give the power supply & clock frequency of 8085?

Digital System Design Using Verilog. - Processing Unit Design

Fundamentals of Digital Computers The mechanical computer age began with the advent of the abacus in 500 B.C by Babylonians. The abacus, which was

machine cycle, the CPU: (a) Fetches an instruction, (b) Decodes the instruction, (c) Executes the instruction, and (d) Stores the result.

8051 Microcontroller

Computer Architecture

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

b. List different system buses of 8085 microprocessor and give function of each bus. (8) Answer:

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

icroprocessor istory of Microprocessor ntel 8086:

ELE 3230 Microprocessors and Computer Systems

ELEG3923 Microprocessor Ch.0 & Ch.1 Introduction to Microcontroller

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

ELEG3924 Microprocessor

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

Q. P. Code : b. Draw and explain the block dig of a computer with microprocessor as CPU.

Embedded Systems. Read pages

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

MICROPROCESSOR BASED SYSTEM DESIGN

STRUCTURE OF DESKTOP COMPUTERS

Architecture of 8086 Microprocessor

Transcription:

IUST-EE (Chapter 1) Microcomputer Architecture and Programming 1

Outline Basic Blocks of Microcomputer Typical Microcomputer Architecture The Single-Chip Microprocessor Microprocessor vs. Microcontroller Memory Input/Output Registers Microcomputer Programming Concepts 2

Basic Blocks of a Microcomputer A microcomputer has three basic blocks: a central processing unit (CPU), a memory unit, and an input/output unit. 3

Basic Blocks of a Microcomputer: CPU The CPU executes all the instructions Performs arithmetic and logic operations on data. The CPU of the microcomputer is called the microprocessor which contains all the registers control unit arithmetic/ logic circuits 4

Memory A memory unit stores both data and instructions. The memory ROM RAM The ROM can only be read and is nonvolatile It is used to store information that would not change Instructions data For example, storing look up tables for code converters 5

Memory: RAM One can read from and write into a RAM. The RAM is volatile It does not retain its contents when the power is turned off. A RAM is used to store programs and data that are temporary and might change during the course of executing a program. 6

I/O (Input/Output) Unit Transfers data between the microcomputer and the external devices Done by I/O ports (registers) The transfer involves data, status, and control signals. 7

Microprocessor vs. Microcontroller There are two microcomputer systems single-chip microcomputer; these three elements are on one chip, single-chip microprocessor; separate chips for memory and I/O are required. Microcontrollers evolved from single-chip microcomputers 8

Microcontroller The microcontrollers are typically used for dedicated applications Typical microcontrollers include on-chip timers A/D (analog to digital) D/A (digital to analog) converters. Two popular microcontrollers Intel 8751 (8 bit)/8096 (16 bit) Motorola HC11 (8 bit)/hc16 (16 bit). The 16-bit microcontrollers include more on-chip ROM, RAM, and I/O than the 8-bit microcontrollers. 9

Typical Microcomputer Architecture The various microcomputers available today are basically the same in principle. The main variations are in # of data and address bits and in the types of control signals they use. 10

Microcomputer Bus The microcomputer s system bus contains address, data control information These buses connect CPU to each of the ROM, RAM, and I/O chips Information transfers between the microprocessor and any of the other elements via buses 11

Typical Information Transfers Carried out with respect to the memory or I/O and CPU WRITE operation: data is written into a selected memory location or an I/O port (register). READ operation: data is read from a selected memory location or an I/O port 12

Address Bus is a unidirectional bus: information transfer takes place only in one direction, microprocessor memory or I/O elements. is typically 20 to 32 bits long. The size of the address bus determines the total number of memory addresses available 13

Address Bus (cont.) The address bus is specified by the total number of address pins on the microprocessor chip. This also determines maximum size of the main memory of the microprocessor. For example, a microprocessor with 20 address pins can generate 2 20 = 1,048,576 (one megabyte) different possible addresses on the address bus. 14

Data Bus is a bidirectional bus: data can flow in both directions. In some microprocessors, the data pins are used to send other information such as address bits in addition to data. the data pins are time-shared or multiplexed. The Intel 8086 microprocessor is an example where the 20 bits of the address are multiplexed with the 16-bit data bus and four status lines. 15

Control Bus Consists of a number of signals that are used to synchronize the operation of the individual microcomputer elements. The microprocessor sends some of these control signals to the other elements to indicate the type of operation being performed. Each microcomputer has a unique set of control signals. However, there are some control signals that are common to most microprocessors. 16

Clock Signals The control bus contains system clock signals The clock signals vary from one microprocessor to another. Some microprocessors have an internal clock generator require an external crystal or an RC network For example, the Intel 80186 (16-bit microprocessor) However, most microprocessors require an external chip 17

Single-Chip Microprocessor The microprocessor is the CPU of the microcomputer. The power of the microcomputer is determined by the capabilities of the microprocessor. Speed of the microcomputer clock frequency Microcomputer s word size # of data pins on the chip Maximum memory size # of address pins The microcomputer s I/O and interfacing capabilities are determined by the control pins on the microprocessor chip. 18

Microprocessor Main Elements logic inside the microprocessor chip: The register section the arithmetic and logic unit (ALU) the control unit 19

Register Section The register structures of microprocessors play a major role in designing the microprocessor architectures determine how convenient and easy it is to program this microprocessor The number, size, and types of registers vary from one microprocessor to another. However, the various registers in all microprocessors carry out similar operations. 20

Basic Microprocessor Registers There are four basic microprocessor registers: instruction register (IR) program counter (PC) memory address register (MAR) Accumulator (A)/Data register 21

Instruction Registers (IR) The size of IR The word size of the microprocessor (μp) For example, a 16-bit μp has a 16-bit IR Its contents are instructions, known as operation code (op-code) To execute a μp instruction: 1. After fetching an instruction code from memory, the μp stores it in IR 2. The instruction is decoded internally by the μp 3. The μp executes the required operations 22

Program Counter (PC) The size of PC the size of address bus Its content the address of the next instruction to be executed Activating RESET input pin (PC) the address of the first instruction to be executed JUMP instructions The PC is loaded with the address specified in these instructions. 23

PC operations to execute an instruction (PC) on the address bus The μp reads ( fetches ) the contents of this address from memory. The PC contents are automatically incremented by the μp s internal logic The μp decodes the instruction and then executes a program sequentially 24

Memory Address Register (MAR) The MAR s content is the address of data. It is used as a direct pointer to memory. The content of the address consists of the actual data that is being transferred. 25

Accumulator (A)/Data Register For an 8-bit μp: the accumulator is typically an 8-bit register. It is used to store the result after most ALU operations. These μps have instructions to shift or rotate the A, 1 bit to the right or left through the carry flag. used for inputting a word into the accumulator/data register from an external device outputting a word to an external device from the accumulator. Some microprocessors, such as the Motorola 6809, have more than one accumulator. 26

Accumulator-Based μp Eight-bit μps are usually accumulator based such as the Intel 8085 and Motorola 6809 The data is assumed to be held in a register called the accumulator. All arithmetic and logic operations are performed using it as one of the data sources. The result after the operation is stored in the accumulator. 27

General-Purpose Register-Based μp is usually popular with 16-, 32-, and 64-bit μps Intel 8086/80386/80486/Pentium The general-purpose registers can hold data, memory, addresses, or the results of arithmetic or logic operations. The number, size, and types of registers vary from one microprocessor to another. The use of general-purpose registers speeds up the execution of a program. Why? They are used for storing temporary data or for carrying out data transfers between various registers. 28

Other Microprocessor Registers General-Purpose Registers Index Register Status Register Stack Pointer Register 29

General-Purpose Registers: Typical Functions [REG]: the contents of the general-purpose register [M]: the contents of a memory location. 1. Move [REG] to or from memory: [M] [REG] or [REG] [M] 2. Move the contents of one register to another: [REG1] [REG2] 3. Increment or decrement [REG] by 1: [REG] [REG] + 1 or [REG] [REG] - 1. 4. Load 16-bit data into a register [REG]: [REG] 16-bit data 30

Index Register are typically 16 or 32 bits long used as a counter in address modification for an instruction useful with instructions that access tables or arrays of data to modify the address portion of the instruction This is called indexed addressing. The effective address for an instruction using the indexed addressing mode is determined by adding the address portion of the instruction to the contents of the index register. 31

Status Register also known as the processor status word register or the condition code register contains individual bits, called flags The status of a specific microprocessor operation is indicated by each flag, set or reset by the μp s internal logic to indicate the status of certain μp operations such as arithmetic and logic operations 32

Common Status Flags Carry flag used to reflect whether or not the result generated by an arithmetic operation is greater than the μp s word size Multi-byte addition 33

Common Status Flags (cont.) Auxiliary Carry flag is set to 1 if the carry out of the low 4 bits is 1, otherwise it is 0. Used for performing BCD arithmetic with μps Zero flag used to show whether the result of an operation is zero. It is set to 1 if the result is zero, and it is reset to 0 if the result is nonzero. 34

Common Status Flags (cont.) Parity flag is set to 1 to indicate whether the result of the last operation contains either an even number of 1 s (even parity) or an odd number of 1 s (odd parity), determined by the microprocessor s internal structure and is not selectable Sign flag (or negative flag) which is the MSB of the last operation 1 negative. 0 positive 35

Common Status Flags (cont.) Overflow flag is set to 1 if the result of an arithmetic operation is too big for the μp s maximum word size, otherwise it is reset to 0. Overflow = C f XOR C p C f the final carry out of the MSB (sign bit) C p the previous carry 36

An Example: Common Status Flags Determine the carry (C), sign (S), zero (Z), overflow (V), and parity (P) flags for the following operation: 0110 2 plus 1010 2 Assume the parity bit = 1 for ODD parity in the result; otherwise the parity bit =0. Also, assume that the numbers are signed. Draw a logic diagram for implementing the flags in a 5- bit register using D flip-flops; use P = bit 0, V = bit 1, Z = bit 2, S = bit 3, and C = bit 4. 37

Addition Operation 38

Logic Diagram 39

Stack Pointer Register Stack pointer (SP) contains the address of stack The stack consists of a number of RAM locations set aside for reading data from or writing data into these locations It is typically used by subroutines It is a LIFO (Last In First Out) memory Two instructions, PUSH and POP, are usually available with the stack 40

Stack Pointer Register (cont.) μps typically use 16- or 32-bit registers for performing the PUSH or POP PUSH writing to the top or bottom of the stack POP reading from the top or bottom of the stack μps access the stack from the bottom SP is incremented after a PUSH and decremented after a POP operation or the top SP is decremented after a PUSH and incremented after a POP 41

Example (PUSH) Accessing stack from bottom SP SP+2: to address location 20C7 after the PUSH 42

Example (POP) Accessing stack from bottom After the POP: SP SP-2 43

Example (PUSH) The stack is accessed from the top. The SP is decremented by 2 after a PUSH 44

Example (POP) The stack is accessed from the top The SP is incremented by 2 after a POP 45