0% found this document useful (0 votes)
18 views31 pages

Micro Electronics

The document provides an overview of micro-electronics including microprocessor systems, evolution and architecture, microcomputer memories, and programming. It discusses components of a microcomputer system, evolution of microprocessors, memory types, and developing assembly language programs.

Uploaded by

mwahspice
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views31 pages

Micro Electronics

The document provides an overview of micro-electronics including microprocessor systems, evolution and architecture, microcomputer memories, and programming. It discusses components of a microcomputer system, evolution of microprocessors, memory types, and developing assembly language programs.

Uploaded by

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

CEE Mod II Micro- electronics

MICRO - ELECTRONICS

[email protected] +254724410325 Page 1


CEE Mod II Micro- electronics

COURSE OUTLINE
MICROPROCESSOR SYSTEM Introduction
 Micro-computer terminologies This unit is designed to equip the trainee with knowledge, skills and
 Components of computer system attitudes on computer hardware memories and programming. This module
MICROPROCESSOR OR EVOLUTION AND ARCHITECTURE unit is based heavily on Intel 8085 microprocessor. Trainees require basic
 Microprocessor families and their characteristics electronic to improve the understanding of the content of this unit.
 Intel 8085 microprocessor architecture
MICROCOMPUTER MEMORIES General Objectives
 Memory terminologies By the end of the module unit, the trainee should be able to:
 Construction of primary memories a) Understand components of a microcomputer system.
 Memory organization • Backing store memories b) Embrace a culture of computer maintenance
PROGRAMMING c) discuss evolution of microprocessors
 Assembly language program d) appreciate microcomputer memories
 Hand coding e) develop computer programs

Zack Mukindia

References

1. Microprocessor Architecture, Programming and Applications with

the 8085 6/e Paperback – 1 October 2013 by by Ramesh Gaonkar


2. Microprocessor 8085 Architecture, Programming and Interfacing by
Ajay Wadhwa

[email protected] +254724410325 Page 2


CEE Mod II Micro- electronics

1.0 MICROPROCESSOR SYSTEMS operations on the numbers that depend on the microprocessor’s
Introduction – design.
 A Microprocessor is a multipurpose programmable, clock driven,  Thus microprocessor can be defined as a programmable device
register based electronic device that reads binary instructions from a that takes in numbers, performs on them arithmetic or logical
storage device called memory, accepts binary data as input, operations according to the program stored in memory and then
processes data according to those instructions and provide result s produces other numbers as a result.
as output.  Programmable device: The microprocessor can perform different
 Microprocessor by definition means that this is only the central sets of operations on the data it receives depending on the sequence
processing unit, with instruction decoder, registers and Arithmetic of instructions supplied in the given program. By changing the
Logic processing Unit. A CPU does not include any memory or I/O program, the microprocessor manipulates the data in different ways.
components.  Instructions: Each microprocessor is designed to execute a specific
 The microprocessor operates in binary 0 and 1 known as bits are group of operations. This group of operations is called an
represented in terms of electrical voltages in the machine that instruction set. This instruction set defines what the microprocessor
means 0 represents low voltage level and 1 represents high voltage can and cannot do.
level.  Takes in: The data that the microprocessor manipulates must come
 Each microprocessor recognizes and processes a group of bits from somewhere. It comes from what is called “input devices”.
called the word and microprocessors are classified according to These are devices that bring data into the system from the outside
their word length such as 8 bits microprocessor with 8 bit word and world. These represent devices such as a keyboard, a mouse,
32 bit microprocessor with 32 bit word etc. For example, Intel 8085 switches, and the like.
is 8-bit microprocessor and Intel 8086/8088 is 16-bit  Numbers: The microprocessor has a very narrow view on life. It
microprocessor. only understands binary numbers. A binary digit is called a bit
What is a Microprocessor? (which comes from binary digit). The microprocessor recognizes
 The word comes from the combination micro and processor. o and processes a group of bits together. This group of bits is called a
Processor means a device that processes whatever. In this context “word”. The number of bits in a Microprocessor’s word, is a
processor means a device that processes numbers, specifically measure of its “abilities”. A group of 8-bits were referred to as a
binary numbers, 0’s and 1’s. o “half-word” or “byte”. A group of 4 bits is called a “nibble”. Also,
 To process means to manipulate. It is a general term that describes 32 bit groups were given the name “long word”.
all manipulation. Again in this content, it means to perform certain  Words, Bytes, etc.: The earliest microprocessor (the Intel 8088 and
Motorola’ 6800) recognized 8-bit words. They processed
[email protected] +254724410325 Page 3
CEE Mod II Micro- electronics

information 8-bits at a time. That’s why they are called “8-bit  Produces: For the user to see the result of the execution of the
processors”. They can handle large numbers, but in order to program, the results must be presented in a human readable form.
process these numbers, they broke them into 8-bit pieces and The results must be presented on an output device. This can be the
processed each group of 8-bits separately. Later microprocessors monitor, a paper from the printer, a simple LED or many other
(8086 and 68000) were designed with 16-bit words. Today, all forms.
processors manipulate at least 32 bits at a time and there exists Basic Block Diagram of a Computer
microprocessors that can process 64, 80, 128 bits. Traditionally, the computer is represented with four components such as
 Arithmetic and Logic Operations: Every microprocessor has memory, input, output and central processing unit (CPU) which consists of
arithmetic operations such as add and subtract as part of its arithmetic logic unit (ALU) and control unit (CU).
instruction set. Most microprocessors will have operations such as
multiply and divide. Some of the newer ones will have complex
operations such as square root. In addition, microprocessors have
logic operations as well. Such as AND, OR, XOR, shift left, shift
right, etc. Again, the number and types of operations define the
microprocessor’s instruction set and depends on the specific
microprocessor.
 Stored in memory: Memory is the location where information is
kept while not in current use. Memory is a collection of storage
devices. Usually, each storage device holds one bit. Also, in most
kinds of memory, these storage devices are grouped into groups of
 The CPU contains various registers to store data, the ALU to
8. These 8 storage locations can only be accessed together. So, one
perform arithmetic and logical operations, instruction decoders,
can only read or write in terms of bytes to and from memory.
counters and control lines. The CPU reads instructions from
Memory is usually measured by the number of bytes it can hold.
memory and performs the tasks specified.
When a program is entered into a computer, it is stored in memory.
 It communicates with input/output (I/O) devices either to accept or
