0% found this document useful (0 votes)
93 views80 pages

1 History of Microprocessor

The document describes a course on microprocessors and peripheral devices. The course objectives are for students to understand 8086 microprocessor architecture, enhance programming techniques, demonstrate interfacing techniques, and design microprocessor applications. Topics covered include 8086 architecture, instruction set, assembly language programming, interrupts, interfacing with peripherals like timers and I/O ports. Experiments include data transfer, arithmetic operations, and interfacing add-on cards. Course outcomes are for students to explain microprocessor functioning, do interfacing projects, enhance programming skills, and understand assembler directives and operators.

Uploaded by

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

1 History of Microprocessor

The document describes a course on microprocessors and peripheral devices. The course objectives are for students to understand 8086 microprocessor architecture, enhance programming techniques, demonstrate interfacing techniques, and design microprocessor applications. Topics covered include 8086 architecture, instruction set, assembly language programming, interrupts, interfacing with peripherals like timers and I/O ports. Experiments include data transfer, arithmetic operations, and interfacing add-on cards. Course outcomes are for students to explain microprocessor functioning, do interfacing projects, enhance programming skills, and understand assembler directives and operators.

Uploaded by

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

Microprocessors and Peripheral

Devices

EEN 208
4 CREDITS
3-0-2
EEN 208

Course Objectives:
At the end of the course, the students should
be able to
■ Explain the architecture of 8086
microprocessor
■Enhance the programming techniques
■Demonstrate various interfacing techniques.
■Design a microprocessor based application
Microprocessor 8086
■ Introduction to Microprocessors and Microcomputers, 8086 Microprocessor
architecture, Pin configuration, Register organisation of 8086, physical
memory organisation, General bus operation, Special processor activities,
Minimum Mode 8086 System and Timings, Maximum Mode 8086 System
and Timings.
■ Instruction Set And Assembler Directives
■ Machine Language Instruction Formats, Addressing Modes of 8086,
Instruction Set of 8086, , Data transfer, Arithmetic, Branch, loop, machine
control, logical, shift and rotate instructions, I/O Assembler Directives and
Operators.
■ Assembly Language Programming With 8086
■ Machine Level Programs, Programming with an Assembler, Assembly
Language Example Programs.
■ Special Architectural Features And Related Programming:
■ Introduction to stack, stack Structure of 8086, Interrupts and Interrupt Service
Routines, Interrupt Cycle of 8086, Non Maskable Interrupt, Maskable
Interrupt, Interrupt Programming, .
Basic Peripherals And Their Intrfacing With 8086
■ Memory interfacing, Programmable Interval Timer (8253/8254),
Programmable Interrupt Controller (8259), Keyboard/Display Controller
(8279),, DMA Controller (8237/8257).
■Interfacing I/O Ports, PIO 8255 (Programmable Input-Output Port),
Operation of 8255, Interfacing Analog to Digital Data Converters,
Interfacing Digital to Analog Data Converters.

■Special Purpose Programmable Peripheral Devices And Their


Interfacing:
■Programmable Interval Timer 8253, Introduction to Serial
Communication, Programmable Communication Interface 8251.

■Microprocessor applications –Stepper motor control ,Temp.


Control.etc
■ 
List of Experiments:
■8086 based experiments for data transfer operations.
■8086 based experiments for arithmetic operations.
■8086 based experiments for logical operations.
■8086 based experiments for sorting.
■8086 based experiments for data conversions
■8086 based experiments for interfacing various add on cards
■To study and interface 8255 chip with 80x86/Pentium Trainer system.
■To study and interface 8251 chip with 8086/80x86/Pentium Trainer system.
■To study and interface 8259 chip with 8086/80x86/Pentium Trainer system.
■To interface and control a stepper motor using the stepper motor controller card
and stepper motor drives.
■To acquire a unipolar analog signal and convert it into a digital value using
A/D Card.
■To acquire a bipolar analog signal and convert it into a digital value using A/D
Card.
Course Outcomes:

■By the end of this course student will be able to:

1 Explain the functioning of microprocessor.


