Micro Electronics
Micro Electronics
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.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.
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.
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
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
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.
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
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
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
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