Microprocessors
Architecture and Programming
MODULE ONE
www.teachics.org
The Computer Science Learning Platform.
2
● General architecture of computer.
● Introduction to Microprocessor.
● Memory classification.
● Introduction to 8085
● Microprocessor bus organizations(data bus,
address bus, control bus).
● Memory addressing, memory mapping.
Table of Contents. ● 8085 architecture in detail.
● General purpose registers and special purpose
registers, flag register
● 8085 pins and signals.
www.teachics.org
General Architecture of Computer
■ A computer is a programmable device that accepts data as input and process it with a set of instructions
and produce the result as output.
■ A computer consist of four parts
● Input Unit.
● Output Unit.
● Memory Unit.
● Central Processing Unit.
■ Input Unit
● Accept data and instructions from user.
● Digitise received data.
● Supply digitised data to computer system
for processing.
■ Output Unit
● Accept processed data from computer.
● Convert binary data to humanely acceptable
form.
● Supply this result to user.
General Architecture of Computer
■ Memory
● Store data to be processed by the system.
● Store Intermediate result.
● Store final result.
■ Central Processing Unit
● Arithmetic and Logic Unit (ALU).
● Control Unit.
● Register.
■ Arithmetic Logical Unit (ALU)
● Performs all arithmetic and logical operations.
■ Registers
● Temporary storage location within the CPU.
● Use several types of registers for specific
functions.
● Eg: Accumulator, PC, IR, etc.
General Architecture of Computer
■ Control Unit
● Controls and coordinates entire computer
system.
● Fetches instruction from memory.
● Decodes the instruction.
● Execute the instruction.
● Control data transfer between memory and
I/O devices.
■ Buses
● Common communication path.
● Physical group of signal lines that have a
related function.
● Allows transfer of electrical signals between
different components.
● Most used - Three bus architecture. (Data bus,
Address bus, Control bus)
Introduction to Microprocessor
■ A microprocessor(µP) is a multipurpose,
programmable, clock-driven, register based
electronic device.
● Reads binary instructions from memory.
● Accept binary data as input.
● Process data according to the instructions.
● Provide result as output.
■ It is a complete processing unit with
necessary control signals.
■ The number of bits a microprocessor
recognizes and processes at a time is called a
word length.
■ A microprocessor with word length k is
referred to as k-bit microprocessor.
■ Intel 8085 is an 8-bit microprocessor.
(Majority of 8085 instructions are 8 bit)
CPU - Microprocessor - Microcontroller
■ Traditional computer CPU was designed with components on various boards.
■ With IC technology, it became possible to build the CPU on a single chip.
■ A microprocessor is a CPU that happens to be on a single chip.
■ A computer with a microprocessor as a CPU is known as microcomputer.
■ A microcontroller is an entire computer on a single chip (MPU + Memory + I/O Interfacing circuits).
Memory Classification
■ Primary Memory. ■ Secondary Memory.
● Read/ Write Memory. ● Semi Random Access.
● Static RAM - ● Floppy.
● Dynamic RAM. ● Hard disk.
● Read Only Memory. ● CD-ROM.
● Masked ROM. ● Serial Access.
● PROM. ● Magnetic Tape.
● EPROM.
● EE-PROM.
● Flash Memory.
Intel 8085 µP.
www.teachics.org
Introduction to 8085
■ Intel 8085A (simply 8085) is an 8-bit general purpose microprocessor introduced by intel in 1977.
■ It has 40 pins.
■ It requires +5V power supply.
■ It has a clock speed of about 3 MHz.
■ Enhanced version of Intel 8080.
8085 Bus Organization
■ MPU Operations
● Memory Read.
● Memory Write.
● I/O Read.
● I/O Write.
■ Communication with a
peripheral involves,
1 Identify peripheral or
memory location.
2 Transfer data and
instruction.
3 Provide timing and
synchronization signals.
■ The MPU uses three sets of communication lines called buses are used to perform these functions.
■ A bus is a collection of lines, hich perform the same logical task.
8085 Bus Organization
Address Bus
■ Group of 16 bits from A0 to A15. Carries the address of a particular location.
■ Unidirectional- Data flows from MPU to peripheral devices only.
■ Function- Identify peripheral or memory location.
■ Capable of addressing 65536(216) memory locations. (Generally 64K)
Data Bus
■ Group of 8 lines used for data flow. Carries the data to be transfered.
■ Bidirectional- Data flow in both direction between MPU and memory / peripheral devices.
■ Function- Transfer binary data and instruction.
■ Enable the MPU to manipulate 8-bit data ranging from 00 to FF. (28=255)
Control Bus
■ Group of various single lines that carry control signals.
■ MPU Generate specific control signals for every operation.
■ Function- Provide timing and synchronization signals.
8085 Functional Block Diagram (Internal Architecture)
Architecture of 8085
Functional Blocks
■ Registers.
● General Purpose Registers.
● Special Purpose Registers.
● Flag Registers.
■ Arithmetic Logic Unit.
■ Instruction Register and Decoder.
■ Timing and Control Unit.
■ Address Buffer.
■ Address/Data Buffer.
■ Incrementer/Decrementer Address Latch.
■ Interrupt Control.
■ Serial I/O Control.
Registers
■ Used by the microprocessor for temporary storage and manipulation of data and instructions.
■ General Purpose Registers
● 6 general purpose registers - B, C, D, E, H and L.
● Stores 8-bit data.
● Can be used by the programmer.
● Can be combined as register pairs- BC, DE and HL - to store 16-bit data.
■ Special Purpose Registers
● Accumulator (A)
● 8-bit register.
● Part of ALU.
● Stores result of an operation.
● Instruction Register(IR)
● 8-bit register.
● Hold the operation code of the instruction which is being decoded and executed.
● Not programmable.
Registers
■ Special Purpose Registers
● Program Counter(PC)
● 16-bit register.
● Stores the address of the next instruction.
● Stack Pointer(SP)
● 16-bit register.
● Points to a memory location in R/W memory called the stack.
● Beginning of the stack is defined by loading the address into SP.
● Temporary Register and W and Z Registers.
● 8-bit register(s).
● Used by microprocessor to store data temporarily.
● Internally used for execution of instructions.
● Cannot be accessed by the programmer.
Registers
■ Flag Registers
● Flag registers are special purpose registers that indicate status conditions.
● Flags are set or reset after an operation to indicate the data condition of the result.
Flag Flag is set to 1 when
Z Zero The result is 0.
CY Carry An arithmetic operation results in carry.
S Sign Bit D7 of the result is 1.
P Parity The result has an even number of 1s.
AC Auxiliary Carry A carry is generated by digit D3 and passed to digit D4. (Intermediate Carry)
Architecture of 8085
■ Arithmetic/ Logic Unit
● Performs the computing functions.
● It includes accumulator, temporary register, the arithmetic and logic circuits and five flags.
■ Instruction Register and Decoder
● The instructions that is fetched from memory is loaded in the instruction register.
● The decoder decodes the instruction and establishes the sequence of events to follow.
■ Address Buffer
● 8-bit unidirectional bus.
● Drive external high-order address bus (A15-A8).
■ Address/Data Buffer
● 8-bit bidirectional bus.
● Drive multiplexed address/data bus (AD7-A0).
Architecture of 8085
■ Incrementer/ Decrementer Address Latch
● 16-bit register.
● Used to increment or decrement the contents of PC or SP.
■ Interrupt Control
● Controls interrupts.
■ Serial I/O Control
● Provides control signals for serial communication.
● SID- Serial Input Data.
● SOD- Serial Output Data.
■ Timing and Control Unit
● Synchronizes all the microoperations with the clock and generate control signals necessary for
communication between microprocessor and peripherals.
8085 PIN Diagram
8085 Pins & SIgnals
■ Control and Status Signals.
● ALE - Address Latch Enable: A positive going pulse generated every time the 8085 begins an
operation(machine cycle).
It indicates that the AD7-AD0 bits are address bits (A7 - A0)
● - Read: Indicates that the selected I/O or memory device is to be read and data are available on
the data bus.
● - Write: Indicates the data data on the bus are to be written into a selected memory or I/O
location.
● - When it is high, it indicates an I/O operation. When it is low it indicates a memory operation.
● S1 and S0 - Status signals similar to . They are rarely used in small systems.
S1 S2 Operation
0 0 Halt
0 1 Write
1 0 Read
1 1 Fetch
8085 Pins & SIgnals
■ Power Supply and Clock Frequency Signals.
● Vcc - +5V Power Supply.
● Vss - Ground Reference.
● X1, X2 - A crystal (or RC, LC network) is connected at these two pins. (Used to give external input to
generate clock internally)
● CLK (OUT) - Clock Output: Can be used as the system clock for other devices.
■ Serial I/O Ports.
● 8085 has two signals SID (Serial Input Data) and SOD (Serial Output Data).
● In serial transmission, data bits are sent over a single line, one bit at a time.
8085 Pins & SIgnals
■ Interrupts and Externally Initiated Signals.
● (Input) - Interrupt Request.
● (Output) - Interrupt Acknowledge.
● RST 7.7, RST 6.6, RST 5.5 - Restart Interrupts : Vectored interrupts that transfer the program control
to specific memory locations.
● TRAP (Input) - Nonmaskable interrupt that has highest priority.
● HOLD (Input) - Indicates that a peripheral controller is requesting access the use of the address and
data buses.
● HLDA (Output) - Hold Acknowledge : Signal acknowledges the HOLD request.
● READY (Input) - Used to delay the microprocessor Read or Write cycles until a slow-responding
peripheral is ready to send or accept data.
● - When this signal goes low, the PC is set to 0 and MPU is RESET.
● RESET OUT - Indicates that the MPU is being reset. This can be used to reset other devices.
Thank You.
The Computer Science Learning Platform.
25