2 Do projects based on interfacing.
3 Enhance the programming skills.
4 Identify the importance of Assembler Directives
and Operators
Suggested Books:
■ Advanced Microprocessors & peripherals by A K Ray & K
M Bhurchandi, TMH Publication. 2013
■ Intel Microprocessors by- Berry B.Brey, Printance Hall. 2009
■ Microprocessor & Interfacing by Douglas V Hall, TMH
Publication2006
■ Microcomputer Systems: 8086/8088 Family Architecture,
Design and Programming, Chen Liu and Glenn A Gibson,
Pearson Education Limited. 2009
Evaluation

■ Mid Semester
■ End Semester
■ Quizes
■ Assignment Tests
■ Project
■ Performance in practicals
■ Practical file
■ Quiz/final practical performance/viva
■ Surprise tests
THE BRIEF HISTORY OF
MICROPROCESSOR
WHAT IS MICROPROCESSOR ?

▪ The Microprocessor
is a Programmable
device.

▪ It has computing &


decision making
capabilities.

Fig:- Microprocessor Chip


HOW DOES THE
MICROPROCESSOR WORK ?
▪ The Microprocessor
reads BINARY
instructions from a
storage device, called –
MEMORY.

▪ It accepts binary data


as input and processes
data according to the
instructions.

Fig:-BASIC MICROPROCESSOR BASED SYSTEM ARCHITECTURE


AUTOMATION

MICROPROCESSOR MICRONTROLLER
The necessary blocks of a
microprocomputer/controller

■ CPU: Central Processing Unit


■ I/O: Input /Output
■ Bus: Address bus & Data bus
■ Memory: RAM & ROM
■ Timer
■ Interrupt
■ Serial Port
■ Parallel Port
Applications of Microprocessors
Two categories –
1.Reprogrammable systems-e.g. microcomputers

Microprocessor used for computing & data


processing.
Includes general purpose microprocessors
capable of handling large data , data storage
devices (disks, CD) and peripherals such as .
Printers.
2.Embedded System

■ Embedded system means the processor is


embedded into that application.
■ An embedded product uses a microprocessor
or microcontroller to do one task only.
■ In an embedded system, there is only one
application software that is typically burned
into ROM.
■ Example : Washing machines, keyboard, video
game player etc
Microprocessors
General-purpose microprocessor
■ CPU for Computers
■ No RAM, ROM, I/O on CPU chip itself
■ Example : Intel’s x86, Motorola’s 680x0

Many chips on mother’s board


Data Bus
CPU
General-
Purpose I/O Serial
RAM ROM Timer COM
Micro- Port
processor Port

Address Bus
General-Purpose Microprocessor System
Microcontrolle
r
■ A smaller computer
■ On-chip RAM, ROM, I/O ports...
■ Example : Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X

CP RAM ROM
U A single chip
Serial
I/O Timer COM
Port Port
Microcontroller
Microprocessor vs. Microcontroller
Microprocessor Microcontroller
■ CPU is stand-alone, • CPU, RAM, ROM, I/O
RAM, ROM, I/O, timer and timer are all on a
are separate single chip
• fix amount of on-chip
■ designer can decide on
ROM, RAM, I/O ports
the amount of ROM,
• for applications in
RAM and I/O ports. which cost, power and
■ expansive space are critical
■ versatility • single-purpose
■ general-purpose
What is a Microprocessor?
■ The word comes from the combination Micro and
processor.
❑Processor means a device that processes whatever.
In this context processor means a device that
processes numbers, specifically binary numbers, 0’s
and 1’s.
■ To process means to manipulate. It is a general
term that describes all manipulation. Again in this
content, it means to perform certain operations on
the numbers that depend on the microprocessor’s
design.
19
Definition of the Microprocessor

The microprocessor is a multipurpose,clock-


driven, register-based programmable device
that takes in numbers, performs on them
arithmetic or logical operations according to the
program stored in memory and then produces
other numbers as a result.

20
Definition (Contd.)
Expanding each of the underlined words:
❑ Programmable device: The microprocessor can
perform different sets of operations on the data it
receives depending on the sequence of
instructions supplied in the given program.
By changing the program, the microprocessor
manipulates the data in different ways.

❑ Instructions: Each microprocessor is designed to


execute a specific group of operations. This group
of operations is called an instruction set. This
instruction set defines what the microprocessor
can and cannot do.
21
Definition (Contd.)

