You are on page 1of 54

ECEg-5172 : Microprocessors &

Interfacing
Lecture Notes

By: Bushra KM.


Course Overview
00 This course is about Microprocessors and
their Interfacing.

002
Welcome to "Microprocessors and Interfacing,"

It is a course offering a fast-paced introduction to:


● The design,
● Programming, and
● Interfacing of Microprocessor-based Systems.

The course aims to provide you with a comprehensive understanding of:


● Basics of microprocessors and microcomputer systems,
● Fundamentals of microprocessor architecture,
● Assembly language programming
● Interfacing peripheral devices.

● It extensively covers the popular Intel MP 8086, serving as a


foundational step towards mastering the x86 family of microprocessors.

003
Why this Course?
● Most todays Electronic systems constitute of Microprocessors and
microcontrollers within them.

● Interacting/Designing/Programming such systems require basic/ fundamental


knowledge on the area of microprocessors/ microcontrollers.

● Simply whether you know it or not you already own a device with
microprocessors.

● Engineer should know what types of components he needs, ways to reduce


production costs and product reliable

004
Basics of Computers (Re-verview)
01 First, Lets review basic terms and
concepts of Computers.

005
What is a Computer?

Before we begin exploring this course we need to


review some basic things about computers and how
they work.

006
What is a Computer?
● It is an Electronic, Digital device.

● It is a programmable, computing device/Computing machine.


○ It performs Computation(Arithmetic & logic operations), according to the
instructions that have been given to it.
○ It operates under the control of instruction stored in its own memory.
○ Computers can do a wide variety of things b/c they can be programed. i.e.,
they are not designed to do just one job, but,,

● It is a data processing device that can accept data, manipulate the data according
to specific rules, produce results and stored the results for further use..
○ Computers process data to create information.

● To process data into info, a computer uses HW and SW components.

● Computers exist in a variety of size and configurations.


007
Basic Functions of a Computer
● In general terms, there are only 4 basic functions that a computer can performs:
1. Data Processing:
 Carry out a set of Arithmetic and Logic operations
 Data may take a wide variety of forms
 there are only a few fundamental methods or types of data processing
2. Data Storage:
 To process the data, the computer must temporarily store at least those
pieces of data that are being worked on at any given moment
 Two forms of storage functions:
 Short-term data storage
 Long-Term data storage
3. Data Movement:
 The computer’s operating environment consists of devices that serve as
either sources or destinations of data.
 Two types of data movement function:
 I/O process and Data communication
4. Control:
 Control/manage resources/functional units,,,,sequencing order of
operation 008
Basic Structure of a Computer
● A computer is not a single device, it is a complex system containing millions of
elementary electronic components.

● The basic operational design of a computer system is called its architecture.


○ the architecture of most computers in use today is based on John Von Neumann,
a pioneer in computer design

● The basic components that make up a typical Von Neumann computer system has three
major components and their interconnection:
a. Central processing unit (CPU),
b. Main Memory (RAM),
c. Input/Output (I/O), and
d. System Interconnection (System Bus)

009
Architecture of a Typical Von Neumann Machine

Main Memory

System Bus

0010
0011
The Computer: Top-Level Structure

a hierarchical view
of the internal
structure of a
traditional single-
processor
computer

0012
● Discuss each components
● Different configurations:
○ Single processor computer
○ Multiprocessor computer
○ Multicore computer
○ Parallel system
○ Distributed System
○ etc
● However, conventionally a computer consists of at
least one processing element(CPU) and some form of
memory.

0013
Classes of a Computer
● Computers can be classified, or typed, in many ways.
○ For example, by purpose and by size.
○ Classes by purpose:
■ Microcomputers (personal computers)
■ Minicomputers (mid-range computers)
■ Mainframe computers
■ Supercomputers
○ Classes by function:
■ Servers
■ Workstations
■ Information appliances
■ Embedded computers/Embedded Systems

0014
Computers Architecture and
02 Organization(CompArch)
Basic concepts related to ‘how computers are
designed?’.

