0% found this document useful (0 votes)
177 views10 pages

Microprocessor and Peripherals Interfacing Notes: Course Code: ECC501 Class: TE-EXTC Mumbai University

The document provides information about a course on microprocessor and peripherals interfacing. The course objectives are to understand microcomputer systems, develop expertise in the 8086 microprocessor and 8087 coprocessor, write assembly language programs, and understand peripheral interfacing. Key topics covered include the architecture of microprocessor-based systems, components like the CPU, memory, I/O devices, and buses. The document also discusses assembly language programming and its advantages over higher-level languages.

Uploaded by

Anikhet Mulky
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)
177 views10 pages

Microprocessor and Peripherals Interfacing Notes: Course Code: ECC501 Class: TE-EXTC Mumbai University

The document provides information about a course on microprocessor and peripherals interfacing. The course objectives are to understand microcomputer systems, develop expertise in the 8086 microprocessor and 8087 coprocessor, write assembly language programs, and understand peripheral interfacing. Key topics covered include the architecture of microprocessor-based systems, components like the CPU, memory, I/O devices, and buses. The document also discusses assembly language programming and its advantages over higher-level languages.

Uploaded by

Anikhet Mulky
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/ 10

Microprocessor and Peripherals Interfacing Notes

Course Code: ECC501


Class : TE-EXTC Mumbai University

Course prerequisite: Digital System Design

Course objectives:
 To understand the basic concepts of microcomputer systems.
 To develop background knowledge and core expertise in 8086 microprocessor and co-
processor 8087.
 To write assembly language programs for 8086 microprocessor
 To understand peripheral devices and their interfacing to 8086 and to study the design
aspects of basic microprocessor based system.

Course outcomes:
After successful completion of the course student will be able to
 Understand the basic concepts of microcomputer systems.
 Understand the architecture and software aspects of microprocessor 8086.
 Write Assembly language program in 8086.
 Know the Co-processor configurations.
 Interface peripherals for 8086.
 Design elementary aspect of microprocessor based system.

Compiled by Vishal Gaikwad, SIESGST.


CHAPTER 1 - Introduction to Microcomputer System

 Block diagram of microprocessor based system: CPU, I/O Devices,


 Clock, Memory, Concept of Address, Data and Control Bus and Tristate logic.
 Need of Assembly Language and its Comparison with higher level languages
 Need of Assembler and Compiler and their comparison.

Compiled by Vishal Gaikwad, SIESGST.


Microprocessor:
A microprocessor also called the CPU is the heart of the computer system or any computing
device.
It is a semiconductor chip which can be programmed to do various functions. It executes the
instruction and provides the resultant output.
Some of the example of microprocessor include 8085, 8086, Pentium, i3, i5 etc.
The first microprocessor was the Intel 4004, introduced in 1971.
A microprocessor or CPU consists of a control unit and an arithmetic and logical unit (ALU).
It is responsible for all the computational, arithmetic, logical and data processing task
performed by the computer. Every microprocessor has a fixed set of instruction for its
operation.

Block diagram of microprocessor based system:

[Figure 1: Microprocessor based system]

CPU
The CPU is the heart and brain of a computer. It receives data input, executes instructions, and
processes information. It communicates with input/output (I/O) devices, which send and
receive data to and from the CPU. Additionally, the CPU has an internal bus for communication
with the internal cache memory. The CPU contains internal memory units, which are called
registers. These registers contain data, instructions, counters and addresses used in the ALU's
information processing.

Compiled by Vishal Gaikwad, SIESGST.


I/O Devices
In computing, input/output or I/O is the communication between a processor/computer and the
outside devices like keyboard, mouse, printer etc.
Inputs are the signals or data received by the system and outputs are the signals or data sent
from it. I/O devices are the hardware’s used by a human (or other system) to communicate with
a computer. For instance, a keyboard or computer mouse is an input device for a computer,
while monitors and printers are output devices. Devices for communication between
computers, such as modems and network cards, typically perform both input and output
operations.

Clock

In a computer, clock speed refers to the number of pulses per second generated by an oscillator
that sets the tempo for the processor. Clock speed is usually measured in MHz (megahertz, or
millions of pulses per second) or GHz (gigahertz, or billions of pulses per second). Today's
personal computers run at a clock speed in the hundreds of megahertz and some exceed one
gigahertz. The clock speed is determined by a quartz-crystal circuit, similar to those used in
radio communications equipment.
Computer clock speed has been roughly doubling every year. The Intel 8088, common in
computers around the year 1980, ran at 4.77 MHz. The 1 GHz mark was passed in the year
2000.
8086 requires an external clock generator/driver chip Intel 8254 to generate the 8086 clock
input signal. The 8086 divides the external clock connected at the CLK pin internally by three.