❑ Takes in: The data that the microprocessor


manipulates must come from somewhere.
■ It comes from what is called “input devices”.
■ These are devices that bring data into the system from
the outside world.
■ These represent devices such as a keyboard, a mouse,
switches, and the like.

22
Definition (Contd.)
❑ Numbers: The microprocessor has a very narrow view
on life. It only understands binary digits,0 and 1.
A binary digit is called a bit (which comes from binary
digit).
Generally 0 represents one voltage level and 1
represents another.
0 and 1 are synonymous with low and high.

The microprocessor recognizes and processes a group


of bits together. This group of bits is called a “word”.

The number of bits in a Microprocessor’s word, is a


23measure of its “abilities”.
Definition (Contd.)
❑ Words, Bytes, etc.
■ The earliest microprocessor (the Intel 8088 and Motorola’s 6800)
recognized 8-bit words.
❑ They processed information 8-bits at a time. That’s why they are called
“8-bit processors”. They can handle large numbers, but in order to
process these numbers, they broke them into 8-bit pieces and processed
each group of 8-bits separately.
■ Later microprocessors (8086 and 68000) were designed with 16-bit
words.
❑ A group of 8-bits were referred to as a “half-word” or “byte”.
❑ A group of 4 bits is called a “nibble”.
❑ Also, 32 bit groups were given the name “long word”.
■ Today, all processors manipulate at least 32 bits at a time and there
exists microprocessors that can process 64, 80, 128 bits or more at a
time.

24
Definition (Contd.)
❑ Arithmetic and Logic Operations:
■ Every microprocessor has arithmetic operations such as add
and subtract as part of its 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.

25
Definition (Contd.)
❑ Program: A program is a sequence of instructions
that bring data into the microprocessor, processes
it and sends it out.

■ There are many programming languages (C, C++,


FORTRAN, and JAVA…) However, these programming
languages can be grouped into three main levels .
■ Machine language
■ Assembly language
■ High level Language

26
Definition (Contd.)
❑ Programming Languages
■ Machine language
❑ Machine language is the lowest level programming language. I
is a language intended to be understood by the microprocesso
(the machine) only.
In this language, every instruction is described by binary
patterns.
e.g. 11001101 may mean 1 + 2

This is the form in which instructions are stored in memory.


This is the only form that the microprocessor understands.

27
Definition (Contd.)
❑ Programming Languages
■ Assembly language
❑ This language is more understandable by humans. In this
language, the binary patterns are assigned mnemonics
❑ (short abbreviated names).

e.g. “Add 1,2” is assigned to the machine language pattern


11001101 mentioned above to refer to the operation 1+2.

There is usually one assembly language instruction for each


machine language instruction.

28
Definition (Contd.)
❑ Programming Languages
■ High level languages
❑ These are languages like C, PASCAL and FORTRON. These
are more natural for humans to use than assembly or machine
languages. They are also more compact (i.e. it takes less
statements to write the program).
One high level instruction translates into many assembly
or machine language instructions.
e.g. x = y + z may translate into:
MOV 1000, R1
MOV 1004, R2
ADD R1, R2
MOV R1, 1008
29
Definition (Contd.)

❑ Programming Languages
■ The new level being developed: is ultra high level
languages which would contain things like C++, and
JAVA.
❑ Here a single instruction may translate into
hundreds of assembly or machine language
instructions.

30
Definition (Contd.)
Stored in memory :
■ First, what is memory?
❑ Memory is the location where information is kept while not in current use.
❑ It is like pages of a book with spaces for fixed no. of bits in each line.
However these pages are made of semiconductor material.
❑ Memory is a collection of storage devices. Usually, each storage device hold
one bit. Also, in most kinds of memory, these storage devices are grouped
into groups of 8. These 8 storage locations can only be accessed together.
So, one can only read or write in terms of bytes to and from memory.
❑ Memory is usually measured by the number of bytes it can hold. It is
measured in Kilos, Megas and lately Gigas.
❑ A Kilo in computer language is 210 =1024.
❑ So, a KB (KiloByte) is 1024 bytes.
❑ Mega is 1024 Kilos and Giga is 1024 Mega.

