Microprocessors and Computer Applications
Microprocessors and Computer Applications
COMPUTER
APPLICATIONS
RA
REF. BOOKS
TEXT BOOK
1.Microprocessor Architecture Programming and
Applications with the 8085
By Ramesh. S. Gaonkar.
2.Microprocessors and Microcomputers
By B Ram
RA
CHAPTER-1
MICROCOMPUTER ARCHITECTURE
OBJECTIVES
1. Digital Computer-an Introduction
2. Microcomputer
3. Microprocessor
4. Computer Terminology
5. Technology employed in Computers
6. Machine, Assembly and High-level languades.
RA
1.1 DIGITAL COMPUTERS: AN INTRODUCTION
RA
INPUT UNIT CPU OUTPUT UNIT
(CENTRAL PROCESSING UNIT)
MEMORY
RA
BLOCK DIAGRAM:
• It consists of four sections: CPU, Memory, Input
and Output
• CPU: It is a brain of a computer and it is capable
of performing, computing and making during
decision program execution. Basically, the CPU
controls the operation of the computer.
• Input Unit: It allows the computer to take in data
from the outside world. Ex. Keyboard, Teletype,
a video unit, a card reader, A/D converter etc.
RA
• Output Unit: It transfers the processed data
from the CPU to the output devices such as
LEDs, CRTs, Video monitors, Line printers etc.
• Memory: It stores the information of program
and data. It provides the information to the CPU
whenever necessary
• Thus a digital computer is an interconnected
system of processors (CPU), memories and
input/output devices.
RA
BASIC BLOCKS OF A MICROCOMPUTER
RA
ROM RAM INPUT OUTPUT
Microcomputer
CPU
RA
Central Processing Unit (CPU)
The CPU executes all the instructions and
performs arithmetic and logic operations on
data. The CPU of microcomputer is called the
microprocessor. The MOS microprocessor is
typically a single LSI chip that contains all of the
control, arithmetic and logic circuits of the
microcomputer.
RA
KEY TERMINOLOGY
• BIT: An abbreviation for binary digit ‘0’ or ‘1’
• BYTE: A group of eight bits
• NIBBLE: A group of four bits
• WORD: A group of bits that the computer recognises
• INSTRUCTION: It is a command to perform a
particular task.
• MNEMONIC:
• PROGRAM
• MACHNINE LANGUAGE
RA
KEY TERMINOLOGY
• ASSEMBLY LANGUAGE
• LOW LEVEL LANGUAGE
• HIGH LEVE LANGUAGE
• SOURCE CODE
• COMPILER
• INTERPRETER
• ASSEMBLER
RA
KEY TERMINOLOGY
• MANNUAL ASSEMBLY
• ASCII
• EXTENDED ASCII
• PERATING SYSTEM
• MONITOR PROGRAM
RA
Key Terminology
• Hardware
– Refers to objects that you can actually touch, like disks,
display screens, keyboards, printers, boards and chips
• Software
– Computer instructions or data
– Anything that can be stored electronically is software.
– Books provide a useful analogy. The pages and the ink are the
hardware, while the words, sentences, paragraphs, and the
overall meaning are the software
RA
Key Terminology (Continued)
• Program
– An organized list of instructions that, when executed,
causes the computer to behave in a predetermined
manner
– Without programs, computers are useless
• Data
– Distinct pieces of information, usually formatted in a
special way
– All software is divided into two general categories: data
and programs
RA
Key Terminology (Continued)
• Instruction
– A basic command to perform a specific task.
– Often used to describe most rudimentary programming
commands.
• Instruction Set
– The basic set of commands, or instructions, that a microprocessor
understands.
– One of the principal characteristics that separates for reduced
instruction set computer (RISC) from complex instruction set
computer (CISC) microprocessors is the size of the instruction set
RA
Computers
• Computers are comprised of primary
components that include:
– Microprocessor/CPU that performs the
arithmetic functions and control the flow of
data.
– Memory that retains information for later use.
– Input/Output devices that interface with
external components and devices.
RA
Elements of the Basic Computer
MPU
MPU
Arithmetic
Logic
Unit
Control
Clock RA
Memory
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
RA
RA
Memory
• Memory is used to hold programming
instructions and data for the system to
process.
RAM
ROM
RA
RAM
• Random Access Memory (RAM) is a type of IC
that holds data or instructions on a temporary
basis. Binary 1’s and 0’s are held electrically as
highs and lows. This type of memory is
volatile, meaning that the contents will
disappear when the system is turned off.
• RAM contains the information that needs to be
accessed quickly or repeatedly. Sometimes
referred to in digital electronics as “read/write
memory”, its contents can be changed quickly.
RA
ROM
• Read Only Memory (ROM) is a type of IC
which holds information on a permanent basis.
The contents of the ROM isn’t altered by the
computer system, nor will it disappear when the
system is shut down.
Control
Clock
RA
BUSES
A bus is a common connection point, usually in the
form of a set of conductors. In computers,
information must be moved between various
components in a parallel fashion. Buses are
connected to each of these devices in common.
RA
BUSES
RA
BUSES
• There are three main buses on any computer
system:
– Address bus: Carries destination information for
data.
– Data bus: Carries program instructions or data.
– Control bus: Responsible for the overall control
and synchronization of the computer system.
RA
Input/Output
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
Input/Output
• Input/output devices (I/O) are devices that supply
data, or receive processed data from the computer
system.
Control
Clock
RA
Clock
• The clock is the device that provides the
necessary edges and levels for all the device
blocks in the computer to operate.
• Part of the clock circuitry is generally located
in the P, with an external connection for an
oscillator crystal or other frequency generator.
CPUs each have maximum and minimum
requirements for oscillator frequency.
• The P provides clocking to the rest of the
devices in the computer.
RA
MPU/CPU
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
What Is A Microprocessor
RA
What Is A Microprocessor
.The transistors work together to store and
manipulate data so that the microprocessor can
perform a wide variety of useful functions
. The particular functions a microprocessor performs
are dictated by software
. One most common task microprocessors perform
is to serve as "brains" inside personal computers
(PC), but they deliver "intelligence" to other devices
as well
RA
The Microprocessor
• Microprocessors are available from many manufacturers
and range from 4-bit units for simple device operations to
powerful 64- bit microprocessors found in modern desktop
computers.
• Microprocessors are also rated by their processing speeds.
As we will see, processing speeds can vary significantly
between different microprocessors. Often they’re rated by
the clock frequency at which they can operate, or by the
number of instructions per second (ips) they can process.
RA
MPU Evolution
• There have been different stages of evolution for the
microprocessors. These stages are referred to as
generations. The Ps are classified based on:
– operational speeds
– number of bits they can handle
– their complexity (number of transistors).
RA
MPU Evolution
Model Year of No. of Transistors
Introduction
4004 1971 2,250
8008 1972 2,500
8080 1974 5,000
8085 1974 6,500
RA
MPU Evolution
PC's CPU Year # Transistors
1st. Generation 8086 and 8088 1978-81 29,000
RA
Moore’s Law
Dr. Gordon E. Moore, Chairman Emeritus of Intel
Corporation, predicted that
no. of transistors per integrated circuit would
double every 18 months
RA
RA
The CPU
• The CPU is the main logic unit of the P. It:
– Executes program instructions
– Manipulates data in internal registers and caches
– Performs basic mathematical operations (add, subtract,
compliment)
– Puts addresses on the address bus
– Reads instructions from the data bus
– Coordinates the operation of all support IC’s and
devices
– Sets the timing for the entire system
RA
The CPU Module
• The CPU module contains 3 basic
elements:
– ALU
– Control
– Registers
RA
Registers
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
Registers
• Registers are a temporary storage location for data.
RA
Registers
• The arithmetic logic unit utilizes a register, and
registers are used keep track of important
addresses, such as the location of the next
instruction to be executed. The registers retain the
location of an area of memory known as a stack.
RA
ALU
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
The ALU
• The ALU (Arithmetic/Logic Unit) is the area of
the CPU that performs all arithmetic
operations.
RA
Clock
MPU
Arithmetic
Logic
Unit
Control
Clock
RA
• Control
Control
– This area directs and controls the flow of
information between all the devices.
– The Control unit fetches data by providing
enable/disable signals, address locations and
read/write commands.
– It decodes and executes operations by
providing the appropriate control and address
signals to other devices.
Fetch Execute
RA
Instructions
• Microprocessors are digital devices that are
wired to create a specific set of outputs based
on their inputs.
• The input to these devices is in the form of:
– a program, or a set of instructions, to provide
the operation desired. Referred to as the
OPCODE.
– data that needs to be manipulated, referred to
as the OPERAND.
RA
NUMBER SYSTEMS
• DECIMAL
• BINARY
• OCTAL
• HEXADECIMAL
• CONVERSION OF DECIMAL TO BINARY & VICE VERSA
• CONVERSION OF DECIMAL TO OCTAL & VICE VERSA
• CONVERSION OF DECIMAL TO HEXADECIMAL & VICE
VERSA
• CONVERSION OF OCTAL TO BINARY AND VICE VERSA
• CONVERSION OF HEXADECIMAL TO BINARY & VICE
VERSA.
RA
The 8085 microprocessor
RA
Intel 8085
• The Intel 8085 was first introduced in March
1976.
• It’s an 8 bit, NMOS Microprocessor.
• It’s a 40 pin I.C. package fabricated on a single
LSI chip.
• The 8085 runs on a 5 volt supply.
• Its clock speed is about 3 to 5MHz and can
perform 0.37MIPS.
• It has 80 basic instructions and 246 opcodes.
RA
8085
• The 8085 was chosen for our look into the
microprocessor:
– it’s still in use
– it’s easy to use
RA
The internal operation of the
8085 microprocessor
RA
8085 Internal Diagram
RA
RA
8085 Internal Diagram
It includes
• ALU (Arithmetic /Logic Unit)
• Timing & Control Unit
• Instruction register and Decoder
• Register array
• Interrupt control
• Serial I/O control
• Address and data bus
RA
ALU
(Arithmetic Logic Unit)
RA
ALU
• The ALU performs many of the functions that involve arithmetic
and logic operations.
– Arithmetic:
• Add
• Subtract
• Increment
• decrement
– Logic:
• AND
• OR
• XOR
• Complement (NOT)
• Left shift, Right shift, Rotate Left, Rotate Right
• Clear etc.
RA
Arithmetic
• The Arithmetic component can only perform
addition, yet it can perform all other operations:
RA
Registers
• Registers are used by the microprocessor
for temporary storage and manipulation of
data and instructions.
• Data remain in the registers till they are
sent to the memory or I/O devices.
• In a large computer the number of registers
is more and hence the program requires less
transfer of data to/from memory.
RA
Registers
RA
The 8085:
Registers
RA
Accumulator
• The register ‘A’ in the 8085 is an Accumulator or Acc.
• 8-bit Register
• It is used hold one of the operands of an arithmetic or
logical operation and the other operand may be in the
memory or in one of the Gen. Purpose Register.
• It stores the results of an arithmetic operation or a logic
operation.
• Exceptional cases: Some Logical inst. Which need
only one operand. It is held in Acc.
• The typical inst. DAD rp for 16-bit addition. The 16-
bit operand are kept in H-L pair and the other in the B-
C or D-E pair. The result is placed in the H-L pair.
RA
FLAG Register
D7 D6 D5 D4 D3 D2 D1 D0
S Z X AC X P X CY
X- Undefined Bits
RA
FLAG Register
•The Intel 8085 contains five flip-flops to serve as
status flags.
•The flip-flops are set or reset according to the
conditions which arise during an arithmetic or logical
operation.
•The five status flags of Intel 8085 are:
Carry Flag (CY)
Parity Flag (P)
Auxiliary Carry Flag (AC)
Zero Flag (Z)
Sign Flag (S) RA
FLAG Register
• CY-Carry flag: If an arithmetic operation results in carry, the carry flag
is set; otherwise it is reset.
• P-Parity flag: After an arithmetic or logical operation, if the result has
an even number of 1s, the flag is set. If it has odd number of 1s, the
flag is reset.
• AC-Auxiliary Carry Flag : In arithmetic operation, when a carry is
generated by digit D3 and passed on to digit D4, the AC flag is set.
The flag is used only internally for BCD operations and is not available
for the programmer to change the sequence of program with jump inst.
• Z-Zero flag: The Zero flag is set if the ALU operation result in ‘0’ and
the flag is reset if the result is not ‘0’
• S-Sign flag: After the execution of an arithmetic or logical operation, if
bit D7 of the result (Usually in the Acc) is 1, the Sign flag is set. This
flag is used with signed numbers.
RA
General Purpose Registers
• The 8085 microprocessor contains six 8-bit general-
purpose registers.
• They are: B, C, D, E, H and L register.
• To hold 16-bit data a combination of two 8-bit
registers can employed.
• The combination of two 8-bit registers is known as a
register pair.
• The valid register pairs are: B-C, D-E and H-L.
• The H-L pair is used to act as memory pointer.
• These registers are accessible to programmer.
RA
Program Counter (PC) Register
• It is a 16-bit special-purpose register.
• It is used to hold memory address of the next
instruction to be executed.
• It keeps track of the addresses of the instructions
as they are being fetched from memory.
• The microprocessor increments the contents of
the PC during execution of an instruction, so that
it points to the address of the next instruction in
the program at the end of the execution of an
instruction.
RA
Stack Pointer
• It a 16-bit register. This is used to point to a
memory location in R/W memory called the stack.
• Stack is set of memory location set aside by the
programmer to store/retrieve the contents of the
Accumulator, Flags, Program counter and General
Purpose Registers during the program execution.
• Stack works on LIFO (Last-in-first-out) principle.
• SP holds the address of the stack top element of
data stored in the stack
RA
Stack & Stacktop location
2600
2601
2602
2603 NEXT AVAILABLE
LOCATION
2604
2605 STACKTOP LOCATION
2606 SP
2607 X X 2607
RA
Temporary Register
• The temporary register is used to transfer data to the
ALU.
• It usually contains the second value required for
arithmetic operations.
• It is not accessible to programmer
Instruction Register
It is an 8-bit reg.
It holds the opcode or instruction code of the
instruction which is being decoded and executed.
It is not accessible to programmer.
RA
Timing & Control Unit
RA
Timing & Control
• It is a section of CPU.
• It generates timing and control signals which are
necessary for the execution of an instructions.
• It controls the data flow between CPU and
peripherals (including memory)
• It provides Status, control and timing signals which
are required for the operation of memory and I/O
devices.
• It controls the entire operations of the
microprocessor and peripherals connected to it.
RA
Data and Address Bus
• The Intel 8085 is an 8-bit microprocessor.
• Its data bus is 8-bit wide i.e. 8-bits of data can be
transmitted in parallel from or to the MP.
• The Intel 8085 requires a 16-bit wide address bus as
the memory addresses are of 16-bits.
• AD7-AD0 – Multiplexed Low order Address/Data bus.
• A15-A8 – High order address bus.
• 216 (=65536=64K, where 1K=1024) memory
locations can be addressed directly by Intel 8085.
• Each memory location contains 1-byte of data.
Address &
Data bus
RA