Memory

Semiconductor memory is a digital electronic data storage device, often used as computer
memory, implemented with semiconductor electronic devices on an integrated circuit (IC).
There are many different types of implementations using various technologies.
Most types of semiconductor memory have the property of random access, which means that
it takes the same amount of time to access any memory location, so data can be efficiently
accessed in any random order.
Microprocessor doesn’t contain any internal RAM/ROM memory, they are normally interfaced
externally.

Compiled by Vishal Gaikwad, SIESGST.


Address, Data and control BUS
Microprocessor is processing unit of every computing device. It is like an artificial brain.
It needs to communicate with Input devices to get data, it needs to communicate with memory
to process data according to instructions written in memory and finally it needs to communicate
with output devices to display the output on O/P devices. To communicate with external world,
Microprocessor make use of buses.
There are different types of buses used in Microprocessor:
1. Address Bus
2. Data Bus
3. Control Bus

1. Address Bus:

It is a group of wires or lines that are used to transfer the addresses of Memory or I/O devices.
It is unidirectional. In Intel 8086 microprocessor, Address bus was of 20 bits.
It can access 220 = 10, 48,576 locations in memory, as in 8086 memory is mostly byte
organized means at each location/address memory can store 8 bits=1 byte of data, therefore 10,
48,576 locations multiplied by one byte is equal to 10,48,576 bytes = 1Mb.

2. Data Bus:
As name tells that it is used to transfer data within Microprocessor and Memory/Input or Output
devices.
It is bidirectional as Microprocessor requires to send or receive data.

3. Control Bus:
Microprocessor uses control bus to process data that is what to do with the selected memory
location.
Some control signals are Read, Write and Opcode fetch etc.
Various operations are performed by microprocessor with the help of control bus.
This is a dedicated bus, because all timing signals are generated according to control signal.

Tristate Logic
A tri-state buffer is similar to a buffer, but it adds an additional "enable" input that controls
whether the primary input is passed to its output or not. If the "enable" inputs signal is true,

Compiled by Vishal Gaikwad, SIESGST.


the tri-state buffer behaves like a normal buffer. If the "enable" input signal is false, the tri-
state buffer passes a high impedance (or hi-Z) signal, which effectively disconnects its output
from the circuit.
Tri-state buffers are often connected to a bus which allows multiple signals to travel along the
same connection.

It allows two or more devices to share/write to the same bus line.


It has three output states: Zero, One and Disconnected (high impedance) [0, 1, Z].
It has a control line usually called enable or chip enable. This makes the output active.
It responds to one unique address provided on the address bus. This could be a memory
location or an I/O location.
There is a control bus line that selects memory mapping or I/O mapping allowing the same
addresses to be used for either. This still guarantees that one and only one device is ever
active.

Tristate Logic used for BUS Sharing


Only one tristate device can use the bus at any time.
The processor controls which device has access to the bus by setting the address on the
address bus. The devices not using the bus are disconnected. Their outputs are set to have a
high impedance. Tristate devices respond to a unique address on the address bus.

Need of Assembly Language:


An assembly language is a programming language that can be used to directly tell the computer
what to do. An assembly language is almost exactly like the machine code that a computer can
understand, except that it uses words in place of numbers. A computer cannot really understand
an assembly program directly. However, it can easily change the program into machine code

Compiled by Vishal Gaikwad, SIESGST.


by replacing the words of the program with the numbers that they stand for. A program that
does that is called an assembler.
Programs written in assembly language are usually made of instructions, which are small tasks
that the computer performs when it is running the program. They are called instructions because
the programmer uses them to instruct the computer what to do. The part of the computer that
follows the instructions is the processor.
An assembly language is the most basic programming language available for any processor.
With assembly language, a programmer works only with operations that are implemented
directly on the physical CPU.

Need of ALP

1. Complete control over a system’s resources

As a programmer, the closest you can come to the processor of a machine is by using assembly
language. Here, you can write code to access the registers and even deal with memory addresses
directly for retrieving values and pointers. So, if you are writing a program that has a great
algorithm, you are going to benefit greatly. This is mainly because assembly language is the
gateway to optimization in speed, thereby offering great efficiency and performance.

2. Understanding processor and memory function

If you are writing a program that is meant to be a compiler or a device driver, then a complete
understanding of the processor’s function is a big plus. So, in this case the best option is to
write some code in assembly language and see how the processor and the memory work.
3. Direct access to hardware