31
Definition (Contd.)
❑Stored in memory:
■ When a program is entered into a computer, it is
stored in memory.
■ Then as the microprocessor starts to execute the
instructions, it brings the instructions from memory
one at a time.

■ Memory is also used to hold the data.


❑ The microprocessor reads (brings in) the data
from memory when it needs it and writes (stores)
the results into memory when it is done.

32
Definition (Contd.)

❑ Produces: For the user to see the result of the


execution of the program, the results must be
presented in a human readable form.
■ The results must be presented on an output device.

■ This can be the monitor, a paper from the printer, a


simple LED or many other forms.

33
EVOLUTION OF COMPUTER

❑ First generation (1889-1954) -vacuum tube

IBM 650,
1954
EVOLUTION OF COMPUTER
The Mechanical age: -abacus : 500 B.C.
-calculator(with gears and wheels) : Pascal
❑ First generation (1889-1954) -vacuum tube

The Electrical age: -Hollerith machine(1889)


-ENIAC(Electronics Numerical Integrator &
Calculator)
-first general-purpose, programmable electronic
computer
-17,000 vacuum tube, 500 IBM
miles650,
of wire, 6000
switches 1954
-life of vacuum tube(3000 hours) : maintenance
problem
❑ Second generation (1954-1959)
-transistor
Bipolar Transistor : 1948, William Shockley, John Bardeen,
Walter H. Brattain at Bell labs(1956, Novel physics
award)
Mainframe : describe CPU portion of computer
Mainframe computer : designed to handle large volumes of
data while serving hundreds of users simultaneously
Built on circuit boards mounted into rack panels(frame)

Manchester University Experimental Transistor


Computer
❑ Third generation (1959-1971) -
IC
⮚ Integrated Circuit : 1958,Jack Kilby (Texas Instruments)
& Dr. Robert Noyce (Fairchild Semiconductor).
⮚ IBM : 32-bit 360 series(1964)
⮚ INTEL(Integrated Electronics) : 1968

PDP-8, Digital Equipment


Corporation
⎯ Thanks to the use of ICs, the DEC
PDP-8
is the least expensive general
purpose small
computer in 1960s
❑ Fourth generation (1971-present) - microprocessor

4- Bit processor-
MCS-4 Family - 4004 (used in calculator),
4001, 4002,4003,4008,4009
MCS-40 Family- 4040, 4101,4207,4209 etc.
8- Bit processor- 8008,8080,8085 etc
16- Bit processor- 8086,8088,80186,80286 etc.
32- Bit processor- 80386DX, 80386SX, 80376,pentium
Pentium pro, II, etc.
64- Bit processor- Intel Pentium, core i3, core
i5,core i7,etc
Evolution of Intel Microprocessors
Number of Minimum transistor
transistorsPen P III sizes (µm)
808
P4 0
tiu
803 P II
m
808 86
8 802 808
86
808 8
0 803
86 Pen
802 tiu P II P III P 4
86 m

Clock
frequencies
P4
(MHz)
P II
Pen P III
803 tiu
808 86 m
808 8
0 802
86
4 – BIT MICROPROCESSORS

▪ World’s FIRST
Microprocessor is –
INTEL 4004.

▪ It is a 4 bit
microprocessor based on
LSI Technology.

▪ APPLICATION:-
Fig:- INTEL 4004 Video games, Microwave
ovens, Calculators.

▪ DRAWBACKS:-
Slow, Small Memory Size.
8 – BIT MICROPROCESSORS

▪ In 1972,8-bit microprocessor Intel


8008 had been launched.
▪ It can address 16KB memory.

▪ In 1974, Intel 8080 came with 10


Fig:- INTEL 8008 times higher speed.
▪ Addresses 64KB memory.

▪ APPLICATION:-
Calculator, Traffic Signal Control,
Altair 8800 Computer (First PC).

Fig:- INTEL 8080


Z- 80 MICROPROCESSOR

▪ Z-80 microprocessor is
manufactured by Zilog
Corporation on July,1976.

▪ It has 16bit Address Bus &


8bit Data Bus.

▪ Required less hardware for


Fig:- Zilog Z-80
power supply.
APPLICATIONS OF Z-80

Fig:-Z80 CPU formed on Glass Substrate

Fig:- Programming Graphing Calculator


