100% found this document useful (1 vote)
339 views36 pages

Microprocessor Ppt1

The document provides an introduction to microprocessors and microcontroller architecture. It discusses that a microprocessor is a programmable chip with computing capabilities similar to a computer's CPU. Microprocessors are used in electronics devices and advanced applications. It then describes the typical components of a microprocessor system including the CPU, memory, and input/output devices. It explains the fetch-execute cycle and three-bus architecture of address bus, data bus, and control bus. Finally, it discusses memory mapping, different microprocessor classifications, and the 8085 microprocessor architecture.

Uploaded by

alfred calaunan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
339 views36 pages

Microprocessor Ppt1

The document provides an introduction to microprocessors and microcontroller architecture. It discusses that a microprocessor is a programmable chip with computing capabilities similar to a computer's CPU. Microprocessors are used in electronics devices and advanced applications. It then describes the typical components of a microprocessor system including the CPU, memory, and input/output devices. It explains the fetch-execute cycle and three-bus architecture of address bus, data bus, and control bus. Finally, it discusses memory mapping, different microprocessor classifications, and the 8085 microprocessor architecture.

Uploaded by

alfred calaunan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Microprocessor

MICROCONTROLLER
INTRODUCTION TO MICROPROCESSOR AND
MICROCOMPUTER ARCHITECTURE:

A microprocessor is a programmable electronics chip that has computing


and decision making capabilities similar to central processing unit of a
computer. Any microprocessor based systems having limited number of
resources are called microcomputers.
Microprocessor can be seen in almost all types of electronics devices like
mobile phones, printers, washing machines etc. Microprocessors are also
used in advanced applications like radars, satellites and flights.
Microprocessor System
The Stored Program Computer

The central processing unit or CPU - it is here that all decisions are made
and the timing generated
The memory unit - is used to store the specific sequence of commands
that will be used to instruct the CPU to perform some task. This instructions
are called the computer program. Each cell in the memory has its own
unique identifying number or address. These numbers represents the
operations codes (op codes) for the various instruction in the CPUs
instruction set.
Finally, no useful task can be performed by the computer without the
input/output devices.
Fetch and Execute

1. Fetch data from the memory cell whose address is currently in the
program counter register. Put this data into the instruction register.
2. Add 1 to the address in the program counter.
3. Decode the command currently in the instruction register and do what it
tells you.
4. Go to step 1.
The Three-Bus Architecture

Address Bus: It carries the address, which is a unique binary pattern used to
identify a memory location or an I/O port. For example, an eight bit
address bus has eight lines and thus it can address 2^8 = 256 different
locations. The locations in hexadecimal format can be written as 00H
FFH.
Data Bus: The data bus is used to transfer data between memory and
processor or between I/O device and processor. For example, an 8-bit
processor will generally have an 8-bit data bus and a 16-bit processor will
have 16-bit data bus.
Control Bus: The control bus carry control signals, which consists of signals
for selection of memory or I/O device from the given address, direction of
data transfer and synchronization of data transfer in case of slow devices.
Memory Mapped I/O

Memory maps are useful to show how much of the memory space of the
microprocessor is actually implemented and if any I/O devices are
mapped into this area.

Capacity:
1 k = 2^10 = 1024 bytes
1 M = (2^10)(2^10) = 1024 KB
1 G = 1024 MB
Memory Mapped

First address = 0000H


Last address = FFFFH
Last address = Memory capacity + First address -1
Example: A certain microcomputer has a 1K-byte memory beginning at
address 1000H. What is the hex address of the last word in this 1K memory?
Memory Mapped

Example: Draw the memory mapped for a given 16-bit addressing.

Peripherals: 8 KB
1. Identify the address of each chip.
2. What is the total size of the
memory.
SRAM: 32 KB

EPROM: 24 KB
Memory Mapped

Example: Draw the memory map for a microcomputer with 16K of read/write
memory beginning at address 0000, 28K of read-only memory beginning at
address 5000H, and 16K of memory-mapped I/O beginning at C000H. Label
all unused memory space as open.
Based on architecture:

A typical microprocessor consists of arithmetic and logic unit (ALU) in


