You are on page 1of 26

Microprocessor fundamentals

By Prof. Y. P. Jadhav Physics Department Smt. CHM College, Ulhasanagar-3

Objectives
To study Block diagram of a microprocessor based system. To explain the functions of
Microprocessor Memory Input device Output device System bus.

Define the terms: bit, byte, instruction, Word length, hardware,


software, program etc.

Explain different languages:


Machine language, Assembly language and High level language.

Low level and high level language. Advantages of assembly language over high level language. Operating system?

Microprocessor
It is multipurpose, programmable, clock driven, register based electronic device. Reads binary instruction from memory, accepts binary data as input and processes the data according to those instructions, and provides result as output. Programmable device computing and decision
making capability.

Memory

Four Components of a typical Programmable machine Microprocessor Input device Output Device Memory

Microprocessor

Input

Output

A Programmable Machine

Hardware : The physical components of the system.


Program : A set of instructions to perform a task. Software : A group of programs.

Applications:
- To control processes : Traffic light system. - To compute mathematical functions. - To keep track of a guidance systems etc.

Classification:
Reprogrammable Systems (Microcomputers & PC)
Microprocessor used for computing & data processing The system includes microprocessor, Large storage device such a HDD & CD ROMs, and Peripherals IO devices .

Embedded Systems (Microcontrollers)


Microprocessor is a part of product and is not available for reprogramming for end user. Xerox machine, Microwave oven, Washing machine etc.

Microprocessor as CPU (MPU)


CPU

CPU contains
ALU & Control Unit Registers Instruction decoder Counters and Control lines
ALU
Input CONROL UNIT Output

Memory

Block Diagram of a Computer

It reads instruction from memory and performs task specified. It communicates with input/output devices either to accept or to send data. The communication process of CPU is controlled by Control Unit.

CPU with discrete components - 1990 Replaced by single chip with the advent of Integrated Circuit Technology.
Input

Microprocessor as CPU

Output

A computer with a microprocessor as its CPU is known as microcomputer MPU is a complete processor unit with the necessary control unit Because of limited number of pins available on the MPU package , some of the signals need to be generated outside using some desecrate devices

Memory

Block Diagram of a Computer with the microprocessor as CPU

Microcontroller

MPU

Microcontrollers or MCU

Memory

I/O

- MPU, memory, I/O devices and some peripheral devices on a single chip
- Entire computer on single chip

Peripheral Devices
A/D Converters Timers Serial I/O

Historical Perspective
Intel engineer Ted Hoff pioneer. In 1969 Intel was in the business of semiconductor memory only.
(64 bit bipolar RAM chip)

Japanese company Busicom contacted Intel to design programmable calculator. The original design called for 12 different functions with hard wired programming. Ted Hoff suggested a general purpose programmable chip. The first 4-bit microprocessor - 4004 in year 1971 (2300 transistors, 640
bytes memory addressing capability and 108 KHz clock)

Intel 8008, 8080, 8085 , 8086 etc Motorola 6800 Zilog Z80 Moores Law: Number of transistor per interacted circuit would double every 18 months By the year 2000 15 million transistor, 400MHz to 1.5GHz clock, one terabyte
(10 12 ) of memory. (Pentium IV)

Operating System
The interaction between the hardware and the software is managed by a set of programs called an Operating System of a computer. Operating system is responsible primarily for storing information on the disk and to communicate with the peripherals. Different OS:
CP/M (computer Monitor program) in 1970s for 8 bit processors. MS DOS (Microsoft Disk Operating System) 1980s for 16-bit processors GUI (Graphic User Interface) 1990s for Windows 3.1 and 95 Unix, Linux, OS/2, Windows 95/98/2000, ME, NT, XP etc.

Organization of a Microprocessor Based System


The input device:

Memory Mcroprocessor Enters data andinformation instructions under the control and of a program stores binary ( instructions data). such as a monitor program Microprocessor provides the instructions and data to the I/O keyboard, switches, ADCs etc. reads instructions from memory. microprocessor on request. Input system / Outputbus. communicates with all peripherals using stores the result and data for the microprocessor. Register The output device: ALU timing of information flow. controls te m Bus in a program. performs theArray computing task Sys specified
Accepts data from the microprocessor as specified in a program - LED / LCD display, CRT, video screen, printer, X -Y plotters, Memory magnetic tapes, DACs etc.

Control Unit The System Bus:

ROM

R / WM

Carries bits (information) between the microprocessor and memory and I/Os.

How does microprocessor works?


Assume that a program and data is already entered in R/W memory The sequence of the process is read, interpret and perform. The microprocessor fetches the first instruction from memory, decodes it and executes that instruction. The sequence of fetch, decode and execute is continued until the microprocessor comes across an instruction to stop. During the entire process microprocessor uses:
System bus : To fetch instruction and data from the memory. Registers : To store data temporarily ALU : To perform the computing function

Finally it sends the result to the output device and/or stores the result in the memory.

Microprocessor Instruction Set and Computer Languages


Microprocessor recognize and operate in binary numbers. Each Microprocessor has its own binary word, meanings and language based on its logic design. The words are formed by combining number of bits for a given machine. Instruction is a command in binary that is recognize and executed by the processor to accomplish a task. Word length
the number of bits microprocessor recognizes and processes at a time. 4-bits (for small) to 64 bits for large & high speed computers. 4 bit, 8 bit, 16 bit, 32 bit and 64 bit microprocessors. A byte Group of 8 bits.

Machine Language, Assembly Language, and High-level Languages


Three types of computer languages
1. Machine language
Only language microprocessor / computer directly understands Natural language of microprocessor / computer Defined by hardware design
Machine-dependent Ultimately 0s and 1s One at a time

