13.07.2015 Views

Digital Electronics: Principles, Devices and Applications

Digital Electronics: Principles, Devices and Applications

Digital Electronics: Principles, Devices and Applications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Microprocessors 533SUB RSUI eight-bitINR RDCR RSubtracts the contents of the register from the accumulatorSubtracts eight-bit data from the contents of the accumulatorIncrements the contents of the registerDecrements the contents of the register13.4.3 Logic InstructionsMicroprocessors can perform all the logic functions of hard-wired logic. The basic logic operationsperformed by all microprocessors are AND, OR, NOT <strong>and</strong> EXCLUSIVE-OR. Other logic operationsinclude ‘shift’ <strong>and</strong> ‘rotate’ operations. All these operations are performed on a bit-for-bit basis on bytesor words. For instance, 11111111 AND 10111010 equals 10111010, <strong>and</strong> 11111111 OR 10111010equals 11111111. Some microprocessors also perform bit-level instructions such as ‘set bit’, ‘clear bit’<strong>and</strong> ‘complement bit’ operations. It may be mentioned that logic operations always clear the carry <strong>and</strong>overflow flags, while the other flags change to reflect the condition of the result.The basic shift operations are the ‘shift left’ <strong>and</strong> ‘shift right’ operations. In the shift left operation,also known as the arithmetic shift left, all bits are shifted one position to the left, with the rightmostbit set to ‘0’ <strong>and</strong> the leftmost bit transferred to the carry position in the status register. In the shiftright operation, also known as logic shift right, all bits are shifted one bit position to the right, withthe leftmost bit set to ‘0’ <strong>and</strong> the rightmost bit transferred to the carry position in the status register.If in the shift right operation the leftmost bit is left unchanged, it is called arithmetic shift right. Ina ‘rotate’ operation, the bits are circulated back into the register. Carry may or may not be included.As an illustration, in a ‘rotate left’ operation without carry, the leftmost bit goes to the rightmost bitposition, <strong>and</strong>, in a ‘rotate right’ with carry included, the rightmost bit goes to the carry position <strong>and</strong>the carry bit takes the position of the leftmost bit.Examples of logic instructions performed by the 8085 microprocessor include the following:ANA R/MANI eight-bitORA R/MORI eight-bitXRA R/MXRI eight-bitCMARLCRRCLogically AND the contents of the register/memory with the contents of theaccumulatorLogically AND the eight-bit data with the contents of the accumulatorLogically OR the contents of the register/memory with the contents of theaccumulatorLogically OR the eight-bit data with the contents of the accumulatorLogically EXCLUSIVE-OR the contents of the register memory with thecontents of the accumulatorLogically EXCLUSIVE-OR the eight-bit data with the contents of theaccumulatorComplement the contents of the accumulatorRotate each bit in the accumulator to the left positionRotate each bit in the accumulator to the right position13.4.4 Control Transfer or Branch or Program Control InstructionsMicroprocessors execute machine codes from one memory location to the next, that is, they executeinstructions in a sequential manner. Branch instructions change the flow of the program eitherunconditionally or under certain test conditions. Branch instructions include ‘jump’, ‘call’, ‘return’ <strong>and</strong>‘interrupt’.‘Jump’ instructions are of two types, namely ‘unconditional jump’ instructions <strong>and</strong> ‘conditionaljump’ instructions. If the microprocessor is so instructed as to load a new address in the program

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!