association with control unit to process the instruction execution. Almost all
the microprocessors are based on the principle of store-program concept.
In store-program concept, programs or instructions are sequentially stored
in the memory locations that are to be executed.
Each microprocessor has a set of instructions, a list which is provided by the
microprocessor manufacturer. The instruction set of a microprocessor is
provided in two forms: binary machine code and mnemonics.
The set of instructions in the form of binary patterns is called a machine
language and it is difficult for us to understand. Therefore, the binary
patterns are given abbreviated names, called mnemonics, which forms
the assembly language. The conversion of assembly-level language into
binary machine-level language is done by using an application called
assembler.
Machine and Assembly Language
Programming

Example: Consider an 8080 microprocessor program that adds two


numbers input from a keyboard.

11011011 DB
00000000 00
01000111 47
11011011 DB
00000000 00
10000000 80
11010011 D3
00000000 00
01110110 76
Add Mnemonics
Binary Hex Mnemonics Comment
11011011 DB IN ;INPUT THE FIRST NUMBER
00000000 00 0 ;FROM PORT 0 AND SAVE IN REGISTER
A.
01000111 47 MOV B,A ;PUT A COPY OF REGISTER A IN
REGISTER B.
11011011 DB IN ;INPUT THE SECOND NUMBER
00000000 00 0 ;FROM PORT 0 AND SAVE IN REGISTER
A.
10000000 80 ADD B ;ADD REGISTERS A AND B, LEAVE THE
SUM IN REGISTER A.
11010011 D3 OUT ;OUTPUT REGISTER A
00000000 00 0 ;TO PORT 0.
01110110 76 HLT HALT.
Terms

Bit: A bit is a single binary digit.


Word: A word refers to the basic data size or bit size that can be processed by
the arithmetic and logic unit of the processor. A 16-bit binary number is called
a word in a 16-bit processor.
Bus: A bus is a group of wires/lines that carry similar information.
System Bus: The system bus is a group of wires/lines used for communication
between the microprocessor and peripherals.
Memory Word: The number of bits that can be stored in a register or memory
element is called a memory word.
Register: A register is a storage location within the CPU capable of storing data
just as a memory cell can.
Technology Used:

The semiconductor manufacturing technologies used for chips are:


Transistor-Transistor Logic (TTL)
Emitter Coupled Logic (ECL)
Complementary Metal-Oxide Semiconductor (CMOS)
Classification of Microprocessors:

Based on their specification, application and architecture microprocessors


are classified.
Based on size of data bus:
4-bit microprocessor
8-bit microprocessor
16-bit microprocessor
32-bit microprocessor
Machine Cycle Timing Diagrams

Machine cycle is the time required to transfer data to or from memory or


I/O devices. The function of the microprocessor is divided into fetch and
execute cycle of any instruction of a program. Thus, sum of the fetch and
execute cycle is called the instruction cycle.
Example: A routine that will input data from an I/O device at port 3, store this
data at memory address 0700H and halt.
Assembly language routine

ADDRESS OP-CODES MNEMONICS COMMENTS

0000 DB 03 IN 3 INPUT DATA FROM PORT 3 TO


THE ACCUMULATOR

0002 32 00 07 STA 0700 STORE ACCUMULATOR AT PAGE


7 LINE 0

0005 76 HLT HALT


SKETCH THE MACHINE CYCLE TIMING DIAGRAM.
CALCULATE THE TOTAL TIME REQUIRED TO EXECUTE THE
PROGRAM IF THE FREQUENCY IS 2 MHz.

ADDRESS OP-CODES MNEMONICS COMMENTS


0000 MVI A, 32H LOAD
ACCUMULATOR
WITH 32H
OUT 5 OUTPUT THE
CONTENTS OF THE
ACCUMULATOR TO
I/O PORT 5
STA 06FFH STORE THE
ACCUMULATOR AT
MEMORY
LOCATION 06FFH
HLT HALT
Sketch the machine cycle diagram and
calculate the total time required to execute the
program if the system clock frequency is 2.5 MHz.

ADDRESS OP-CODES MNEMONICS COMMENTS

0000 MVI B, FF PUT FF INTO


REGISTER B

DCR B SUBTRACT 1 FROM


B