Then as the microprocessor starts to execute the instructions, it
to send data, the I/O devices is known as peripherals.
brings the instructions from memory one at a time. Memory is also
 Later on around late 1960’s, traditional block diagram can be
used to hold the data. The microprocessor reads (brings in) the data
replaced with computer having microprocessor as CPU which is
from memory when it needs it and writes (stores) the results into
known as microcomputer.
memory when it is done.
[email protected] +254724410325 Page 4
CEE Mod II Micro- electronics

 Here CPU was designed using integrated circuit technology (IC’s) support circuits are often built into, or embedded in, the devices
which provided the possibility to build the CPU on a single chip. they control.
 Embedded system is a computer system designed to perform one
or a few dedicated functions often with real-time computing
constraints.
Organization of a microprocessor based system
Microprocessor based system includes there components microprocessor,
input/output and memory (read only and read/write). - These components
 Later on semiconductor fabrication technology became more are organized around a common communication path called a bus
advanced, manufacturers were able to place not only MPU but also
memory and I/O interfacing circuits on a single chip known as
microcontroller, which also includes additional devices such as A/D
converter, serial I/O, timer etc.
 Microcontroller (µC) is a highly integrated chip, which includes
on single chip, all or most of the parts needed for a controller.
 It is a specialized form of microprocessor that is designed to be self-
sufficient and cost-effective which is part of an embedded system
that is essentially the whole circuit board.

Microprocessor: It is clock driven semiconductor device consisting of


electronic logic circuits manufactured by using either a large scale
integration (LSI) or very large scale integration (VLSI) technique. It is
capable of performing various computing functions and making decisions
to change the sequence of program execution. It can be divided in to three
segments.
 The embedding is part of a complete device often including  Arithmetic/Logic unit: It performs arithmetic operations as
hardware and mechanical parts i.e. the microcontroller and its addition and subtraction and logic operations as AND, OR & XOR.

[email protected] +254724410325 Page 5


CEE Mod II Micro- electronics

 Register Array: The registers are primarily used to store data Control signals determine which register is selected by the bus during each
temporarily during the execution of a program and are accessible to particular register transfer.
the user through instruction. The registers can be identified by
letters such as B, C, D, E, H and L.
 Control Unit: It provides the necessary timing and control signals
to all the operations in the microcomputer. It controls the flow of
data between the microprocessor and memory & peripherals.
Memory: Memory stores binary information such as instructions and data,
and provides that information to the up whenever necessary. To execute
programs, the microprocessor reads instructions and data from memory and
performs the computing operations in its ALU. Results are either Although there are many different bus designers, on any bus, the lines can
transferred to the output section for display or stored in memory for later be classified into three functional groups; data, address and control lines. In
use. Memory has two sections. addition, there may be power distribution lines as well.
 Read only Memory (ROM): Used to store programs that do not  The data lines provide a path for moving data between system
need alterations and can only read. modules. These lines are collectively called data bus.
 Read/Write Memory (RAM): Also known as user memory which is  The address lines are used to designate the source/destination of
used to store user programs and data. The information stored in this data on data bus.
memory can be easily read and altered.  The control lines are used to control the access to and the use of the
Input/Output: It communicates with the outside world using two devices data and address lines. Because data and address lines are shared by
input and output which are also Known as peripherals. The input device all components, there must be a means of controlling their use.
such as keyboard, switches, and analog to digital converter transfer binary Control signals transmit both command and timing signals indicate
information from outside world to the microprocessor. The output devices the validity of data and address information. Command signals
transfer data from the microprocessor to the outside world. They include specify operations to be performed. Control lines include memory
the devices such as LED, CRT, digital to analog converter, printer etc. read/write, i/o read/write, bus request/grant, clock, reset, interrupt
System Bus: It is a communication path between the microprocessor and request/acknowledge etc.
peripherals; it is nothing but a group of wires to carry bits. A typical microprocessor consists of arithmetic and logic unit (ALU) in
A bus structure consists of a set of common lines, one for each bit of a association with control unit to process the instruction execution
register, through which binary information is transferred one at a time.

[email protected] +254724410325 Page 6


CEE Mod II Micro- electronics

Almost all the microprocessors are based on the principle of store-program  General-purpose microprocessor- used in general computer
concept. In store-program concept, programs or instructions are system and can be used by programmer for any application.
sequentially stored in the memory locations that are to be executed. Examples, 8085 to Intel Pentium.
To do any task using a microprocessor, it is to be programmed by the user.  Microcontroller- microprocessor with built-in memory and
So the programmer must have idea about its internal resources, features and ports and can be programmed for any generic control
supported instructions. application. Example, 8051.
Each microprocessor has a set of instructions, a list which is provided by  Special-purpose processors- designed to handle special
the microprocessor manufacturer. functions required for an application. Examples, digital signal
The instruction set of a microprocessor is provided in two forms: binary processors and application-specific integrated circuit (ASIC)
machine code and mnemonics. Microprocessor communicates and chips.
operates in binary numbers 0 and 1. The set of instructions in the form of (iii)Based on Instruction set/architecture:
binary patterns is called a machine language and it is difficult for us to  Complex Instruction Set Computer (CISC) processors:
understand. When a microprocessor has an instruction set that supports
Therefore, the binary patterns are given abbreviated names, called many addressing modes for the arithmetic and logical
mnemonics, which forms the assembly language. instructions, data transfer and memory accesses instructions,
The conversion of assembly-level language into binary machine-level the microcontroller is said to be of CISC architecture. The
language is done by using an application called assembler. typical CISC has well over 80 instructions, many of them very
Classification of Microprocessors: powerful and very specialized for specific control tasks. It is
Based on their specification, application and architecture microprocessors quite common for the instructions to all behave quite
are classified. differently. Some might only operate on certain address spaces
(i) Based on size of data bus: or registers, and others might only recognize certain
 4-bit microprocessor addressing modes. The advantages of the CISC architecture
 8-bit microprocessor are that many of the instructions are macro like, allowing the
 16-bit microprocessor programmer to use one instruction in place of many simpler
 32-bit microprocessor instructions.