Assembly language is the only language that speaks to the computer/machine directly. It is the
language that a certain CPU recognizes and different CPUs recognize different types of them.

4. Assembly language is transparent

When compared to high-level languages, which are mostly in the form of abstract data types,
assembly language is bare and transparent. This is largely since it has a small number of
operations. So, this is very helpful for algorithm analysis, consisting of semantics and flow of
control. It also makes it easier for debugging, as it is less complex. Overall, there is less
overhead as compared to high-level languages.

Compiled by Vishal Gaikwad, SIESGST.


5. Hardware specific code, such as device drivers

6. Embedded devices, where size of the code is important

7. Low level code where performance is critical etc.

Low Level and High Level Programming Language

Sr.No. Low Level Programming Language High Level Programming Language


1 Low-level languages are difficult to learn. High-level languages are easy to learn.
2 Programs in low-level languages are fast Programs in high-level languages are slow
in execution. in execution.
3 Deep knowledge of hardware is required Knowledge of hardware is not required to
to write programs. write programs.
4 These languages are normally used to These languages are normally used to write
write hardware programs. application programs.
5 Low Level programming languages are High Level programming languages are
platform dependent that means programs platform independent that means programs
written in Low Level language can run on written in High Level language can run on
the same hardware with same different hardware with different
configuration, you cannot run them on configuration
hardware that has different configuration
6 Assembly needs an Assembler to translate High Level Languages are translated by the
an Assembly program to its equivalent compilers or interpreters
Binary/Machine Code.
7 e.g. machine language and assembly e.g. Java, C++, MATLAB etc
language

Need of Compiler and Assembler and their comparison

Compiler

The compiler is a computer program that reads the program written in a source language,
translates it into equivalent assembly language and forwards the assembly language code to the
Assembler. While the translation of the source code to assembly code the compiler also reports
the error in the source code to its user.
Compilers are also classified as single-pass, multi-pass, load-and-go, debugging and
optimization. Classification is done on the basis of what function does a compiler perform and

Compiled by Vishal Gaikwad, SIESGST.


how it has been constructed. Despite these complexities, the basic task of compiler remains
same.
The compilation is performed in two parts, analysis part and synthesis part. The analysis part
breaks the source code into constituent pieces and forms the intermediate representation of the
source code. The synthesis part forms the target code from the intermediate representation.
The compilation is performed in the following phases:
Lexical analyzer, syntax analyzer, semantic analyzer, intermediate code generator, code
optimizer, code generator, Symbol table and error Handler.
 The lexical analyzer reads the characters of source code and groups them into the streams
of tokens. Each token represents the logical sequence of characters like keyword, identifiers,
and operators. The sequence of character that forms a token is called lexeme.
 The syntax analyzer parses the token obtained from lexical analyzer and groups tokens into
a hierarchical structure.
 The semantic analyzer checks the source code for any semantic error.
 Intermediate code generator generates the intermediate representation of the source code
 The code Optimizer optimizes the intermediate code into faster running machine code.
 The code generator finally generates the target code which is a relocatable machine code or
an assembly code.
 The symbol table is a data structure which contains the record for each identifier in the
source code.
 Error handler detects the error in each phase and handles those errors.

Assembler
The assembler takes as input the assembly code generated by the compiler and translates it into
relocatable machine code.
Assembly code is the mnemonic version of machine code. It means it assembly code uses
names for representing operations and it even gives names to the memory addresses. On the
other hands, the machine code uses binary codes for representation of operations and memory
addresses.
Even the simplest form of assembler performs two passes over the input.
The first pass detects all the identifiers in the assembly code that denotes storage location and
store them in the symbol table (other than compilers symbol table). The storage location is
assigned to the identifier that is encountered in the first pass.

Compiled by Vishal Gaikwad, SIESGST.


In the second pass, the input is scanned again, and this time the operation code are translated
into a sequence of bits representing that operation in the machine code. The second pass also
translates identifiers into the addresses defined in the symbol table. Thus the second pass
generates the relocatable machine code.
Sr.No. Assembler Compiler
1 Assembler is a software or a tool that Compiler is a computer program that
translates Assembly language into reads code (like C,C++ code )and
machine code translates into machine language.
2 Assembler is used in low-level Compiler is used in high-level language.
Assembly language
3 Requires less memory Requires more memory
4 e.g. TASM, MASM e.g. gcc , Microsoft Visual Studio

Compiled by Vishal Gaikwad, SIESGST.

You might also like