Generally consist of strings of numbers Instruct computers to perform elementary operations

Cumbersome for humans (users) Example:


1010 1100 1110 0011 1000 0001

2. Assembly language

English-like abbreviations representing elementary microprocessor / computer operations Machine dependent. Clearer to humans Incomprehensible to (cant be understood by) computers
So require Translator Program ( called assembler or cross assembler). Convert Mnemonics to machine language

Example:
LDA C200 ADD B INR A

3. High-level languages
Similar to everyday English, use common mathematical notations Single statements accomplish substantial tasks
Assembly language requires many instructions to accomplish simple tasks Convert to machine language Directly execute high - level language programs

Translator programs (compilers)

Interpreter programs

Machine independent. Compiler and interpreter require large memory space (because instruction in English requires several machine codes to translate in binary) Translation : Source Code Compiler / Interpreter Object Code Example:
grossPay = basePay + overTimePay

BASIC, PASCAL, C, C++, JAVA etc.

Assembly Language

High level Language


requires large memory space.
less efficient machine independent. requires complier or interpreter. One statement requires many machine codes. Debugging is easy

compact, requires less


memory space. more efficient. machine dependent. requires hand assembly or the assembler One mnemonic requires one machine code. Debugging is cumbersome

Writing and executing an assembly language program


A program is a set of logically related instructions written in a specific sequence to accomplish a task. To write and execute an assembly language program on a single board microprocessor, with a hex keypad for input and LED display for output the following steps are necessary.
Write the instructions in mnemonics obtain from the instruction set supplied by the manufacturers. Find the hexadecimal code for each instruction from the instruction set. Enter (Load) the program in the user memory in a sequential order by using hex keyboard. Execute the program. The result will be displayed by the LED display.

8085 Bus Organization


In a computer system, each peripheral device or memory location is identified by a binary number called address, and address bus is used to carry this address The address bus:
is a group of 16 lines A15 A0 Unidirectional Used to identify a peripheral or a memory location. The 8085 microprocessor has 16-bit address line, so addressing capability of 216 = 65536 (64K) memory locations. 1K = 210 = 1024 memory locations

Data bus:
Group of 8 lines. Bidirectional. Use for data transfer form MPU to peripherals / memory or vise versa. The numbers that can appear on data bus ranging from 00H to FFH The 8085 microprocessor is 8-bit processor Intel 8086, Zilog Z8000, Motorolla 6800 16bit Intel 80386/486 32-bit processors.

Control bus:
Comprised of various single lines, that carry timing / synchronization signal. the MPU generates specific control signals for every operations such as Memory read, memory write, I/O read or I/O write. These signals are used to identify a device type with which the MPU intended to communicate.

For example: To read data from memory


The MPU
Places the 16-bit address on the address bus Address is decoded by external decoder logic circuit and the memory location is identified. Sends the memory read as control signal . The control signal activates the memory chip.

The contents of the memory location are placed on data bus and brought inside the MPU.

Hardware Model of 8085 Microprocessor


Accumulator
S Y S T E M B U S

Register Arrays

TWO SEGMENTS:
16-bit Address Bus

ALU

Memory Pointer Register

Flags

Instruction Register

8-bit Data Bus

One includes Accumulator ALU Flags & Instruction Register

The second Segment includes 8-bit and 16-bit Registers


Both the segments are connected with System Bus

Timing and Control Unit


Control Signals

8085 Hardware Model

ALU performs arithmetic and logic operations, and results are stored in accumulator The flags are set or reset to reflect the result. 16-bit address bus identifies the memory Location, 8-bit data bus is used to transfer data and control bus for timing signals.

8085 PROGRAMMING MODEL


The Programming Model consists:
Two 8-bit special purpose registers
Accumulator Flag Register

Six 8-bit general purpose registers


B, C, D, E, H and L Registers

Two 16-bit special purpose registers.


Stack Pointer Program Counter

Program Counter:
Is a 16 bit special purpose register, which stores the address of the next instruction Accumulator A (8) Flag Register (8) to be fetched. Acts Register as a pointer the next instruction. How processor increments program counter A to (Accumulator): B (8) C (8) to Flag register is group of five flip-flops used depends on the nature ofa instruction. >> It is tri-state 8-bit register In case of JMP and CALL instructions, address followed by JMP and CALL E (8)ALU give ofD the operations performed by >>status After performing arithmetic and logic operations ALU places (8) - instruction is placed in the program counter. result on SP theJMP internal data from there it is generally stored in Why and areand 16Conditional - bitbus registers? In case PC of Conditional CALL instructions, L (8) H (8) address accumulator. followed by JMP and CALL instructions is placed in the program counter It is also used in otherwise load and the store operations, if the>> condition is satisfied; program counter is incremented by three PC and SP are the memory pointers and(16) the address Stack Pointer (S P) so as to as point the address of /output the next (I/O) instruction to be fetched. well as in input operations.

of any memory location 8085 is 16 bit >> Most of the times the in results of microprocessor arithmetic operations Program Counter (PC) and logical (16) Stack : address, so to this address PC and SP must be is Pointer stored in hold register A, 16-bit hence it is called as accumulator. Data Bus Address Bus The stack is the reserved area the memory in the RAM >> The register A can be used as a of general-purpose register. 16 bit registers. where the temporary data can be stored. 16 It is used to hold the address of the most Lines recent stack entry. 8
Lines

Bi di recti onal

Uni directi onal

Programming Model of 8085

Flag Register Format


D7
S

D6
Z

D5
X

D4
AC

D3
X

D2
P

D1
X

D0
CY

S - Sign flag Z - Zero flag AC - Auxiliary carry flag P - Parity flag and CY - Carry flag

You might also like