(ii) Based on application:  Reduced Instruction Set Computer (RISC) processors:
The industry trend for microprocessor design is for Reduced
Instruction Set Computers (RISC) designs. When a

[email protected] +254724410325 Page 7


CEE Mod II Micro- electronics

microprocessor has an instruction set that supports fewer simplifies the microprocessor design because only one
addressing modes for the arithmetic and logical instructions memory is accessed.
and for data transfer instructions, the microcontroller is said to
be of RISC architecture. The benefits of RISC design
simplicity are a smaller chip, smaller pin count, and very low
power consumption. Some of the typical features of a RISC
processor- Harvard architecture are:
 Allows simultaneous access of program and data.
 Overlapping of some operations for increased
processing performance. The Von–Neumann architecture is the fundamental basis for the
 Instruction pipelining increases execution speed. architecture of modern digital computers. It consisted of 1000 storage
 Orthogonal (symmetrical) instruction set for locations which can hold words of 40 binary digits and both instructions as
programming simplicity. well as data are stored in it. The storage location of control unit and ALU
 Allows each instruction to operate on any register or are called registers and the various models of registers are:
use any addressing mode  MAR – memory address register – contains the address in
(iv) Based on architecture: There are mainly two categories of memory of the word to be written into or read from MBR
processors, namely, Von Neuman (or Princeton) architecture  MBR – memory buffer register – consists of a word to be stored
and Harvard Architecture. These two architectures differ in the in or received from memory.
way data and programs are stored and accessed.  IR – instruction register – contains the 8-bit op-code instruction to
 Von-Neuman Architecture: Microprocessor based on be executed.
the Von-Neuman architecture have a single ‘data’ bus  IBR – instruction buffer register – used to temporarily hold the
that is used to fetch both instructions and data. Program instruction from a word in memory.
instructions and data are stored in a common main  PC - program counter - contains the address of the next
memory. When such a processor addresses main instruction to be fetched from memory.
memory, it first fetches an instruction, and then it  AC & MQ (Accumulator and Multiplier Quotient) - holds the
fetches the data to support the instruction. The two operands and results of ALU after processing.
separate fetches slows up the controller’s operation. The 
Von-Neuman architecture’s main advantage is that it

[email protected] +254724410325 Page 8


CEE Mod II Micro- electronics

Harvard Architecture: 2.0 MICROPROCESSOR EVOLUTION AND ARCHITECTURE


Processors based on the Harvard Architecture have separate data bus and Microprocessor families
an instruction bus. This allows execution to occur in parallel. As an A microprocessor family or a CPU family (also microcontroller family) is a
instruction is being “pre-fetched”, the current instruction is executing on group of microprocessors, microcontrollers, or component chips that make
the data bus. Once the current instruction is complete, the next instruction up one, developed by a specific manufacturer that share the same general
is ready to go. This pre-fetch theoretically allows for much faster execution architecture and feature set. Within a specific family, chips may be further
than Von-Neuman architecture, on the expense of complexity. The Harvard classified according to their model which may have different capabilities,
Architecture executes instructions in fewer instruction cycles than the Von- clock speeds, and applications. Models may be further divided into
Neuman architecture. stepping which are minor refinements and tweaks in order to correct and
enhance the stability and reliability of the model.
Intel Corporation
 Intel Corporation is an American semiconductor company which
designs and manufactures other integrated circuits including flash
memory, network interface controllers, GPUs, chipsets,
motherboards, and computers. It was introduced in March 1976. It
requires less support circuitry, allowing simpler and less expensive
microcomputer systems to be built.
 The 8085 is supplied in a 40-pin DIP package. To maximize the
functions on the available pins, the 8085 uses a multiplexed
address/data (AD^0-AD^7) bus. However, an 8085 circuit requires
There are two data and two address buses multiplexed for data bus and an 8-bit address latch, so Intel manufactured several support chips
address bus. Hence, there are two blocks of RAM chips one for program with an address latch built in.
memory and another for data memory addresses. The control unit controls
 The Intel 8080 was the second 8-bit microprocessor designed and
the sequence of operations. Central ALU consists of ALU, multiplier,
manufactured by Intel and was released in April 1974. It uses two
accumulator and scaling chief register. The PC used to address program
support chips to function in most applications, the i8224 clock
memory and always contains the address of next instruction to be executed.
generator/driver and the i8228 bus controller, and it is implemented
Here data and control buses are bidirectional and address bus is
in N-type metal-oxide-semiconductor logic (NMOS) using non-
unidirectional.
saturated enhancement mode transistors as thus demanding a +12 V

[email protected] +254724410325 Page 9


CEE Mod II Micro- electronics

and a −5 V voltage in addition to the main transistor–transistor logic


(TTL) compatible +5 V. Motorola
 The 8086 a 16-bit microprocessor chip designed by Intel between  The Motorola 68000 is a 16/32-bit microprocessor, introduced in
early 1976 and June 8, 1978, when it was released. It is a slightly 1979 by Motorola Semiconductor Products Sector.
modified chip with an external 8-bit data bus (allowing the use of  The design implements a 32-bit instruction set, with 32- bit registers
cheaper and fewer supporting ICs), and is notable as the processor and a 32-bit internal data bus. The address bus is 24-bits and does
used in the original IBM PC design. not use memory segmentation. Internally, it uses a 16-bit data ALU
 Intel 8088 microprocessor was released in 1979, or one year after and two additional 16-bit ALUs used mostly for addresses, and has
the Intel 8086 CPU. Both processors have the same architecture, a 16-bit external data bus. For this reason, it is referred to as a
and the only difference of the 8088 CPU from the 8086 is the 16/32-bit processor.
external data bus width - it was reduced from 16 bits to 8 bits. The Evolution of Microprocessors
8088 CPU uses two consecutive bus cycles to read or write 16 bit The years of development of microprocessors as 5 generations
data instead of one bus cycle for the 8086, which makes the 8088 First generation (1971 – 73)
processor to run slower. On the plus side hardware changes to the Intel Corporation introduced 4004, the first microprocessor in 1971. It is
8088 CPU made it compatible with 8080/8085 support chips. evolved from the development effort while designing a calculator chip.
Pentium There were three other microprocessors in the market during the same
The Pentium is a widely-used personal computer microprocessor from the period:
Intel Corporation first offered in 1993. The original Pentium model i. Rockwell International’s PPS-4 (4 bits)
includes two processors on one chip that contains 3.1 million transistors. ii. Intel’s 8008 (8 bits)
Zilog Corporation iii. National Semiconductor’s IMP-16 (16 bits)
 The Z80 is an 8-bit microprocessor introduced by Zilog in early They were fabricated using PMOS (P-type metal-oxide-semiconductor)
