Professional Documents
Culture Documents
History
Microprocessors became possible with the advent of LSI technology. INTEL 4004 was the first 4 bit programmable device which was primarily used in calculators. This chip became known as the 4 bit microprocessor.Next chip by INTEL were 8 bit 8008, and in mid 1970 came 8080. After 8080 came Motorola 6800, Zilog Z80 and 8085. Currently we have 32 bit and 64 bit processors for PCs. However for industrial applications the 8 bit processors are still predominantly used.
Indian Institute for Production Management
2
Octal
Recapitulation
Number Systems: Decimal Binary Hexadecimal Octal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 10000
1 2 3 4 5 6 7 8 9 A B C D E F 10
1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20
3
This is a 7 bit code with 128 (27 ) combinations. Each combination from 0 to 127 is assigned a letter or a number or a special character.
Binary Addition
0+0=0 0+1=1 1 + 1 = 10 OR 1 + 1 = 0 and Carry 1 1 + 1 + 1 = 11 OR 1 + 1 + 1 = 1 and Carry 1 11100 + 11010 10110 (Carry 1)
2s Compliment
Decimal and Binary Number line
-3
1101
-2
1110
-1
1111
0
0000
1
0001
2
0010
3
0011
1s complement Change 1 0 and 0 1 2s complement add 1 to 1s complement Thus 1s complement of 0001 = 1110 2s complement of 0001 = 1110 + 1 = 1111 Thus for microprocessor operations the number system is : 1) Msb. 0 for positive numbers and 1 for negative numbers. 2) Negative decimal numbers are in 2s complement form.
Indian Institute for Production Management
7
Memory Addressing
In a computer system each peripheral or memory location is identified by a binary number called address. This is similar to the postal address of a house. A house can be identified by various number schemes. The 45th house on a road can be numbered 45 on two digit scheme or 0045 on a four digit scheme. Two digit scheme can only identify 100 houses from 00 to 99, but 4 digit scheme can identify 10000 houses from 0000 to 9999. Similarly 8085 has 16 address lines thus it can address 216 = 65,536 address which is rounded off to 64K. Thus 8 bit microprocessors can have maximum 64K memory. Though in practice it is often about 4k or less.8088 has 20 address lines whereas Pentium processors have 32 bit address lines.
ROM
0
1 2
R0 R1
R2
R3
+5V
3 4
R4
R5 R6 R7
5
6
7
D3
Indian Institute for Production Management
D2
D1
D0
GND 9
ALU
Registers
System Bus
Control
10
Address Bus
Microprocessor
I/O
11
0
IN Enable OUT
X 0 1
Open 0 1
13
1 1
Data Bus
For a 8 bit microprocessor like 8085 the data bus has 8 lines. Information can flow both ways on the data bus, i.e.it can be used for reading and writing to the memory as well as input and output. Although data can move in both direction, it can move in one direction at a time.
14
Address bus
The number of address lines determine the maximum addressable memory of the microprocessor. Example: 8 bit microprocessors have a 16 bit addressing system. Thus these can address memory from 0000 H to FFFF H Thus total number of memory locations is given by 216 = 65,536 The address bus is unidirectional.
15
Control Bus
The control bus is a set of lines from the microprocessor by which commands can be issued to and from the microprocessor. There can be the following typical use. 1. Memory Read (MEMR) 2. Memory Write (MEMW) 3. Input device read (IOR) 4. Out put device Write (IOW)
16
Data Bus
Valid Data
Control Bus
MEM Write Time allowed by microprocessor for memory to decode the address.
17
18
Address bus
High Address
Address/Data
Low Address
Data
Control
ALE
ALE
Latch address
19
Clock
Every microprocessor based system uses a clock oscillator from which all timing signals are derived. The clock of 8085 is contained within the microprocessor and requires only the addition of a crystal between the pins 1 and 2. The crystal frequency is twice the system clock frequency.
21
Registers
Functions:
Store data Perform arithmetic & logical operation. Test for condition
Registers are primarily used to store data temporarily during execution of a program. 8085 Registers
Accumulator A Flag Register
B D H
C E L
22
Register Pairs
All general purpose registers (A,B,C,D,E,H,L) in 8 bit microprocessors like 8085 are 8 bit long. The range of numbers which can be stored in any register is 127 to + 127. Thus the registers can be used to store only small integers, two Hex numbers, one ASCII character etc. For calculation involving larger numbers some registers can be used in pairs to provide 16 bit operation. In 8085 this pairs of registers are BC, DE & HL.
23
Program Counter
This is a 16 bit register as it deals with memory addresses which are 16 bit long. The function of the program counter is to point to the memory address from which the next byte of instruction is to be fetched. When a byte is being fetched the program counter is incremented by one to point to the next memory location.
24
26
Memory
Memory stores instructions and data and provides them to the processor whenever necessary. ROM (Read Only Memory) Programs stored in the ROM are those which do not need alterations.Example EPROM, EEPROM, Flash Memory etc. RAM ( Random Access Memory) This is user memory.Normally RAM stores intermediate user programs and data. Microprocessor can both read data from and write data to RAM e.g.Static RAM, Dynamic RAM.
Indian Institute for Production Management
27
Fetch Instruction
Decode Instruction
Execute Instruction
The microprocessor fetches binary instructions or data from the memory. It uses registers to store data temporarily. It performs computing function in the ALU. It sends out results using the bus lines. The sequence of fetch, decode and execute is continued until there is an instruction to stop.
Indian Institute for Production Management
28
8085 Schematic
INTA
INTR RST5.5
RST6.5 RST7.5
TRAP
SID
SOD
Interrupt control
Serial I/ O
Accumulator
Temp
Flags
B D H
Program Counter
C E L
ALU
Instruction Decoder
Stack Pointer
X2
CLK Out
WR
ALE S0
29
Input/Output Ports
There can be three kinds of ports. 1. INPUT Port where CPU reads data from port.
32
33
Interrupts
8085 has five interrupt signals that can be used to interrupt a program execution. INTR (Input) : Interrupt Request: This is a general purpose interrupt which can be enabled or disabled by software. INTA (Output): Used to acknowledge the interrupt. RST 7.5 Restart interrupts. These can transfer RST 6.5 (Inputs) program control to specific memory RST 5.5 locations. TRAP (Input) This has the highest priority of all interrupts. And can not be disabled. This is mainly used for emergency operations.
37
MPU
RD
STB
IBF
39
Stack Pointer
The Stack in 8085 microprocessor system can be described as a set of memory locations in the RAM used by the program to store information temporarily during execution of the program. The beginning of the stack is defined by the statement LXI SP, which loads a 16 bit address in the stack pointer register of the microprocessor . Once the stack is defined the loading of the data bytes begins one address lower than the stack pointer register. Thus if the stack pointer register has the address 2099h then the storing of data bytes will begin at 2098h.Thus normally the highest level of memory available is given to the stack.
Indian Institute for Production Management
41
Interfacing Devices
TRI STATE DEVICES:
74LS244: Octal Buffer. Commonly Used as driver for address bus of a microprocessor system.
74LS245: Octal Bidirectional Buffer. Has 16 bus drivers , 8 for each way. Used for Data bus.
42
Interfacing Devices
DECODER:Commonly used for interfacing I/O peripherals
and memory. Decoder is a logic circuit that identifies each combination of input signals present. Thus a 2 to 4 decoder will have four combination of input signals that identifies the 4 output lines.
Examples of Decoders:
74LS138
3 TO 8 Decoder 8205
43
Interfacing Devices
LATCHES:
A latch is commonly used to interface output devices. When a microprocessor sends a signal to the output the data is available for only a few microseconds, the latch is used to hold the data for display or for transmission to slow peripheral devices.
Example: 74LS373 octal D latch. The device has 8 D latches with Tri State Buffers.
44