0015
What is Comp Arch?
● Computer Architecture refers to the end-to-end structure of a computer
system that determines how its components interact with each other in
helping to execute the machine's purpose (i.e., processing data).

● It can sometimes be a high-level description that ignores details of the


implementation.

● The discipline of computer architecture has three main subcategories:


○ Instruction set architecture (ISA) also known as “Computer Architecture"
○ Microarchitecture also known as "computer organization",
○ Systems design

● In describing computers, a distinction is often made between computer architecture


and computer organization. Although it is difficult to give precise definitions for
these terms
0016
Comp. Arch(Cont.)
1. Instruction set architecture (ISA):
○ refers to those attributes of a system visible to a programmer.
○ refers attributes that have a direct impact on the logical execution of a
program.
○ It defines:
■ the machine code that a processor reads and acts upon: instruction
formats, instruction opcodes, operands...
■ the word size, data type...
■ the instruction and data memory
■ Memory address modes, I/O mechanisms
■ Processor registers
■ the effect of executed instructions on the registers and memory; and
■ an algorithm for controlling instruction execution.

0017
Comp. Arch(Cont.)
2. Microarchitecture:
○ also known as "computer organization“
○ refers to the operational units and their interconnections that realize
the architectural specifications
○ describes how a particular processor will implement the ISA

○ include those hardware details transparent to the programmer, such as


control signals; interfaces between the computer and peripherals; the size
of a computer's CPU cache and the memory technology used.

3. Systems design:
○ includes all of the other hardware components within a computing system,
such as data processing other than the CPU (e.g., direct memory access),
virtualization, and multiprocessing.

0018
Comp. Arch(Cont.)
● There are other technologies in computer architecture. The following
technologies are used in bigger companies like Intel, and were estimated in
2002[14] to count for 1% of all of computer architecture:
■ Macro-architecture
■ Assembly Instruction Set Architecture
■ Programmer-Visible Macro-Architecture
■ Microcode
■ UISA
■ Pin Architecture

0019
CompArch Implementation
● Once an instruction set and Micro-architecture have been designed, a practical
machine must be developed.
○ This design process is called the implementation.

● Implementation is usually not considered architectural design, but rather


hardware design engineering.

● Implementation can be further broken down into several steps:


■ Logic implementation designs the circuits required at a logic-gate level

■ Circuit implementation does transistor-level designs of basic elements

■ Physical implementation draws physical circuits; in a chip floor plan or on a


board and the wires connecting them

■ Design validation tests the computer as a whole to see if it works in all


situations and all timings.

0020
Computer Level of Abstraction

0021
CISC Vs. RISC
● The terms CISC and RISC refer to different types of computer architectures

1. CISC (Complex Instruction Set Computer)


 CISC architecture emphasizes a large set of complex instructions that
can perform powerful operations in a single instruction.
 Instructions in CISC architectures can vary in length and complexity.
 CISC processors typically have a small number of general-purpose
registers.
 Examples of CISC architectures include x86 processors like Intel and
AMD.

0022
CISC Vs. RISC (Cont.)
2. RISC (Reduced Instruction Set Computers):
 RISC architecture focuses on a smaller set of simple and efficient
instructions that can be executed quickly.
 Instructions in RISC architectures are typically of fixed length and are
simpler in nature.
 RISC processors usually have a larger number of general-purpose
registers.
 Examples of RISC architectures include ARM processors.

 In summary, the main difference between CISC and RISC architectures lies in
the complexity and size of the instruction set.
 CISC architectures have a larger and more complex instruction set, while
RISC architectures have a smaller set of simpler instructions.
 Each type of architecture has its own advantages and trade-offs in terms
of performance, power efficiency, and ease of programming.