1975. The first working samples were delivered in March 1976, and technology which provided low cost, slow speed and low output currents
it was officially introduced on the market in July 1976. they were not compatible with TTL.
 The Zilog Z80 is a software-compatible extension and enhancement Second Generation (1974 – 1978)
of the Intel 8080 .It is one of the most widely used CPUs in desktop Marked the beginning of very efficient 8 – bit microprocessors.
computers and home computers from the 1970s to the mid-1980s. It Some of the popular processors were:
was also common in military applications, musical equipment.  Motorola’s 6800 and 6809
 Intel’s 8085

[email protected] +254724410325 Page 10


CEE Mod II Micro- electronics

 Zilog’s Z80
They were manufactured using NMOS (N-type metal-oxide- DESCRIPTION OF THE MICROPROCESSOR ARCHITECTURE
semiconductor) technology. OF INTEL 8085
This technology offered faster speed and higher density than PMOS.
It is TTL compatible.
Third generation microprocessors (1979 – 80)
This age is dominated by 16 – bits microprocessors such as;
 Intel’s 8086/80186/80286
 Motorola's 68000/68010
They were designed using HMOS (High-density metal oxide
semiconductor) technology.
HMOS provides some advantages over NMOS as ;
a) Speed-power-product of HMOS is four times better than that of
NMOS
b) HMOS can accommodate twice the circuit density compared to
NMOS
Fourth Generation (1981 – 1995)
This era marked the beginning of 32 bits microprocessors. Intel introduced
432, which was bit problematic then a clean 80386 in launched, Motorola
introduced 68020/68030.
They were fabricated using low-power version of the HMOS technology
called HCMOS (High density Complementary Metal Oxide
Semiconductor), Motorola introduced 32-bit RISC processors called
MC88100.
Fifth Generation (1995 – till date)
This age the emphasis is on introducing chips that carry on-chip
functionalities and improvements in the speed of memory and I/O devices
along with introduction of 64-bit microprocessors.

[email protected] +254724410325 Page 11


CEE Mod II Micro- electronics

Pin diagram The signals associated with 8085 can be classified into 6 groups:
(i) Address bus
(ii) Data bus
(iii) Control & status signals
(iv) Power supply and frequency signals
(v) Externally initiated signals
(vi) Serial I/O signals
Pin description
 Address bus: The 8085 has 16 signal lines that are used as the
address bus; however, these lines are split into two segments A15-
A8 and AD7- AD0. The eight signals A are unidirectional and used
as high order bus. A8 – A15 (output, 3-state): Most significant eight
bits of memory addresses and the eight bits of the I/O addresses.
These lines enter into tri-state high impedance state during HOLD
and HALT modes.
 Data bus: The signal lines AD7- AD0 are bidirectional, they serve a
dual purpose. They are used the low order address bus as well as
data bus. AD0 – AD7 (input/output, 3-state): Lower significant bits
of memory addresses and the eight bits of the I/O addresses during
first clock cycle. Behaves as data bus during third and fourth clock
cycle. These lines enter into tristate high impedance state during
HOLD and HALT modes.
8085 pin description Control and status signals:
The 8085A (commonly known as 8085) is a 8-bit general purpose This group of signals includes two control signals (and), three status signals
microprocessor capable of addressing 64K of memory. The device has 40 (IO/, S1 and S0) to identify the nature of the operation, and one special
pins, require a +5V single power supply and can operate with a 3-MHZ, signals (ALE) to indicate the beginning of the operation.
single phase clock. ALE- Address Latch Enable (Output): This is a positive going pulse
generated every time the8085 begins an operation (machine cycle): it
[email protected] +254724410325 Page 12
CEE Mod II Micro- electronics

indicates that the bits AD7 -AD0areaddress bits. This signal is used
primarily to latch the low-order address from the multiplexed bus and Power Supply and Clock frequency:
generate a separate set of eight address lines AD7 -AD0. Address Latch  VCC: +5V power supply
Enable is a pulse that is provided when an address appears on the AD0 –  VSS: Ground reference
AD7 lines, after which it becomes 0.  X1 and X2: A crystal (RC or LC network) is connected at these two
Read (active low output): this is a read control signal. This signal pins for frequency (6 MHz).
indicates that the selected I/O or memory device is to be read and data are  CLK OUT: It can be used as the system clock for other devices.
available on the data bus. Externally Initiated and Interrupt Signals:
Write (active low): This is a write control signal. This signal indicates that RESET IN: When the signal on this pin is low, the PC is set to 0, the buses
the data on the data bus are to be written into a selected memory or I/O are tristate and the processor is reset.
location. RESET OUT: This signal indicates that the processor is being reset. The
IO/M: This is a status signal used to differentiate between I/O and memory signal can be used to reset other devices.
operations. When it is high, it indicates an I/O operation; when it is low READY: When this signal is low, the processor waits for an integral
indicates a memory operation. This signal is combined with (Read) and number of clock cycles until it goes high.
(Write) to generate I/O and memory signals. HOLD: This signal indicates that a peripheral like DMA (direct memory
S1 and S0: These status signals, similar to, can identify various operations, access) controller is requesting the use of address and data bus.
but they are rarely used in small systems. HLDA: This signal acknowledges the HOLD request.
INTR: Interrupt request is a general-purpose interrupt.
INTA: (Interrupt Acknowledge). This is used to acknowledge an interrupt.
RST 7.5, RST 6.5, and RST 5.5 – restart interrupt: These are vectored
interrupts and have highest priority than INTR interrupt.
TRAP: This is a non-maskable interrupt and has the highest priority.
Serial I/O Signals
The microprocessor performs primarily four operations: 8085 has two signals to implement the serial transmission. In serial
(i) Memory Read: Reads data (or instruction) from memory. transmission, data bits are sent over a single line, one bit at a time.
(ii) Memory Write: Writes data (or instruction) into memory. SID (Serial input Data). Bit on this line is loaded to D7 bit of register A
(iii) I/O Read: Accepts data from input device. using RIM (Read Interrupt Mask) instruction.
(iv) I/O Write: Sends data to output device SOD (Serial Output Data): Output SOD is set or reset by using SIM (Set
Interrupt Mask) instruction.
[email protected] +254724410325 Page 13
CEE Mod II Micro- electronics

