Microprocessor Slides
Microprocessor Slides
SCHOOL OF ENGINEERING
Electronics for Computing 3
Lecturer : M Shabiyemba
Email: [email protected]
Cell: 0969796822
Introduction
• Microprocessor is a digital device on a chip which can fetch
instructions from a memory, decode and execute them i.e. performs
certain arithmetic and logical operations,
accept data from input device, and send results to output devices.
• Therefore, a microprocessor interfaced with memory and Input/
Output devices forms a Microcomputer. Basically, there are five
building blocks of a digital computer namely,
Input Unit
• Through this unit data and instructions are fed to the memory of the
• computer. The basic purpose of this unit is to read the data into the
• machine. The program from the memory is read into the machine
• along with the input data which are required to solve or compute the
• problem by the machine. The typical devices which are used for this
• purpose are keyboards, paper tape reader and toggle switches etc.
Memory Unit
• The memory unit of a digital computer consists of devices which are
• capable of storing information. The memory of a computer is used
• for storing two distinct type of information such as data to be
• processed by the computer and program through which the result of
• the desired problem is obtained. Computer program and data are
• stored in the Memory Unit. This usually consists of chips of both
• ROMs (Read Only Memories) and RAMs (Random Access
• Memories) either bipolar or MOS.
Arithmetic and Logical Unit
• This unit is used for performing arithmetic operations such as
• Addition, Subtraction, Multiplications, division and other logical
• (ALU) operations on the data.
• The control unit guides ALU which of the operations are to be
• performed. The sequence of the instructions is controlled by the
• control unit.
Control Unit
• The control unit performs the most important function in a computer.
• It controls all other units and also controls the flow of data from one
• unit to another for performing computations. It also sequences the
• operations. It instructs all the units to perform the task in a particular
• sequence with the help of clock pulses.
Output Unit
• After processing of the data in the Arithmetic and Logical Unit, the
• results are displayed to the output world through this unit. The CRTs
• (Cathode Ray Tubes), LEDs (Light Emitting Diodes) and Printer etc.
• form the output unit.
• In a computer system ALU and Control Unit are combined in one unit
called
• Central Processing Unit (CPU).
The block diagram of a computer is shown in figure 1.1
Cont’d
• The Central Processing Unit is analogous to the human brain as all the
decisions as per the instructions are made by CPU. All other parts are also
controlled by this unit.
• Data bus is bidirectional, that is, data flow occurs both to and from CPU
and peripherals. There is an internal data bus which may not be of the
same width as the external data bus by that connects the I/O and
memory. A microprocessor is characterized by the width of its data bus.
• All those microprocessors having internal and external data buses of
different widths are characterized either by their internal or external
data buses.
• The size of the internal data bus determines the largest number that
can be processed by a microprocessor, for instance, having a 16-bit
internal data bus is 65536 (64K). The bus is labeled as:
• D0 ………………Dn-1, where n is the data bus width in bits
Control Bus
• Control bus contains a number of individual lines carrying
synchronizing signals. The control bus sends out control signal to
memory, I/O ports and other peripheral devices to ensure proper
operation. It carries control signals like MEMORY READ, MEMORY
WRITE, READ INPUT PORT, WRITE OUTPUT PORT, HOLD, INTERRUPT
etc.
• For instance, if it is desired to read the contents of a particular
memory location, the CPU first sends out address of that very location
on the address bus and a ‘Memory Read’ control signal on the control
bus. The memory responds by outputting data stored in the
addressed memory location on the data bus
Cont’d
• We will confine the detailed study of 8085 microprocessor because it
is most commonly used microprocessor. However, evolution of
microprocessors has been discussed in order to have the knowledge
microprocessors introduced so far.
BRIEF DESCRIPTION OF 8-BIT MICROPROCESSOR 8080A
• 8-bit B and 8-bit C registers can be used as one 16-bit BC register pair.
When used as a pair the C register contains low-order byte. Some
instructions may use BC register as a data pointer.
• 8-bit D and 8-bit E registers can be used as one 16-bit DE register pair.
When used as a pair the E register contains low-order byte. Some
instructions may use DE register as a data pointer.
Cont’d
• 8-bit H and 8-bit L registers can be used as one 16-bit HL register pair.
When used as a pair the L register contains low-order byte. HL
register usually contains a data pointer used to reference memory
addresses.
• Stack pointer It is a 16 bit register. This register is always
incremented/decremented by 2. Program counter It is also a 16-bit
register.
Instruction Set
• In order for computers to accept commands from human and perform tasks
vital to productivity, a means of communication must exist. Programming
languages provide this necessary link between man and machine. Because
they are quite simple compared to human language, rarely containing more
than few hundred distinct words, programming languages must contain very
specific instructions. There are more than 2,000 different programming
languages in existence, although most programs are written in one of several
popular languages, like BASIC, COBOL, C++, or Java.
• Programming languages have different strengths and weaknesses. Depending
on the kind of program being written, the computer will run on the experience
of the programmer, and the way in which the program will be used, the
suitability of one programming language over another will vary. One can
categorize computer language as low Level and high level programming
languages which are being discussed in the subsequent subsections.
Low-Level Programming Language
• The machine language and assembly languages discussed above are the first and
• second generation programming languages which fall in the category of low level
• languages. These languages require deep knowledge of computer hardware. The high
• level computer languages developed around 1960s are machine independent i.e.
computer
• hardware is not necessary to know for the programmers. In high level languages one has
• to know only the instructions in English word and logic of the problem irrespective of the
• types of computer being used. For the computer programming prepared in high level
• language, only the use of English alphabets and mathematical systems like +, -, /, * etc.
• are made. In fact high level language is more close to user and is easy to read and
• understand. The high level languages are called procedural language and are designed to
• solve general and specific problems.
Cont’d
• The term "high-level language" does not imply that the language is superior to
• low-level programming languages - in fact high level refers to the higher level of
• abstraction from machine language. They have no opcodes that can directly compile the
• language into machine code, unlike low-level assembly language.
• In high level languages the words in English are converted into binary language
• of different microprocessors with the help of a program called Interpreter or Complier.
• The compiler or interpreter accepts English like statements as the input called Source
• code. The source codes are translated into machine language compatible with the
• microprocessor being used in the machine. The translation in the machine language from
• the source code is called the object code. Figure 1.4 shows the block diagram for
• translation of high level language program into machine code. Each microprocessor
• needs its own compiler or an interpreter for each high level la
Cont’d
• The difference between a compiler and an interpreter is that the compiler
reads
• the entire program first and then generates the object code; where as the
interpreter reads
• one instruction at a time and produces its object code which is executed at
the same time
• before reading the next instruction. The high level programming language
developed so
• far may be categorized into third, fourth and fifth generation programming
languages
• whose brief discussion is given below.
Third Generation Programming Language