Specifications

Chapter 2 - Microcontroller PIC16F84
Previous page Table of contents Chapter overview Next page
2.3 Central Processing Unit
Central processing unit (CPU) is the brain of a microcontroller. That part is responsible for finding
and fetching the right instruction which needs to be executed, for decoding that instruction, and
finally for its execution.
Central processing unit connects all parts of the microcontroller into one whole. Surely, its most
important function is to decode program instructions. When programmer writes a program,
instructions have a clear form like MOVLW 0x20. However, in order for a microcontroller to
understand that, this 'letter' form of an instruction must be translated into a series of zeros and
ones which is called an 'opcode'. This transition from a letter to binary form is done by translators
such as assembler translator (also known as an assembler). Instruction thus fetched from
program memory must be decoded by a central processing unit. We can then select from the table
of all the instructions a set of actions which execute a assigned task defined by instruction. As
instructions may within themselves contain assignments which require different transfers of data
from one memory into another, from memory onto ports, or some other calculations, CPU must be
connected with all parts of the microcontroller. This is made possible through a data bus and an
address bus.
Arithmetic Logic Unit (ALU)
Arithmetic logic unit is responsible for performing operations of adding, subtracting, moving (left
or right within a register) and logic operations. Moving data inside a register is also known as
'shifting'. PIC16F84 contains an 8-bit arithmetic logic unit and 8-bit work registers.
http://www.mikroelektronika.co.yu/english/product/books/PICbook/2_04Poglavlje.htm (1 of 6) [4/2/2003 16:17:45]