Machine cycles Fetch cycle


Operation of a microprocessor can be classified in to following four groups The first operation in any instruction is Op Code fetch, The
according to their nature. microprocessor (CPU) needs to get(fetch) this machine code from the
 Op-Code fetch memory register where it is stored before the microprocessor can begin to
 Memory Read /Write execute the instruction. Once the instruction code is fetched from memory,
 I/O Read/ Write it is then executed.
 Request acknowledgement Fetch Cycle includes;
Here Op-Code fetch is an internal operation and other three are external Memory Read Machine Cycle: The memory read cycle is executed by the
operations. During three operations, microprocessor generates and receives processor to read a data byte from memory. The machine cycle is exactly
different signals. These all operations are terms as machine cycle. same to op code fetch except: a) It has three T-states b) The S0 signal is set
Clock Cycle (T state): It is defined as one subdivision of the operation to 0
performed in one clock period. Memory Write Machine Cycle: The memory write cycle is executed by
Machine Cycle: It is defined as the time required to complete one the processor to write a data byte in a memory location. The processor
operation of accessing memory, I/O, or acknowledging an external request. takes three T-states and signal is made low.
This cycle may consist of three to six T-states. I/O Read cycle is executed by the processor to read a data byte from I/O
Instruction Cycle: It is defined as the time required completing the port or from the peripheral, which is I/O, mapped in the system. The
execution of an instruction. The 8085 instruction cycle consists of one to processor takes 3T states to execute this machine cycle. The IN instruction
six machine cycles or one to six operations. uses this machine cycle during the execution.
Instruction cycle I/O write cycle is executed by the processor to write a data byte to I/O port
Instruction contained in the program and is pointed by the program counter. or to a peripheral, which is I/O mapped in the system. The processor takes
It is first moved to the instruction register and is decoded in binary form three T-states to execute this machine cycle.
and stored as an instruction in the memory. The computer takes a certain
period to complete this task i.e., instruction fetching, decoding and
executing on the basis of clock speed. Such a time period is called
‘Instruction cycle’ and consists two cycles namely fetch and decode and
Execute cycle.

[email protected] +254724410325 Page 14


CEE Mod II Micro- electronics

3.0 MICROCOMPUTER MEMORIES


Timing Diagram Terminologies
Memory cell-a device or an electronic circuit used to store a single bit of
data or instruction
Memory word- a number of memory cells that represent data of some type
Volatile- a type of memory that loses data when power goes off
Non –volatile- a type of memory which does not loose data even when
power goes off.
Address- a number that identified the location of a word in a memory.
Read operation- operation where a new binary word stored in a specific
memory is sensed/read and then transferred to another device. Also called a
fetch operation.
Write operation- operation where a new word is placed in a particular
memory location.
Access time- amount of time required to perform a read operation i.e. the
time between the memory receiving a new address input and the data
becoming available at the memory output.
Memory capacity- a way of specifying the number of bits that can be
stored in a particular memory device or a complete memory system.
Sequential access memory- a memory in which the access time is not
constant but varies depending on the address location.
Static memory devices- semiconductor memories in which the stored data
will remain permanently stored as long as power is applied without the
need for periodic rewriting of the data into memory.
Dynamic memory devices- semiconductor memories in which the stored
data will not remain permanently stored even with power applied unless
they are periodically rewritten into memory.

[email protected] +254724410325 Page 15


CEE Mod II Micro- electronics

Classification of memory DRAM are it has high density, low power consumption and cheaper
Memory is an essential component of the microcomputer system. It is used than SRAM. But the bit information leaks therefore needs to be
to store both instructions and data. Memory is made up of registers and the rewritten again every few milliseconds. It is called refreshing the
number of bits stored in a register is called memory word .Memory word memory and requires extra circuitry to do this. It is slower than
is identified by an address .If microprocessor uses 16 bit address , then SRAM.
there will be maximum of 2 16 = 65536 memory addresses ranging from
0000H to FFFFH. There are various types of memory which can be
classified in to two main groups i.e. Primary memory and Secondary
memory.
Primary Memory
It is the memory used by microprocessor to execute programs. The
microprocessor can access only those items that are stored in this memory.
Hence, all data and program must be within primary memory prior to its
execution. Primary memory is much larger than processer memory that is
included in the microprocessor chip. Primary memory is divided in to two
groups.
(i) R/W Memory (RAM) - Microprocessor can read from and write
into this memory .This memory is used for information that are
likely to be altered such as writing program or receiving data. (ii) Read only memory
This memory is volatile i.e. the content will be lost if the power ROM contains a permanent pattern of data that cannot be changed. It is
is turned off and commonly known as RAM. RAM are basically nonvolatile i.e. no power source is required to maintain the bit values in
of two types. memory. ROM are basically of 5 types.
(a) Static RAM (SRAM) This memory is made up of flip flops and it (a) Masked ROM: ROM which is hard wired device that contains a
stores bit as voltage. A single flip flop stores binary data either 1 or pre-programmed set of data or instructions.
0. Each flip flop is called storage cell. Each cell requires six (b) Programmable ROM: A memory chip on which data can be
transistors. Therefore, the memory chip has low density but high written into only once and the writing process is performed
speed. This memory is more expensive and consumes more power. electrically. Once a program has been written onto a PROM, it
(b) Dynamic RAM (DRAM) This memory is made up of MOS remains there forever. Unlike RAM, PROMs retain their contents
transistor gates and it stores the bit as charge. The advantage of
[email protected] +254724410325 Page 16
CEE Mod II Micro- electronics

when the computer is turned off. The difference between a PROM