Fig:- WRIST COMPUTER
BASIC FEATURES OF 8085
• 8085 is a 8-bit
microprocessor.

• It is capable of
addressing 64KB of
memory.

• It has 40 pins &


requires +5V of power
supply.

• Required Clock
Fig:- Intel 8085 frequency is 3MHz.
8085
Introduced in 1977
8-bit with 40-pin dual in line package
16-bit address
bus
4500 transistors
8086
Introduced in 1978
20-bit address bus : access up to 1MB memory
16-bit Internal processor registers also can process 8
bit.
A separate BIU & EU: fetch & execute simultaneously
40-pin DIP package, 29k
transistors,
8088
Introduced in 1979, almost similar to 8086
20-bit address bus: access up to 1Mb memory
external 8-bit data bus, 16 bit
Internal VDD
(5V)

8-bit 20-bit
data addre
ss
contr 80 contr
∙∙

ol 88 ∙∙∙ ol
signal signal
s s
ToC from
L
8088
K G 8088
N 8088 signal
80286
24-bit address bus : 16M byte
memory
added 16 new
instructions
Identical to 8086 except the addressing
and higher clock speed
134k transistors
PGA(pin grid array)

6-12 MHz
Introduces “VIRTUAL MEMORY CONCEPT”
80386
flexible 32-bit Microprocessor(1986) : data bus,
registers
32-bit address bus(4G byte physical)
64 terabyte virtual
4G maximum segment size
Support 16k
segments
Concept of paging was
introduced
Available in 20MHz to
33MHz
132-PIN grid array
package
Pentium
� Increasing the complexity of the IC:
if every line could be shrunk in half, same circuit could be
built in one-forth the area
� Superscalar : support 2 instruction pipelines(5 stage)
actually execute two different instruction simultaneously
� Pentium(1993) : originally labeled P5(80586)
- 60 - 66MHz(110MIPS)
-8K code cache, 8K data cache
-coprocessor : redesign(8-stage instruction pipeline)
-64 bit AB(higher data transfer rates)
Pentium PRO
� Code named P6 : 1995
-basic clock frequency : 150-166MHz
� Two chips in one : two separate silicon die
� Superscalar processor of degree three-
-12 stage
� Internal cache :
� level one(L1) : 8K instruction and data cache
� level two(L2) : 256K(or 512K)
� 36-bit address bus : 64G byte memory
� has been optimized to efficiently execute 32-bit code
Pentium III
1. used faster core than Pentium
is still P6 or Pentium pro processor
2. Two version :
1. slot 1 version mounted on a plastic cartridge
512K cache : one-half the clock speed
2. socket 370 version called flip-chip : looks like the
older Pentium package → Intel claim cost less
256K cache : clock speed
3. clock frequency : 1 GHz
104 increase in transistor count, clock frequency over 30 years!

Case Study: Intel Processors Slide 56


Microprocessor Fifth Generation Pentium

Fourth Generation
During 1980s
Low power version of HMOS
technology (HCMOS)
Third Generation 32 bit processors
During 1978 Physical memory space 224 bytes =
HMOS technology ⇒ Faster speed, 16 Mb
Higher packing density Virtual memory space 240 bytes = 1
16 bit processors ⇒ 40/ 48/ 64 pins Tb
Easier to program Floating point hardware
Dynamically relatable programs Supports increased number of
Processor has multiply/ divide addressing modes
arithmetic hardware
More powerful interrupt handling Intel 80386
capabilities Second Generation
Flexible I/O port addressing During 1973
NMOS technology ⇒ Faster speed,
Intel 8086 (16 bit processor) Higher density, Compatible with TTL
4 / 8/ 16 bit processors ⇒ 40 pins
First Generation Ability to address large memory
Between 1971 – 1973 spaces and I/O ports
PMOS technology, non compatible with Greater number of levels of
TTL subroutine nesting
4 bit processors ⇒ 16 pins Better interrupt handling capabilities
8 and 16 bit processors ⇒ 40 pins 57
Due to limitations of pins, signals are Intel 8085 (8 bit processor)
WHERE WE STAND NOW ?

