Microprocessor
Microprocessor
Microprocessor
• Typically this includes a CPU, RAM, some form of ROM, I/O ports,
and timers.
•.
• A microcontroller is meant to be more self-contained and
independent, and functions as a tiny, dedicated computer.
When data types having a word size larger than the smallest
addressable unit are stored in memory the question arises,
1 AB 1 CD
0 CD 0 AB
von Neumann architecture
• The von Neumann architecture is a design model for a stored-program
digital computer that uses a central processing unit (CPU) and a single
separate storage structure ("memory") to hold both instructions and data. It
is named after the mathematician and early computer scientist John von
Neumann. Such computers implement a universal Turing machine and have
a sequential architecture.
• A stored-program digital computer is one that keeps its programmed
instructions, as well as its data, in read-write, random-access memory
(RAM). Stored-program computers were an advancement over the program-
controlled computers of the 1940s, such as the Colossus and the ENIAC,
which were programmed by setting switches and inserting patch leads to
route data and to control signals between various functional units. In the
vast majority of modern computers, the same memory is used for both data
and program instructions. The mechanisms for transferring the data and
instructions between the CPU and memory are, however, considerably
more complex than the original von Neumann architecture.
Harvard architecture
• The Harvard architecture is a computer architecture with physically
separate storage and signal pathways for instructions and data. The
term originated from the Harvard Mark I relay-based computer,
which stored instructions on punched tape (24 bits wide) and data in
electro-mechanical counters. These early machines had limited data
storage, entirely contained within the central processing unit, and
provided no access to the instruction storage as data. Programs
needed to be loaded by an operator, the processor could not boot
itself.
– 8085 Architecture
1. Cpu of microcomputer
2. 8085 is 8 bit microprocessor
• Pin Diagram
1. 40 pin IC package fabricated on a single LSI
chip.
2. Uses a single +5V DC supply for its use.
• Functional Block Diagram
Intel 8085
• 8 bit NMOS Microprocessor.
• 40 pin IC fabrictaed on single LSI chip
• Uses a single +5v DC supply for its
operation
• Clock speed is 3Mhz.
• Clock cycle is of 320ns
• It has 80 basic instruction and 246
opcodes
Three main sections
• ALU
• Set of registers
ALU
• Perform the arithmetic operations
1. Addition
2. Subtraction
3. Logical AND
4. Logical OR
5. Logical Exclusive OR
6. Complement (Logical NOT)
7. Increment (add 1)
8. Decrement (Subtract 1)
9. Left Shift ,Rotate Left , Rotate right
10. Clear
Timing and Control unit
• Generates timing and control signals necessary to carry out the
instruction, which has been decoded.
• Control data path (flow) b/w CPU and peripheral (including memory).
• Provide status ,control and timing signals which are requested for the
operation of memory and I/O devices.
24
The 8085 Bus Structure
Address Bus
Consists of 16 address lines: A0 – A15
25
The 8085 Bus Structure
Data Bus
Consists of 8 data lines: D0 – D7
Control Bus
Consists of various lines carrying the control
signals such as read / write enable, flag bits.
26
Intel 8085 Registers
• It has following registers, registers are
small due to limited size of the chip:
• One 8-bit ACC (Accumulator).
• 6 Eight bit GPR (B,C,D,E,H and L).
• One 16 bit SP (Stack Pointer)
• One 16 bit PC (Program Counter)
• Instruction Register
• Temporary Register
Set of registers
• Used by the microprocessor for temporary storage and
manipulation of data and instruction.
• Programmer can use these registers to store or copy data into the
registers by using data copy instructions.
• Data remain in register till they are sent to the memory or I/O device.
• one accumulator,
• Register A
• The other operand for an arithmetic operation may be stored in the memory or GPR.
• DAD rp for 16 bit addition for which one of the 16 bit operands is kept in H-L and the
other in the B-C or D-E pair. The result is placed in the H-L pair.
Program counter (PC)
• 16 bit special purpose register.
• Keep track of the memory addresses of the instruction in a program while they are
being executed.
• It stores the present status of the microprocessor after any arithmetic and
logical operation.
• It records any occurrence of carry, auxiliary carry, sign, zero and odd/even
parity.
Properties
• Single + 5V Supply
• 4 Vectored Interrupts (One is Non Mask able)
• Serial In/Serial Out Port
• Decimal, Binary, and Double Precision Arithmetic
• Direct Addressing Capability to 64K bytes of memory
• The Intel 8085A is a new generation, complete 8 bit
parallel central processing unit (CPU).
• The 8085A uses a multiplexed data bus.
• The address is split between the 8bit address bus and
the 8bit data bus. Figures are at the end of the
document.
Pin Description
• The falling edge of ALE is set to guarantee setup and hold times for
the address information.
• ALE can also be used to strobe the status information. ALE is never
3stated.
• SO, S1 (Output)
Data Bus Status. Encoded status of the bus cycle:
1. S1 S0
2. O O HALT
3. 0 1 WRITE
4. 1 0 READ
5. 1 1 FETCH
• S1 can be used as an advanced R/W status.
• RD (Output 3state): READ; indicates the selected
memory or 1/0 device is to be read and that the Data
Bus is available for the data transfer.
• HLDA (Output) :
HOLD ACKNOWLEDGE; indicates that the CPU has
received the Hold request and that it will relinquish the
buses in the next clock cycle. HLDA goes low after the
Hold request is removed. The CPU takes the buses one
half clock cycle after HLDA goes low.
• INTR (Input): INTERRUPT REQUEST; is used as a
general purpose interrupt. It is sampled only during the
next to the last clock cycle of the instruction. If it is
active, the Program Counter (PC) will be inhibited from
incrementing and an INTA will be issued. During this
cycle a RESTART or CALL instruction can be inserted to
jump to the interrupt service routine. The INTR is
enabled and disabled by software. It is disabled by Reset
and immediately after an interrupt is accepted.
• X1, X2 (Input):
Crystal or R/C network connections to set the internal
clock generator X1 can also be an external clock input
instead of a crystal. The input frequency is divided by 2
to give the internal operating frequency.
• SOD (output): Serial output data line. The
output SOD is set or reset as specified by
the SIM instruction.
49
The 8085: CPU Internal Structure
50
Example: Memory Read Operation
51
Example: Instruction Fetch Operation
52
Example: Instruction Fetch Operation
53
Example: Instruction Fetch Operation
54
8085 Functional Block Diagram
55
Addressing modes
• The data are specified in different modes in the
instructions. The various ways of specifying data are
called addressing modes.
• Eg: MOV D, C;
The contents of C is moved to register D.
Direct Addressing mode
• Example:
MOV A, M
The data moved to accumulator from the
memory, which is pointed by the memory
pointer.
Implied Addressing mode
• When the instruction itself specifies the
data to be operated, then it is called
Implied addressing mode.
Example:
CMA - Complement the content of
accumulator.
RRC- rotate accumulator content with out
carry.
Data Transfer Group:
The data transfer instructions move data between registers or between
memory and registers.
• MOV : Move
• An 'X' in the name of a data transfer instruction implies that it deals with a
register pair (16-bits);
• LXI : Load Register Pair with Immediate data
• The logical AND, OR, and Exclusive OR instructions enable you to set
specific bits in the accumulator ON or OFF.
• The rotate instructions shift the contents of the accumulator one bit
position to the left or right:
•
• RLC Rotate Accumulator Left
• RRC Rotate Accumulator Right
• RAL Rotate Left Through Carry
• RAR Rotate Right Through Carry
• JMP Jump
• CALL Call
• RET Return
Conditional branching instructions examine the status
of one of four condition flags to determine whether
the specified branch is to be executed.
The conditions that may be specified are as follows:
• NZ Not Zero (Z = 0)
• Z Zero (Z = 1)
• NC No Carry (C = 0)
• C Carry (C = 1)
• PO Parity Odd (P = 0)
• PE Parity Even (P = 1)
• P Plus (S = 0)
• M Minus (S = 1)
• Thus, the conditional branching instructions are
specified as follows:
Jumps Calls Returns