and a ROM (read-only memory) is that a PROM is manufactured as
blank memory, whereas a ROM is programmed during the
manufacturing process.
(c) Erasable PROM (EPROM):- is a special type of memory that
retains its contents until it is exposed to ultraviolet light. The
ultraviolet light clears its contents, making it possible to reprogram
the memory. To write to and erase an EPROM, you need a special
device called a PROM programmer or PROM burner.
(d) EEPROM: Short form of electrically erasable programmable read-
only memory. EEPROM is a special type of PROM that can be
erased by exposing it to an electrical charge. Like other types of
PROM, EEPROM retains its contents even when the power is
turned off. Also like other types of ROM, EEPROM is not as fast as
RAM.
(e) Flash Memory (flash)- is a modern type of EEPROM that can be Secondary memory
erased and rewritten faster than ordinary EEPROM, and newer  Storage for huge files that are not frequently needed
designs has the feature that is very high endurance (exceeding  It comprises slow devices such as magnetic tapes and
1,000,000 cycles). optical discs
 Also called back up/ auxiliary / mass storage devices
 Always non volatile
Memory capacity
Memory capacity is the amount of data a device can store at any given
time in its memory. A device's memory capacity can be obtained from
either the operating system or motherboard. It is given by M x N where;
M = memory words N = No. of bits per word / word size/ data lines Also
memory capacity = aK x N where a is a constant, K = 1024 bits.

[email protected] +254724410325 Page 17


CEE Mod II Micro- electronics

Memory Capacity A memory system requires 2K ROM A, 1K ROM B, 3K RAM A, 4K


 The memory device 2K x 8 has a word size of 8 bits and 2018 RAM B and 6K RAM C. The start addresses of the memory locations are;
memory locations. Determine the number of address lines.
 A certain memory has a capacity of 4K x16. Determine;

(i) Number of words the memory can store


(ii) The number of data lines
(iii)The number of address lines
(iv) The memory capacity
Memory mapping
This is a process of assigning addresses in memory registers in various
memory chips in a microcomputer system. 4.0 PROGRAMMING
Intel 8085 is an 8-bit microprocessor, has 16-bit address bus and can The instruction set of a microprocessor is simply the set of binary inputs
access up to 64Kb of memory. which produce defined actions during an instruction cycle.
The entire memory map address ranges from 0000HFFFFH. An instruction set is to a microprocessor what a function table is to a logic
These can be used to assign digits 65535 memory locations. device such as a gate, adder, or Shift register. , course, the actions which
The total addressable memory is divided into 4K blocks. Memory systems the microprocessor performs in response to the instruction inputs are far
are divided into memory pages with 256 lines to read from or write into. more complex than the actions which combinatorial logic devices perform
When the particular sections of memory that are used in a particular in response to their inputs.
application are marked, the diagram is called a memory map. An instruction is simply a binary bit pattern — it must be pre- sent at the
data inputs to the microprocessor at the proper time in order to be
interpreted as an instruction.
Introduction to assembly language programming Instruction
description and Format
 The computer can be used to perform a specific task, only by
specifying the necessary steps to complete the task.
 The collection of such ordered steps forms a ‘program’ of a
computer. These ordered steps are the instructions.

[email protected] +254724410325 Page 18


CEE Mod II Micro- electronics

 Computer instructions are stored in central memory locations and Classification based on length
are executed sequentially one at a time. (a) One address format (One-byte instructions): Instruction having
 The control reads an instruction from a specific address in memory one byte in machine code. Here 1 byte will be Op-code and operand
and executes it. will be default. E.g. ADD B, MOV A,B
 It then continues by reading the next instruction in sequence and Opcode Operand Machine code/ Hex code
executes it until the completion of the program MOV A,B 78
 An instruction manipulates the data and a sequence of instructions ADD M 86
constitutes a program. Generally each instruction has two parts: one (b) Two address format (Two-byte instructions): Instruction having
is the task to be performed, called the operation code (Op-Code) two byte in machine code. Here first byte will be Op-code and
field, and the second is the data to be operated on, called the second byte will be the operand/data. E.g. IN 40H, MVI A, 8-bit
operand or address field. Data
 The operand (or data) can be specified in various ways. It may Opcode Operand Machine code/ Byte
include 8-bit (or 16-bit) data, an internal register, a memory Hex code description
location, or an 8-bit (or 16-bit) address. MVI A, 7FH 3E First byte
 The Op-Code field specifies how data is to be manipulated and 7F Second byte
address field indicates the address of a data item. ADI 0FH C6 First byte
For example: ADD R1, R0. 0F Second byte
Op-code address Here R0 is the source register and R1 is the destination (c) Three address format (Three-byte instructions): Instruction
register. The instruction adds the contents of R0 with the content of R1 having three byte in machine code. Here first byte will be Op-code,
and stores result in R1 second and third byte will be operands/data.
Instruction Set and Execution in 8085 That is;
 8085 A can handle at the maximum of 256 instructions (28) 2nd byte- lower order data.
(246 instructions are used). 3rd byte – higher order data
 The sheet which contains all these instructions with their hex E.g. LXI B, 4050 H
code, mnemonics, descriptions and function is called an Micro operation specifies the transfer of data into or out of a register.
instruction sheet.
 Microprocessor instructions can be classified based on the Opcode Operand Machine Byte description
parameters such functionality, length and operand addressing. code/Hex code

[email protected] +254724410325 Page 19


CEE Mod II Micro- electronics

JMP 9050H C3 First byte Addressing Modes in Instructions


50 Second byte  The process of specifying the data to be operated on by the
90 Third byte instruction is called addressing.
LDA 8850H 3A First byte  The various formats for specifying operands are called addressing
50 Second byte modes.
88 Third byte  The 8085 has the following five types of addressing:
Classification based on functionality  Immediate addressing
An instruction is a binary pattern designed inside a microprocessor to  Memory direct addressing
perform a specific function (task)  Register direct addressing
(a) Data transfer operations: This group of instructions copies data  Indirect addressing
from source to destination. The content of the source is not altered.  Implicit addressing
(b) Arithmetic operations: Instructions of this group perform (i) Immediate addressing
operations like addition, subtraction, increment & decrement. One In this mode, the operand given in the instruction - a byte or word –
of the data used in arithmetic operation is stored in accumulator and transfers to the destination register or memory location.
the result is also stored in accumulator. Ex: MVI A, 9AH
(c) Logical operations: Logical operations include AND, OR, EXOR, The operand is a part of the instruction. The operand is stored in the
NOT, COMPARE etc. The operations like AND, OR and EXOR register mentioned in the instruction.
uses two operands, one is stored in accumulator and other can be (ii) Memory Direct Addressing: Memory direct addressing moves a
any register or memory location. The result is stored in byte or word between a memory location and register. The
accumulator. NOT operation requires single operand, which is memory location address is given in the instruction. Ex: LDA
stored in accumulator. 850FH
(d) Branching operations: Instructions in this group can be used to This instruction is used to load the content of memory address
transfer program sequence from one memory location to another 850FH in the accumulator.
either conditionally or unconditionally. For example jump, call etc. (iii)Register Direct Addressing: Register direct addressing transfer a
(e) Machine control operations: Instruction in this group control copy of a byte or word from source register to destination
execution of other instructions and control operations like interrupt, register. Ex: MOV B, C
HLT, NOP etc. It copies the content of register C to register B.