Itanium,
Pentium
Dual Core, Intel 80386,
Core i3, i5, i7 80486,
Pentium P5, Intel 8086,
P6,Pentium 4 8088, 80186,
64-BIT MP Intel 8008,
80286
32-BIT MP 8080,
8085, Z-80
16-BIT MP
Intel 4004
8-BIT MP
4-BIT MP

Latest Version of Intel Microprocessor – Core i7. Introduced on 16 March,2010


A Microprocessor-based system
The following block diagram represents a
microprocessor-based system(Microcomputer).
A computer with microprocessor as its CPU is
known as microcomputer.

o
r
ess
roc
Input Output

rop
Mic

Memory

59
Inside The Microprocessor

■ Internally, the microprocessor is made up of 3


main units.
❑ The Arithmetic/Logic Unit (ALU)
❑ The Control Unit.
❑ An array of registers for holding data while it is
being manipulated.

60
Organization of a microprocessor-based system

■ Let’s expand the picture a bit.


I/O
Input / Output

ALU Register
Array
System Bus

Control
Memory

ROM RAM

61`1
Organization of the Microprocessor
❑ The microprocessor can be divided into three main pieces:
■ Arithmetic/Logic Unit
❑ Performs all computing and logic operations such as addition and
subtraction as well as AND, OR and XOR.
■ Register Array
❑ A collection of registers within the microprocessor itself. These are
used primarily for data storage during program execution. The number
and the size of these registers differ from one microprocessor to the
other.
■ Control Unit
❑ As the name implies, the control Unit controls what is happening in the
microprocessor. It provides the necessary control and timing signals to
all operations in the microprocessor as well as its contact to the
outside world.

62
Memory
■ Memory stores information such as instructions and data in
binary format (0 and 1). It provides this information to the
microprocessor whenever it is needed.

■ Usually, there is a memory “sub-system” in a


microprocessor-based system. This sub-system includes:
❑ The registers inside the microprocessor
❑ Read Only Memory (ROM)
■ used to store information that does not change.
❑ Random Access Memory (RAM) (also known as Read/Write
Memory).
■ used to store information supplied by the user. Such as programs
and data.

63
Memory
■ To execute a program:
❑ the user enters its instructions in binary format into the memory.
❑ The microprocessor then reads these instructions and whatever
data is needed from memory,
executes the instructions and
places the results either in memory or
produces it on an output device.

64
I/O Input/Output
■ Input and output devices are the system’s
means of communicating with the outside
world. These devices are collectively known
as peripherals.
❑ Input devices transfer binary information from the
outside world to the microprocessor.
■ Examples of input devices are: keyboard,A/D
convertors, mouse, bar code reader, scanner and the
like.
❑ Output devices transfer binary information from
the microprocessor to the outside world.
■ Theses include things like an LED,CRT or video screen,
a monitor,X-Y plotter,D/A converter, a printer and the
65 like.
System Bus

■ A communication path between the


microprocessor and peripherals.
❑ It is simply a group of wires carrying the voltages
and curents representing the different bit values.

■ The microprocessor communicates with


only one peripheral at a time.

■ Controlling the bus is done by the Control


Unit.
66
■ Day scholars please write the sector no. you
are staying in, on your registers

■ Hostellers pl write the name of the hostel you


stay,
The three cycle instruction execution model
■ To execute a program, the microprocessor
“reads” each instruction from memory,
“interprets” it, then “executes” it.

■ To use the right names for the cycles:


❑ The microprocessor fetches each instruction,
❑ decodes it,
❑ Then executes it.
■ This sequence is continued until all
instructions are performed.

68
Machine Language
■ The number of bits that form the “word” of a microprocessor is
fixed for that particular processor.
❑ These bits define a maximum number of combinations.
■ For example an 8-bit microprocessor can have at most 28 = 256
different combinations.

■ However, in most microprocessors, not all of these


combinations are used.
❑ Certain patterns are chosen and assigned specific
meanings.
❑ Each of these patterns forms an instruction for the
microprocessor.
❑ The complete set of patterns makes up the
microprocessor’s machine language.
69
Assembly Language

■ Entering the instructions using hexadecimal is quite


easier than entering the binary combinations.
❑ However, it still is difficult to understand what a program
written in hexadecimal does.
❑ So, each company defines a symbolic code for the
instructions.
❑ These codes are called “mnemonics”.
❑ The mnemonic for each instruction is usually a group of
letters that suggest the operation performed.

70
Assembly Language

■ Using the same example from before,


❑ 00111100 translates to 3C in hexadecimal
❑ Its mnemonic is: “INR A”.
❑ INR stands for “increment register” and A is short for
accumulator.

■ Another example is: 1000 0000,


❑ Which translates to 80 in hexadecimal.
❑ Its mnemonic is “ADD B”.
❑ “Add register B to the accumulator and keep the result in
the accumulator”.

71
Assembly Language
■ It is important to remember that a machine language and
its associated assembly language are completely
machine dependent.
❑ In other words, they are not transferable from one
microprocessor to a different one.
■ For example, Motorolla has an 8-bit microprocessor
called the 6800.
❑ The 8085 machine language is very different from that
of the 6800. So is the assembly language.
❑ A program written for the 8085 cannot be executed on
the 6800 and vice versa.

72
“Assembling” The Program

■ How does assembly language get translated


into machine language?
❑ There are two ways:
❑ 1st there is “hand assembly”.
■ The programmer translates each assembly language
instruction into its equivalent hexadecimal code
(machine language). Then the hexadecimal code is
entered into memory.
❑ The other possibility is a program called an
“assembler”, which does the translation
automatically.
73
High Level Languages
The assembly and machine language are completely dependent
on the microprocessor. They can not be easily moved from one
to the other.
■To allow programs to be developed for multiple machines high
level languages were developed.
❑ These languages describe the operation of the program in
general terms.
❑ These programs are translated into microprocessor specific
assembly language using a compiler or interpreter program.
■ These programs take as an input high level statements such as “ I = j
+ k; ” and translate them to machine language compatible with the
microprocessor being used.

High level language Compiler Machine language


Source code Assemble Object code
r

74
Compiler vs. Interpreter
■ What is the difference between Compiler and Interpreter?
❑ A compiler translates the entire program at once and
produces the object code.
❑ An interpreter “ compiles “ the source code one line at-
a-time. The object code for each line is produced,
executed, and forgotten.
❑ Each time the program is to be executed, it has to be re-
interpreted.
■ Interpreters are very inefficient. Compilers produce
object code that is quite a bit smaller and faster to
execute.
■ Compilers are still inefficient when complete control is needed
and when memory is very critical.
75
The Hardware/Software Interaction
■ The hardware of a computer system is the collection of chips
that make up its different pieces, including the
microprocessor.
❑ The hardware consists of five main systems:
- The microprocessor
- Memory (RAM & ROM)
- Storage (Disk, CD)
- Input Devices (keyboard, mouse)
- Output Devices (monitor, printer).
Input Microprocessor Output

Memory Storage

76
The Hardware/Software interaction

■ Software refers to any program that executes


on the hardware.
❑ It contains very low level programs that control the
behavior of the hardware all the way to
complicated applications like 3D graphics, video
editing, and circuit simulation and design.

■ The interaction between the two systems


(hardware and software) is managed by a
group of programs known collectively as
77 Operating system.
The Operating System
■ The operating system is a layer between the application
programs and the hardware.
❑ Pieces of the operating system control the operation of
the disks, the monitor, the keyboard, the mouse, the
printer, the sound card, and even memory.
■ When a program wants to use one of these items, it
sends a request to the operating system and the
operating system in turn will perform the operation.

■ When the computer is first turned on, the operating system


starts to execute. It stays running as long as the computer is
operating.

78
The Operating System
■ The interaction of the user with the computer is through
the operating system.
❑ When the user invokes a program, the operating system
starts the process and makes the program start executing.
The program is executed on top of the operating system.

Applicatio
n
Operatin
Application Programs g

Operating System Hardwar


e
Hardwar
e
Syste
m
Program
s

79
Operating Systems
■ Examples of operating systems are:
❑ MS-DOS
❑ MS Windows
❑ Macintosh OS
❑ OS/2
❑ UNIX
■ Most operating systems are hardware specific:
❑ For example, windows only runs on microprocessors
made by Intel or those that behave the same way
(i.e. “compatible”).
■ Other operating systems (like UNIX) are
designed to work on any platform (hardware).
80

You might also like