0023
Elementary Components
● The operation of the digital computer is based on the storage and processing of
binary data.
○ Storage elements that can exist in one of two stable states, and
○ electronic circuits that can operate on binary data under the control of
control signals to implement the various computer functions.
● These storage elements and circuits can be implemented in digital logic,
specifically with combinational and sequential circuits.
● So, at the most basic level, a computer is a device(electronic circuit)
consisting of only 3 elementary/fundamental components:
1. Gates: is a device/electronic ckt that implements a simple Boolean or
logical function. It is a processor/computational unit which interpret and
execute instructions
2. Memory cell: is a device/electronic ckt that can store one bit of data;
that is, the device can be in one of two stable states at any time.
3. Conductive wires ,,a mechanism for transferring data/signal to and from.

0024
Elementary Components

● By interconnecting large numbers of these fundamental devices, we can


construct a computer.
○ Thus, a computer consists of gates, memory cells, and
interconnections among these elements.
○ The gates and memory cells are, in turn, constructed of simple
electronic components, such as transistors and capacitors..
0025
Stored Program Computers
● Virtually all contemporary computer designs are based on concepts developed
by John von Neumann at the Institute for Advanced Studies, Princeton.
○ Such a design is referred to as the von Neumann architecture and is
based on three key concepts:

1. Data and instructions are stored in a single read –write memory.

2. The contents of this memory are addressable by location, without


regard to the type of data contained there.

3. Execution occurs in a sequential fashion (unless explicitly


modified) from one instruction to the next.

0026
Stored Program Computers(Cont.)
● The reasoning behind these concepts was:\
○ There is a small set of basic logic components that can be combined in
various ways to store binary data and perform arithmetic and logical
operations on that data.

○ If there is a particular computation to be performed, a configuration


of logic components designed specifically for that computation could be
constructed.

○ We can think of the process of connecting the various components in the


desired configuration as a form of programming. The resulting “program”
is in the form of hardware and is termed a hardwired program

0027
Stored Program Computers(Cont.)

0028
Program Execution
● The basic function performed by a computer is execution of a program.
○ A program is a set of instructions stored in memory.

○ The processor does the actual work by executing instructions specified in the
program.

○ In its simplest form, instruction processing consists of three steps: fetch-


decode-execute.

● The fetch-decode-execute cycle is the fundamental process by which a computer


executes program instructions. It consists of three main steps that are repeated
for each instruction in a program.

0029
Program Execution(Cont.)
1. Fetch:
 The first step in the cycle is the fetch phase.
 The CPU fetches the next instruction from memory that is pointed to by the
program counter (PC), which is a register that holds the memory address of the
next instruction to be executed.
 The instruction is retrieved from the memory location indicated by the program
counter and loaded into the instruction register (IR) within the CPU.

2. Decode:
• In the decode phase, the CPU interprets the fetched instruction to
determine what operation needs to be performed.
• The control unit of the CPU decodes the instruction by identifying the opcode
(operation code) that specifies the operation to be carried out and any operands
or memory addresses associated with the instruction.
0030
Program Execution(Cont.)
3. Execute:
• Once the instruction has been fetched and decoded, the CPU proceeds to execute the
instruction in the execute phase.
• The ALU (Arithmetic Logic Unit) performs the actual operation specified by the
opcode, such as arithmetic calculations, logical operations, data transfers, or
branching to another part of the program.
• Depending on the instruction, data may be fetched from memory, processed by the
ALU, and stored back in memory or registers.

4. Repeat:
 After completing the execute phase and any subsequent write-back phase, the program
counter is incremented to point to the next instruction in memory, and the fetch-
decode-execute cycle repeats for the next instruction in sequence.
 This cycle continues until the program reaches a halt instruction or completes all
instructions in the program.