[email protected] +254724410325 Page 20


CEE Mod II Micro- electronics

(iv) Indirect Addressing: Indirect addressing transfers a byte or word


between a register and a memory location. Ex: MOV A, M
Here the data is in the memory location pointed to by the
contents of HL pair. The data is moved to the accumulator.
(v) Implicit Addressing: In this addressing mode the data itself
specifies the data to be operated upon. Ex: CMA
The instruction complements the content of the accumulator. No
specific data or operand is mentioned in the instruction.
8085 Instruction set – Explained
(i) Data transfer group instructions:
 It is the longest group of instructions in 8085.
 This group of instruction copy data from a source location to
destination location without modifying the contents of the source.
 The transfer of data may be between the registers or between
register and memory or between an I/O device and accumulator.
None of these instructions changes the flag.
 The instructions of this group are:

[email protected] +254724410325 Page 21


CEE Mod II Micro- electronics

(ii) Arithmetic group Instructions:


 The 8085 microprocessor performs various arithmetic operations
such as addition, subtraction, increment and decrement.
 These arithmetic operations have the following mnemonics.

[email protected] +254724410325 Page 22


CEE Mod II Micro- electronics

[email protected] +254724410325 Page 23


CEE Mod II Micro- electronics

(iii)Logical Group Instructions:


 A microprocessor is basically a programmable logic chip. It can
perform all the logic functions of the hardwired logic through its
instruction set.
 The 8085 instruction set includes such logic functions as AND, OR,
XOR and NOT (Complement): The following features hold true for
all logic instructions:
 The instructions implicitly assume that the accumulator is
one of the operands.
 All instructions reset (clear) carry flag except for
complement where flag remain unchanged.
 They modify Z, P & S flags according to the data
conditions of the result.
 Place the result in the accumulator.
 They do not affect the contents of the operand register.
The logical operations have the following instructions.

[email protected] +254724410325 Page 24


CEE Mod II Micro- electronics

(iv) Branching Group Instructions:


 The microprocessor is a sequential machine; it executes
machine codes from one memory location to the next.
 The branching instructions instruct the microprocessor to go
to a different memory location and the microprocessor
continues executing machine codes from that new location.
 The branching instructions are the most powerful
instructions because they allow the microprocessor to
change the sequence of a program, either unconditionally or
under certain test conditions.
 The branching instruction code categorized in following
three groups:
 Jump instructions
 Call and return instructions
 Restart instructions

(a) Jump Instructions: - The jump instructions specify the memory


location explicitly. They are 3 byte instructions, one byte for the
operation code followed by a 16 bit (2 byte) memory address.
Jump instructions can be categorized into unconditional and
conditional jump.

[email protected] +254724410325 Page 25


CEE Mod II Micro- electronics

Unconditional Jump JPE 16bit Jump on parity even (if P=1)


 8085 includes unconditional jump instruction to enable the JPO 16bit Jump on parity odd (if P=0)
programmer to set up continuous loops without depending (b) Call and return instructions: (Subroutine)
only type of conditions.  Call and return instructions are associated with subroutine
 E.g. JMP 16 bit address: loads the program counter by 16 bit technique. A subroutine is a group of instructions that perform a
address and jumps to specified memory location. E.g. JMP subtask.
4000H  A subroutine is written as a separate unit apart from the main
 Here, 40H is higher order address and 00H is lower order program and the microprocessor transfers the program execution
address. The lower order byte enters first and then higher sequence from main program to subroutine whenever it is called to
order. perform a task.
 The jump location can also be specified using a label or  After the completion of subroutine task microprocessor returns to
name. main program.
Conditional Jump  The subroutine technique eliminates the need to write a subtask
 The conditional jump instructions allow the microprocessor to make repeatedly, thus it uses memory efficiently.
decisions based on certain conditions indicated by the flags.  Before implementing the subroutine, the stack must be defined; the
 After logic and arithmetic operations, flags are set or reset to reflect stack is used to store the memory address of the instruction in the
the condition of data. main program that follows the subroutines call.
 These instructions check the flag conditions and make decisions to  To implement subroutine there are two instructions CALL and
change or not to change the sequence of program. RET.
 The four flags namely carry, zero, sign and parity used by the jump
instruction.
Mnemonics Description
JC 16 bit Jump on carry (if CY=1)
JNC 16 bit Jump on if no carry (if CY=0)
JZ 16bit Jump on zero (if Z=1)
JNZ 16bit jump on if no zero (if Z=0)
JP 16bit jump on positive (if S=0)
JM 16bit jump on negative (if S=1)

[email protected] +254724410325 Page 26


CEE Mod II Micro- electronics

 When RST instruction is executed, the 8085 stores the contents of


PC on SP and transfers the program to the restart location.
 Actually these restart instructions are inserted through additional
hardware.
 These instructions are part of interrupt process.
Machine Control Operations (Miscellaneous Group Instructions)
STACK:
The stack is defined as a set of memory location in R/W memory, specified
by a programmer in a main memory.
 These memory locations are used to store binary information
temporarily during the execution of a program.
 The beginning of the stack is defined in the program by using the
instruction LXI SP, 16 bit address.
 Once the stack location is defined, it loads 16 bit address in the
stack pointer register.
 Storing of data bytes for this operation takes place at the memory
(c) Restart Instruction: location that is one less than the address e.g. LXI SP, 2099H. Here
 8085 instruction set includes 8 restart instructions (RST). the storing of data bytes begins at 2098H and continuous in reverse
