Unit 1 Intro To 8 Bit Microprocessor
Unit 1 Intro To 8 Bit Microprocessor
MICROCONTROLLER
19EECN2601 -MPMC
Arithmetic and Logic Unit (ALU)
• ALU includes the accumulator, the temporary register, the arithmetic and logic
circuits and flags.
19EECN2601 -MPMC
Arithmetic and Logic Unit (ALU)
• This is the area of the microprocessor where various computing functions are
performed on data.
• The ALU unit performs such arithmetic operations as addition and subtraction and
such logical as AND,OR and XOR
19EECN2601 -MPMC
Arithmetic and Logic Unit (ALU)
• The ALU of the 8085 processor is called accumulator – oriented ALU as one of the
data used in arithmetic and logic operations must be stored in the accumulator.
• The other data is taken from a memory location or register. The results of the
arithmetic and logical operations are stored in accumulator.
• If the operation needs only one data, that data must be stored in accumulator
19EECN2601 -MPMC
Registers
• Registers are used by the microprocessor for temporary storage and manipulation
of data and instructions.
• Data remain in the register till they are sent to the memory or I/O devices
19EECN2601 -MPMC
The 8085 programming model
19EECN2601 -MPMC
General Purpose Registers
• The 8085 has six general-purpose registers to store 8-bit data; these are identified
as B, C, D, E, H, and L .
• They can be combined as register pairs - BC, DE, and HL - to perform some 16-bit
operations.
19EECN2601 -MPMC
General Purpose Registers
• The programmer can use these registers to store or copy data into the registers by
using data copy instructions.
• In other words, HL register pair plays the role of memory address register.
19EECN2601 -MPMC
Accumulator
19EECN2601 -MPMC
Accumulator
19EECN2601 -MPMC
19EECN2601 -MPMC
Program Counter
• Memory locations have 16-bit addresses, and that is why this is a 16-bit register.
• The microprocessor uses this register to sequence the execution of the instructions.
19EECN2601 -MPMC
Program Counter
• The function of the program counter is to point to the memory address from which
the next byte is to be fetched.
• When a byte (machine code) is being fetched, the program counter is incremented by
one to point to the next memory location.
• However, please note that the program counter is loaded with some absolute value
during the execution of branch instructions.
19EECN2601 -MPMC
Stack Pointer
• The beginning of the stack is defined by loading 16-bit address in the stack pointer.
• The stack is used to save the content of a register during the execution of the program.
19EECN2601 -MPMC
Instruction Register/Decoder
• The instruction register and the decoder are considered as a part of the ALU.
19EECN2601 -MPMC
Instruction Register/Decoder
• The decoder decodes the instruction and establishes the sequence of events to
follow.
• However, you please understand that the instruction register is not programmable
and can not be accessed through any instruction.
19EECN2601 -MPMC
Flag Register
• The ALU includes five flip-flops, which are set or reset after an operation according
to data conditions of the result in the accumulator and other registers.
19EECN2601 -MPMC
Flag Register
19EECN2601 -MPMC
Flag Register
• For example, after an addition of two numbers, if the sum in the accumulator id
larger than eight bits, the flip-flop uses to indicate a carry called the Carry flag (CY) –
is set to one.
19EECN2601 -MPMC
Flag Register
• When an arithmetic operation results in zero, the flip-flop called the Zero (Z) flag is
set to one.
• The combination of the flag register and the accumulator is called Program Status
Word (PSW)
19EECN2601 -MPMC
Flag Register
• The conditions (set or reset) of the flags are tested through the software
instructions.
19EECN2601 -MPMC
Flag Register
• Z-Zero flag: is set to 1 when ALU result is zero other wise it is reset to 0.
• CY-carry flag: if arithmetic operation results in a carry, the CY flag is set; otherwise is
reset.
• S-Sign: the sign flag is set if bit D7 of the result = 1;otherwise it is reset.
19EECN2601 -MPMC
Flag Register
• P – Parity: if the result has an even number of 1s, the flag is set; for odd number of 1s
the flag is reset.
• AC- Auxiliary carry: in arithmetic operation, when a carry is generated by digit D3 and
passed to digit D4 the AC flag is set. The flag is used internally for BCD operation.
19EECN2601 -MPMC
SUMMARY
19EECN2601 -MPMC
REFERENCES
19EECN2601 -MPMC
THANK YOU
19EECN2601 -MPMC