Presentation 1
Presentation 1
Microprocessors and
Microcomputers
Part 1
1.1 Introduction
● The microprocessor is a single chip microcomputer.
● All functional components of a computer are inbuilt on a single chip using VLSI technology
● It consists of:
○ Register unit
○ Control Unit
● The microprocessors are generally characterized by speed, word length, architecture and
instruction set.
1.2 Computer Languages
Computer languages are the languages which a computer can understand. Computer
languages can be classified as high-level language and low-level language.
● Low-level Language
○ Machine Language
○ Assembly Language
● High-Level Language
1.2.1 Low-level Language
● Low-level languages are Machine-oriented Languages.
○ Machine-Dependent Languages : programming language is designed for a particular
computer.
● They cannot be easily converted to run on a computer with a different central processing
unit
● Relatively difficult to learn.
1.2.2 Low-level Language - Machine Language
● Instructions are written in binary.
● The only languages understood by computers.
● Replaced by a mnemonic-based low-level language known as assembly language.
1.2.3 Low-level Language - Assembly Language
● Instructions in assembly language are written in English alphabets but in coded form.
● An assembly language contains the same instructions as a machine language, but the
instructions and variables have names instead of being just numbers.
● For example, the binary-code instruction 13H (0001 0011) may be replaced by the
mnemonic STA:
○ It means store the contents of the accumulator in memory.
● The conversion from Assembly languages to machine languages is done either by
manually or by a software program known as assembler.
1.2.4 High-level Language
● High-level languages are machine independent languages.
● Programs written for a particular machine can run on other machines also.
● These high-level languages are also known as problem-oriented languages because they
are designed to solve particular problems.
● Easier to read, write, and maintain.
● Programs written in high-level languages are converted into machine language by an
interpreter or a compiler.
1.3 Microprocessor
● Programs written in high-level languages are converted into machine language by an
interpreter or a compiler.
● The word micro was introduced to signify the size of the processing unit.
● Microprocessor is a complex IC of sequential circuits made up of VLSI technology.
● It is a programmable logic device, designed with registers, flip-flops, and timing
elements.
● It has a set of instructions designed to manipulate data and communicate with
peripherals.
1.3 Microprocessor Cont’d
● The process of data manipulation and communication with peripherals is determined by
the logic design of the microprocessor.
● The logic design of the microprocessor is called microprocessor architecture.
● the microprocessor consists of three parts, viz. Arithmetic and
Logic Unit (ALU), Register Unit (RU) and Control Unit (CU).
1.3.1 Arithmetic and Logic Unit
● In the Arithmetic and Logic Unit, The computing functions are performed on the data.
● The ALU performs arithmetic operations such as addition and subtraction, and logic
operations such as AND, OR and EX-OR.
● The Results are stored in the registers or in memory unit or send to output unit.
1.3.2 Register Unit
● This area of the microprocessor consists of various registers.
● The registers are used for temporary storage of data during execution of a program.
● Some of the registers are accessible to the users through various instructions.
1.4 MICROPROCESSOR OPERATIONS
● The process of data manipulation and communication with peripherals is determined by
the logic design by the microprocessor, the logic design is called architecture.
● All of the operations of the microprocessor can be classified into one of three types:
○ Microprocessor initiated operations
○ Internal Operations
○ Peripheral Initiated Operations
1.4.1 Microprocessor Initiated Operations
● These are the operations that the microprocessor starts itself.
● These are the operations which are initiated by the microprocessor and the peripheral
devices will execute these operations.
● These are usually one of the following operations:
○ Memory Read: Reads data from memory
○ Memory Write: Writes data into the memory
○ IOR: Accepts data from input devices
○ IOW: Sends data to output devices.
1.4.1 Microprocessor Initiated Operations
● All these operations are part of the communication process between microprocessor and
peripheral devices or memory.
● To perform these communication operations, microprocessor unit executes the following
steps:
○ Identify the address of memory location or the peripheral device
○ Provide timing or synchronization signals
○ Transfer the data
1.4.1 Microprocessor Initiated Operations
● The microprocessor performs the above three functions through the communication
lines called system bus (bunch of wires).
● As three types of information are communicated, hence there are three types of buses.
These buses are:
○ Address Bus
○ Data Bus
○ Control Bus
1.4.1 Microprocessor Initiated Operations
● Address bus: It carries the address of a memory location or I/O devices that the MPU
wants to access. It is a unidirectional bus (from MPU to peripheral) generally denoted
by A.
● Data bus: It is used to transfer data between the processor and memory and I/O devices.
It is bidirectional in nature.
● Control bus: It is used to carry control signals between MPU and various devices
connected to it. It also carries synchronization and timing signals. The bus is somewhat
confusing term for it. In fact, these are individual lines that provide signals to the
devices connected to microprocessor.
1.4.1 Microprocessor Initiated Operations
1.4.2 Internal Data Operations
- Operations internally performed by the microprocessor.
- The internal architecture of microprocessor determines how and what operations can be
performed with the data.
- The internal operations are classified into five groups:
1. Store 8-bit data (Register Unit).
2. Perform arithmetic and logic operations (Accumulator Register).
3. Test for the conditions (Flag Register).
4. Sequence the execution of instructions (Program Counter).
5. Store data temporarily during the execution in the defined R/W memory locations
called stack (Stack Pointer).
1.4.2 Internal Data Operations Cont’d
To perform these operations we require registers, ALU and control logic and path for
communication, i.e. bus system.
To perform the first operation, i.e. to store 8-bit data, microprocessor has the register unit.
1.4.2 Internal Data Operations: Register unit
- Microprocessor 8085 has six 8-bit general purpose data registers.
- During program execution these registers are used to store 8 or 16-bit data.
- These registers are identified as B, C, D, E, H, and L.
- If during some operation microprocessor deals with 16-bit data, then these registers can
be paired.
1.4.2 Internal Data Operations: Register unit
- These registers are programmable: User can use them to load copy and move data from
the registers by using instructions, e.g. MOV B, C
- These registers can be considered as memory location as they are in the microprocessor,
expects they are named by alphabet for the user convention.
- Some microprocessors do not have these registers. They use Memory Locations instead.
- To perform the second operations, i.e. to perform arithmetic and logic operations,
microprocessor has ALU and a register called Accumulator A.
1.4.2 Internal Data Operations: Accumulator
- The accumulator is an 8-bit general purpose register which is the part of ALU.
- This register is used to store 8-bit data to perform arithmetic and logical operations.
- Accumulator participates in all the arithmetic and logical operations.
- After the operation the result is stored in the accumulator.
- Accumulator is the only register which communicates with IO.
- Accumulator is also identified as register A.
- To perform the third operation, i.e. to test the condition, if any, microprocessor has
another 8-bit register called flag register.
1.4.2 Internal Data Operations: Flag register
The flag register is an 8-bit register. These 8-bits of this register are independent bits. Out of
these 8-bits, five are used to represent five different data conditions.
1. Carry flag: If after an arithmetic operation the result in the accumulator is greater than
8-bits, then carry flag is set, i.e. CF = 1, otherwise it is 0.
2. Zero Flag: If after an arithmetic operation the result in the accumulator is zero, then zero
flag is set, i.e. ZF = 1, otherwise 0.
3. Sign flag: If after an arithmetic operation the MSB(Most Significant Bit) of the result in
the accumulator is 1, then sign flag is set, i.e. SF = 1, otherwise 0.
1.4.2 Internal Data Operations: Flag register
4. Parity flag: If after an arithmetic operation the result contains even number of 1s, then
parity flag is set, i.e. PF = 1, otherwise 0.
5. Auxiliary flag: This status flag is set when there is a carry from bit 3 to 4.
These five flip-flops or status flags are set or reset according to the result of operation. The
microprocessor uses them to perform the testing or setting for data conditions.
To perform the fourth operation, microprocessor 8085 has another register called program
counter.
1.4.2 Internal Data Operations: Program counter
- This is a 16-bit register that deals with the fourth operation of the list, i.e. sequencing the
execution of instructions.
- This register is a memory pointer.
- The function of the program counter is to point the memory address from which the next
byte is to be fetched.
- When one byte is being fetched, the contents of the program counter is increased by 1 to
point the next memory location.
- Memory locations have 16-bit address, that is why this register is of 16-bit.
- To perform the fifth operation of the microprocessor internal operations, microprocessor
8085 has another register called stack pointer (SP).
1.4.2 Internal Data Operations: Stack pointer
- The stack pointer is also a 16-bit memory address register used as memory pointer in the
stack memory.
- The stack memory is predefined (defined by the user) in R/W memory.
- The stack memory is initialized by the programmer a 16-bit address in the stack pointer.
- The stack pointer is automatically incremented by two with each withdrawal of a 16-bit
data and decremented by 2 by each loading of 16-bit data on to the stack memory.
Warning On Chapter One
This chapter is made with 8085 in mind, and it’s internally different from 8086.