0031
Computer Booting Process
● The computer booting process is the sequence of events that occur when you turn on
a computer, leading to the operating system being loaded into memory and the system
becoming ready for use. Here is an explanation of the typical computer booting
process:
1. Power On: When you press the power button on a computer, it sends a signal to the power supply
unit to provide electricity to the components of the computer. This action initiates the booting
process.
2. Power-On Self Test (POST):The computer's hardware components, such as the CPU, memory, storage
devices, and peripherals, are checked during the Power-On Self Test (POST) phase. The POST ensures
that the hardware is functioning correctly before the operating system is loaded.
3. BIOS/UEFI Initialization: The BIOS/UEFI firmware locates the boot device where the operating system
is stored. This can be a hard drive, solid-state drive, optical drive, USB drive, or network
location. The boot order configured in the BIOS/UEFI determines the priority of boot devices.
4. Boot Device Selection: The BIOS/UEFI firmware locates the boot device where the operating system is
stored. This can be a hard drive, solid-state drive, optical drive, USB drive, or network location.
The boot order configured in the BIOS/UEFI determines the priority of boot devices.

0032
Computer Booting Process(Cont.)
5. Boot Loader Execution: Once the boot device is identified, the BIOS/UEFI hands over control to the
boot loader stored on the boot device. The boot loader is a small program that loads the operating
system kernel into memory.
6. Operating System Kernel Loading: The boot loader loads the operating system kernel into memory. The
kernel is the core component of the operating system that manages system resources, controls
hardware devices, and provides essential services to applications.
7. Operating System Initialization: After the kernel is loaded, the operating system initialization
process begins. The operating system initializes device drivers, starts system services, and
prepares the user interface for interaction.
8. User Login/Interface: Once the operating system initialization is complete, the user is presented
with a login screen or desktop environment. The user can log in and start using the computer with
access to applications and files.

9. Ready State: After completing the booting process, the computer is in a ready state for the user to
perform tasks, run programs, access data, and utilize various features provided by the operating
system.

0033
Introduction to Microprocess
03 What is Microprocessor?

0034
What is Microprocessor
Processor (in computing ): a processor or processing unit is
an electronic component (digital circuit) that performs
operations on an external data source, usually memory or some
other data stream.

● It typically takes the form of a microprocessor


● Types:
● CPU
● Graphics processing units (GPUs)
● Coprocessor
● Field-programmable gate arrays (FPGAs); etc

0035
What is Microprocessor
● Microprocessor is a controlling unit of a micro-computer, fabricated on a small chip
capable of performing ALU (Arithmetic and Logical Unit) operations and communicating
with other devices connected to it.
○ is designed to execute instructions and carry out tasks in a computer
system.
○ contain both combinational logic and sequential digital logic, and
operate on numbers and symbols represented in the binary number
system.

● The term microprocessor and microcontroller have always been confused each other. Both
of them are ICs and have been designed for real time application. They share many
common features and at the same time they have significant differences.

0036
● Microprocessor: is an IC which has only the CPU inside them i.e., only the
processing power.
○ These microprocessors don’t have RAM, ROM, and other peripheral on the chip.

● Microcontroller: has a CPU, in addition with a fixed amount of RAM, ROM and other
peripherals all embedded on a single chip. Sometimes it is also termed as a mini
computer or a computer on a single chip. They are designed for to perform specific
tasks.

● A microcomputer is a small relatively inexpensive computer with a microprocessor as


its Central Processing Unit (CPU). It includes a microprocessor, memory, and
input/output (I/O) facilities

0037
Evolution of Microprocess
04 First, Lets review basic terms and
concepts of Computers.

0038
History of Intel Processors
● Fairchild Semiconductors (founded in 1957) invented the first IC in 1959.

● In 1968, Robert Noyce, Gordan Moore, Andrew Grove resigned from Fairchild
Semiconductors.

● They founded their own company Intel (Integrated Electronics).

● Intel grown from 3 man start-up in 1968 to industrial giant by 1981

● One of its most successful products is the Intel microprocessor. We will see
its historical background is described below

0039
0040
0041
IBM PC/AT (1984)

Compaq Deskpro 386 (1986)


“Further dig out by
yourself”
Thanks!
Do you have any questions?
Bushra.kmb@gmail.com
+251-9-5347-5685

https://github.com/Bushra-KB

@JustBKM

You might also like