These are 1 byte instructions and transfer the program order i.e. 2097H.
execution to a specific location.  Therefore, the stack is initialized at the highest available memory
location to prevent the program from being destroyed by the stack
information.
 The stack instructions are:
PUSH Rp/PSW (Store register pair on stack)
 1 byte instruction.

[email protected] +254724410325 Page 27


CEE Mod II Micro- electronics

 Copies the contents of specified register pair or program status


word (accumulator and flag) on the stack.
 Stack pointer is decremented and content of high order register is
copied. Then it is again decremented and content of low order
register is copied.
POP Rp/PSW (retrieve register pair from stack)
 1 byte instruction.
 Copies the contents of the top two memory locations of the stack
into specified register pair or program status word.
 A content of memory location indicated by SP is copied into low
order register and SP is incremented by 1. Then the content of next
memory location is copied into high order register and SP is
incremented by 1.

 XTHL – exchanges top of stack (TOS) with HL


 SPHL – move HL to SP
 PCHL – move HL to PC
Some instructions related to interrupt
 DI – disable interrupt
 EI – Enable interrupt
 SIM – set interrupt mask o RIM – read interrupt mask

[email protected] +254724410325 Page 28


CEE Mod II Micro- electronics

Example 7: Exchange the contents of memory locations 2000H and


4000H
Solution
 LDA 2000H: Get the contents of memory location 2000H into
accumulator
 MOV B, A: Save the contents into B register
Example 5 Transfer the contents of Memory location 2050 H to the
 LDA 4000H: Get the contents of memory location 4000H into
register B and the contents of 2051 H to Register C. The contents of
accumulator
memory location 2050 H are 10 of 2051 H are 11.
Data: Suppose memory location 2050 H contains 10 and 2051 H  STA 2000H: Store the contents of accumulator at address
contains 11. 2000H
 MOV A, B: Get the saved contents back into A register
 STA 4000H: Store the contents of accumulator at address
4000H
Alternatively;
 LXI H, 2000H: Initialize HL register pair as a pointer to
memory location 2000H.
 LXI D, 4000H: Initialize DE register pair as a pointer to
memory location 4000H.
Example 6: Store the data byte 32H into memory location 4000H  MOV B, M: Get the contents of memory location 2000H into B
 MVI A, 32H: Store 32H in the accumulator register.
 STA 4000H: Copy accumulator contents at address 4000H  LDAX D: Get the contents of memory location 4000H into A
register. MOV M, A: Store the contents of A register into
 HLT: Terminate program execution.
memory location 2000H.
Alternatively;
 MOV A, B: Copy the contents of B register into accumulator.
 LXI H, 4000H: Load HL with 4000H
 STAX D: Store the contents of A register into memory location
 MVI M: Store 32H in memory location pointed by HL register
4000H.
pair (4000H)
 HLT: Terminate program execution
 HLT: Terminate program execution

[email protected] +254724410325 Page 29


CEE Mod II Micro- electronics

Example 8: Subtract the contents of memory location 4001H from the  SHLD 4004H: Store I6-bit result in memory locations 4004H and
memory location 2000H and place the result in memory location 4002H 4005H.
Solution  HLT: Terminate program execution
 LXI H, 4000H: HL points to 4000H
 MOV A, M: Get first operand into the A
 INX H: HL points 4001H Example 10: Add the contents of memory locations 4000H and 4001H and
 SUB M: Subtract second operand place the result in the memory locations 4002H and 4003H.
 INX H: HL points 4002H Solution
 MOV M, A: Store result at 4002H.  LXI H, 4000H: HL Points 4000H
 HLT: Terminate program execution  MOV A, M: Get first operand into the accumulator
Example 9: Add the 16-bit number in memory locations 4000H and  INX H: HL Points 4001H
4001H to the 16-bit number in memory locations 4002H and 4003H.  ADD M: Add second operand
The most significant eight bits of the two numbers to be added are in  INX H: HL Points 4002H
memory locations 4001H and 4003H. Store the result in memory  MOV M, A: Store the lower byte of result at 4002H
locations 4004H and 4005H with the most significant byte in memory  INX H: HL Points 4003H
location 4005H.  MOV M, A: Store the higher byte of result at 4003H
Solution  HLT: Terminate program execution
 LHLD 4000H: Get first I6-bit number from 4000H and 4001H into
HL Example 11: Subtract the 16-bit number in memory locations 4002H and
 XCHG: Save first I6-bit number in DE 4003Hfrom the 16-bit number in memory locations 4000H and 4001H. The
 LHLD 4002H: Get second I6-bit number from 4002H and 4003H in most significant eight bits of the two numbers are in memory locations
HL 4001H and 4003H.Store the result in memory locations 4004H and 4005H
 MOV A, E: Get lower byte of the first number with the most significant byte in memory location 4005H.
 ADD L: Add lower byte of the second number Solution
 MOV L, A: Store result in L register  LHLD 4000H: Get first 16-bit number in HL
 MOV A, D: Get higher byte of the first number  XCHG: Save first 16-bit number in DE
 ADC H: Add higher byte of the second number with CARRY  LHLD 4002H: Get second 16-bit number in HL
 MOV H, A: Store result in H register  MOV A, E: Get lower byte of the first number
[email protected] +254724410325 Page 30
CEE Mod II Micro- electronics

 SUB L: Subtract lower byte of the second number


 MOV L, A: Store the result in L register
 MOV A, D: Get higher byte of the first number
 SBB H: Subtract higher byte of second number with borrow
 MOV H, A: Store l6-bit result in memory locations 4004H and
4005H.
 SHLD 4004H: Store l6-bit result in memory locations 4004H and
4005H.
 HLT: Terminate program execution
Example 12: Find the l's complement of the number stored at memory
location 4400H and store the complemented number at memory location
4300H.
Solution
 LDA 4400B: Get the number
 CMA: Complement number
 STA 4300H: Store the result
 HLT: Terminate program execution
Example 13: Find the 2's complement of the number stored at memory
location4200H and store the complemented number at memory location
4300H.
Solution
 LDA 4200H: Get the number
 CMA: Complement the number
 ADI, 01 H: Add one in the number
 STA 4300H: Store the result
 HLT: Terminate program execution

[email protected] +254724410325 Page 31

You might also like