BEE 4206:Microprocessor Systems
Lec: Mourice Ojijo
School of Computing and Engineering Sciences, Strathmore University
November 26, 2024
Course content
1 Basics of microcontroller and microprocessor
2 Differences between microcontroller and microprocessor
3 Microprocessor Architecture and Microcomputer systems
4 Microprocessor Architecture and Memory Interfacing
5 Interfacing I/O Devices
6 Interrupts
7 MCS-51 Microcontroller
8 Assembly Language
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 2 / 47
Microprocessors
What is a microprocessor: A microprocessor is a
multipurpose, programmable , clock-driven, register based
electronic device that reads binary instructions from a storage
device called memory, accepts binary data and provides results
A typical programmable machine consists of: a microprocessor,
a memory and input/output devices
The components of a programmable system include:
▶ Hardware: Which is the physical part of the system
▶ Program: Which is a set of instructions written for the
microprocessor to run
▶ Software: Which a group of programs combine to perform a
certain task
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 3 / 47
Microprocessors
A typical programmable system/microcomputer is shown in
figure 1
Figure 1: A programmable machine or microcomputer
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 4 / 47
Microprocessor as a programmable device
A microprocessor can receive instructions the perform a task
based on those instructions.
A modern microprocessor is designed to understand instructions
and execute them.
A programmer can select appropriate instructions and as the
microcomputer to perform various tasks on a given data.
The instructions are stored in a device called memory. A
memory is a set of finite size registers.
The registers are always grouped together in powers of two. For
instance, a group of 1024(210 ) 8-bit registers on a
semiconductor chip is known as 1K byte memory
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 5 / 47
Microprocessor as a programmable device
Input/output devices allow users to interact with a
microprocessor. Such devices include a keyboard, card reader, a
scanner, monitors, LED displays etc
The primary component of a microcomputer is a microprocessor
also known as the central processing unit (CPU)
The CPU contains various
▶ Registers to store temporary data
▶ The arithmetic logic unit (ALU) which performs arithmetic and
logical operations
▶ The instruction decoders, counters and control lines
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 6 / 47
Microprocessor as a programmable device
Figure 2: A block diagram of a computer
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 7 / 47
Microprocessor as a programmable device
Figure 3: A block diagram of a computer with CPU and a block diagram
of a microcontroller
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 8 / 47
Advance semiconductor technology
The invention of integrated circuits in the 1950s prompted
development of large scale integration which eventually led to
the manufacturing of microprocessors.
Figure 4: The historical perspective of Intel microprocessors
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 9 / 47
Overview of other processors
Figure 5: 8086 pin out
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 10 / 47
Overview of other processors
Figure 6: Bus latching
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 11 / 47
Overview of other processors
Figure 7: Bus latching most applicable
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 12 / 47
Overview of other processors
Figure 8: 80186 block diagram
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 13 / 47
Overview of other processors
Figure 9: 80186 pin diagram
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 14 / 47
Overview of other processors
Figure 10: 80186 pin diagram
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 15 / 47
Overview of other processors
Figure 11: 80286 block diagram courtesy Intel Corporation
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 16 / 47
Overview of other processors
Figure 12: 80286 pin diagram courtesy Intel Corporation
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 17 / 47
Overview of other processors
Figure 13: 80386 pin diagram courtesy Intel Corporation
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 18 / 47
Overview of other processors
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 19 / 47
Overview of other processors
Figure 15: A pin diagram 80486 courtesy Intel Corporation
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 20 / 47
Overview of other processors
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 21 / 47
Overview of other processors
Figure 17: The pin out of Pentium microprocessor courtesy Intel
Corporation
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 22 / 47
Organization of a Microprocessor-Based System
The figure 18 shows a microprocessor based system with the
main components including the system bus.
Figure 18: A microprocessor based system
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 23 / 47
Microprocessor Internal Architecture
As seen in figure 18 the microprocessor unit is made up of the
following internal components.
▶ Arithmetic Logic Unit: It performs arithmetic operations such
addition and subtraction and logic operation such as AND, OR,
and exclusive OR.
▶ Register array: It consists of various registers identified by
letters such as A,B,C,D,E,H and L. These registers are primarily
used to store data temporarily during the execution of a
program and are accessible to the user.
▶ Control unit: The control unit provides the necessary timing
and control signals to all operations in the microcomputer. It
also controls the flow of data between the microprocessor and
memory and other peripherals.
The memory can be divide into two categories namely RAM and
ROM.
The system is the communication path between the MPU and
its peripherals
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 24 / 47
How does the microprocessor work?
Assume there is a program and data already entered in the RAM
When the MPU is given a command to execute the program
which is stored in the memory sequentially
It fetches the first instruction from memory, it decodes it the
executes it.
This process is continued until all the instructions and executed.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 25 / 47
Address bus
The address bus is group of 16 bit lines generally identified as
A0 toA15
The address bus are unidirectional data flow in one direction.
That is from the MPU to the peripheral devices
Figure 19: The Intel 8085 bus structure
The 8085 with 16 address lines is capable of addressing upto
216 = 65536 known as 64K locations
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 26 / 47
Data bus
The data bus is a group of 8 lines used for data flow
The lines are bidirectional - data can flow in both directions
The 8 data lines enable the MPU to manipulate an 8 bit data
ranging from 00H − FFH
The largest number that can appear on the data bus is
11111111 (25510 )
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 27 / 47
Control bus
The control bus is comprised of various single lines that carry
synchronization signals
However control lines are not grouped together like address or
data buses.
They are individual lines which provide pulses which control
operations
It is the MPU which generates these control signals especially
when it performs memory read or write operations
These signals are used to identify the devices with which the
MPU is communicating
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 28 / 47
Memory read operation
To communicate with memory, the MPU places a 16 bit address
on the address lines
The addresses are the decoded by an external logic circuit and
the memory is identified
The MPU sends a pulse called memory read as the control signal
It is the MPU which generates these control signals especially
when it performs memory read or write operations
The pulse activates the memory chip and the contents of this
memory are place on the 8 bit data bus and brought into the
MPU
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 29 / 47
Memory Unit
The memory is an essential component of a microcomputer.
It stores binary instructions and data for the microprocessor.
To communicate with memory the MPU should do the following.
▶ Select the chip
▶ Identify the register
▶ Read from or write int the register.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 30 / 47
Flip-Flop or Latch as storage element
A memory unit is a circuit that can store bits-high or low.
Generally voltage levels or capacitive charge.
A flip flop or a latch is a memory unit.
Data is written through input data DIN . The chip is enable
through pin EN
The data is read through pin DOUT
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 31 / 47
Flip-Flop or Latch as storage element
Figure 20: Latch as a four bit register
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 32 / 47
4X8 bit register
Figure 21: 4 X 8 bit register
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 33 / 47
Flip-Flop or Latch
Figure 20 Illustrates the arrangement of latches or flip flop in a 4
bit register.
Each register can store a bit and can be activated by the WR
and RD so that they can be written or read from.
The EN signal is part of the address bit the is used to enable a
chip so that it can be written to or read from.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 34 / 47
4X8 bit register
Figure 22: Two memory chips with four registers each and chip select
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 35 / 47
RAM and ROM Chips
Figure 23: R/W memory model and ROM model
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 36 / 47
Memory map and addresses
Intel 8085 which is 8-bit has 16 address lines.
It can identify upto 65536 memory registes each with 16 bit.
A memory map is a pictorial representation in which memory
devices are located in the entire range of addresses for each
memory device
Assume that a memory chip with 256 registers. Meaning we
need only 256 out of 65236.
The question is what should we do with the remaining address
line of the microprocessor.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 37 / 47
Memory map and addresses illustration
Figure 25 shows a memory chip with 256 registers and eight I/O
lines.
Memory size of the chip is expressed as 256 x 8.
It has 8 address lines (A7 − A0 ), one chip select signal and two
control signals RD and WR
Only 8 address lines A7 − A0 are required to identify 256
memory registers.
The remaining eight lines A7 − A0 are connected to the chip
select line through inverters and the NAND gate.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 38 / 47
Memory map and addresses illustration
Figure 24: Memory map for 256 register memory
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 39 / 47
Memory map and addresses illustration
Figure 25: Address map for 256 register memory
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 40 / 47
Example
Describe the address map with a diagram showing how 1K (1028x8)
memory is mapped. Show all the control signals
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 41 / 47
Memory word size
Memory devices are aailable in various word sizes (1,4 and 8)
and the size of the memory chip is generally specified in terms of
the total number of bits it can store.
For instance a memory chip of size 1024 x 4 has 1024 registers
and each register has 4 bits, thus it can store a total of 4096 =
1024x4 bits.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 42 / 47
Example
Calculate the number of memory chips needed to design 8K byte
memory if the available chip size is 1024x1
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 43 / 47
Intel 8086 Microprocessor and Its Architecture
Before a program is written or any instruction investigated, the
internal configuration of the microprocessor must be known.
Internal visible registers are detailed.
From Intel 80186 there exist program visible registers in different
categories
Only Intel 80286 and above have program invisible registers used
to control and operate the protected memory system and other
features of the microprocessor.
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 44 / 47
Intel 8086 Microprocessor and Its Architecture
Intel 8086 Registers
Figure 26: Intel 8086 registers
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 45 / 47
Intel 8086 Microprocessor and Its Architecture
Intel 8086 Registers
Figure 27: Intel 8086 registers
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 46 / 47
Intel 8086 Microprocessor and Its Architecture
Intel 8086 Registers
Figure 28: Intel 8086 registers
Lec: Mourice Ojijo (School of Computing and Engineering
BEE 4206:Microprocessor
Sciences, Strathmore
Systems
University) November 26, 2024 47 / 47