JNZ 0002 IF THE RESULT IS NOT


ZERO JUMP TO
LOCATION 0002
Based on application:

General-purpose microprocessor- used in general computer system and


can be used by programmer for any application. Examples, 8085 to Intel
Pentium.
Microcontroller- microprocessor with built-in memory and ports and can be
programmed for any generic control application. Example, 8051.
Special-purpose processors- designed to handle special functions required
for an application. Examples, digital signal processors and application-
specific integrated circuit (ASIC) chips.
Based on Architecture:

Reduced Instruction Set Computer (RISC) processors


Complex Instruction Set Computer (CISC) processors
8085 MICROPROCESSOR ARCHITECTURE

The 8085 microprocessor is an 8-bit processor available as a 40-pin IC


package and uses +5 V for power.
It can run at a maximum frequency of 3 MHz.
Its data bus width is 8-bit and address bus width is 16-bit, thus it can
address 216 = 64 KB of memory.
Arithmetic and Logic Unit

The ALU performs the actual numerical and logical operations such as
Addition (ADD), Subtraction (SUB), AND, OR etc. It uses data from memory
and from Accumulator to perform operations. The results of the arithmetic
and logical operations are stored in the accumulator.
Registers

The 8085 includes six registers, one accumulator and one flag register. In
addition, it has two 16-bit registers: stack pointer and program counter.
The 8085 has six general-purpose registers to store 8-bit data; these are
identified as B, C, D, E, H and L. they can be combined as register pairs -
BC, DE and HL to perform some 16-bit operations. The programmer can use
these registers to store or copy data into the register by using data copy
instructions.
Register Organization
Accumulator

The accumulator is an 8-bit register that is a part of ALU. This register is used
to store 8-bit data and to perform arithmetic and logical operations. The
result of an operation is stored in the accumulator. The accumulator is also
identified as register A.
Flag register

The ALU includes five flip-flops, which are set or reset after an operation
according to data condition of the result in the accumulator and other
registers. They are called Zero (Z), Carry (CY), Sign (S), Parity (P) and
Auxiliary Carry (AC) flags. Their bit positions in the flag register are shown in
Fig. 4. The microprocessor uses these flags to test data conditions.
If the result in the accumulator is larger than 8-bit, the flip-flop uses to indicate
a carry or borrow out of the high-order bit CY flag is set to 1.
When an arithmetic operation results in zero, Z flag is set to 1.
The S flag is just a copy of the bit D7 of the accumulator. If the most significant
bit of the result of the operation has the value 1, this flag is set; otherwise it is
reset.
A negative number has a 1 in bit D7 and a positive number has a 0 in 2s
complement representation.
The AC flag is set to 1, when a carry result from bit D3 and passes to bit D4.
The P flag is set to 1, when the result in accumulator contains even number of
1s.
Example #1

If register B = 03H and register A = 03H, what is the state of the flags after
the command SUB B is given?
Example #2

If register B = 80H and register A = 03H, what is the state of the flags after
the command ADD B is given?
Determine the condition of the flag
register.

#2. If register B = 80H and register A = 03H, what is the state of the flags
after the command ADD B is given?

#3. If register B = 01H and register A = FFH, what is the state of the flags
after the command ADD B is given?
Program Counter (PC)
This 16-bit register deals with sequencing the execution of instructions. This
register is a memory pointer. The microprocessor uses this register to sequence
the execution of the instructions. The function of the program counter is to
point to the memory address from which the next byte is to be fetched. When
a byte is being fetched, the program counter is automatically incremented
by one to point to the next memory location.
Stack Pointer (SP)
The stack pointer is also a 16-bit register, used as a memory pointer. It
points to a memory location in R/W memory, called stack. The beginning of
the stack is defined by loading 16bit address in the stack pointer.
Instruction Register/Decoder
It is an 8-bit register that temporarily stores the current instruction of a
program. Latest instruction sent here from memory prior to execution.
Decoder then takes instruction and decodes or interprets the instruction.
Decoded instruction then passed to next stage.
Control Unit
Generates signals on data bus, address bus and control bus within
microprocessor to carry out the instruction, which has been decoded. Typical
buses and their timing are described as follows:

You might also like