Microcomputer Architecture: Von Neumann vs. Harvard

Program

A program is a set of instructions or commands that tells the microcomputer, which is what we must do moment by moment.

Instruction

An instruction is an order that tells the machine what you should do, this instruction is divided into two parts called opcodes or instruction code and operand.

Structure of a micro computer based processor

The microprocessor-based Micromputadores consists primarily of the following parts:

Microprocessor or CPU

The Brain of the microcomputer, for in it is perform all arithmetic, logic and transfer of information, and make the system control through a program.

Main Memory

Can be made up of RAM, ROM, PROM, EPROM, etc.. Or combinations of these devices. Their primary function is to store the program and data with which the microcomputer works.

Input Peripherals

There are elements that allow the user to enter data into the computer. Among these elements is for example the keyboard.

Peripherals out

These are devices or equipment which allow to remove data from the computer to the user, for example the monitor.

Interface entry to or exit

Son circuitry to connect the devices peripheral to the microprocessor and / or main memory. These devices contain at least tri-state gates and registers.

Buces

parallel lines are common electrical connections that allow the CPU to unite with some other device.

Data Bus

Allows data word with which they are working (usually multiples of 8, ie 8, 16, 32, etc.). And allow the CPU to communicate with main memory and / or interface. These lines are bidirectional, ie can input or output data to the CPU.

Address Bus

These lines can select a cell within the main memory and is also used to select any records in the input or output interface. The address is mainly controlled by the CPU, so these lines are only input for external devices to the CPU.

Control Bus

These lines allow you to control the microcomputer,
for example, is the line that can carry supply voltages, the interrupt signals and start the microcomputer.

Role of a microprocessor-based microcomputer

The basic functions of a microprocessor-based microcomputer are:

Storing of data

that is, for some time to save the data to be busy. This function in turn requires a storage of data, which involves taking the data and move toBuces through the data (either internal or external microprocessor) into memory where it is stored temporarily.

Data processing

This involves the realization of logical operations, arithmetic or mobility with the data, according to the instruction required by the user, to that end, the received data from memory will enter the instruction decoder initially and depending on its binary value (also called instruction code) provide the control unit.

Communication

The result of the data is sent through the outbound interface to peripheral devices through the data buces. In this case, the address bus is only used as part ofinternal control circuit for selectively microprocomputador appropriate interface.

Architecture

Traditional Von Neumann computer architecture

and microprocessors based on the scheme proposed by John Von Neumann, in which the central processing unit, or CPU, is connected to a memory one containing the program instructions and data size of data or instructions is fixed by the width of the memory bus or data bus. That is an 8-bit microprocessor, which also has a data bus of 8 bits that connects with the memory, will handle data and instructions from one or more units of 8 bits (bytes) long.

The limitations of this architecture traditional are

The length of the instructions is limited by the unit length of the data: hence the microprocessor to do several memory accesses to find complex instructions.

The speed of operation: is limited by the bottleneck effect
which means a single bus for data and instructions that prevents overlap both access times.

The process of execution of an instruction is as follows:

  1. The registration program counter generates an instruction (eg address or).
  2. This address comes from the address bus to memory.
  3. The contents of address zero out by the data bus into the instruction register and from there into the instruction register decoder (these first three steps is called the cycle of searching for a statement, before starting the execution cycle of instruction).
  4. The instruction register decoder configuration suited to deliver the arithmetic and logic unit (ALU) to perform the operation is indicated and increase the program counter to select the data.
  5. The result of the ALU is stored on the accumulator (A) or a memory address.
  6. The program counter register will be increased to implement the new instruction.

The Harvard architecture

The architecture known as Harvard, is simply a scheme in which the CPU is connected to two memories through two separate buses. One of the reports contain only the instructions of the program, and is called Program Memory. The only other memory stores data and is called data memory

advantages of this architecture are

  1. The size of the instructions not related to the data, and therefore can be optimized for any instruction occupies a single position program memory, thereby achieving greater speed and shorter program.
  2. the access time to the instructions may overlap with the data, achieving greater operating speed.

Disadvantage, and that is that must have special instructions for accessing tables of constant values that may be necessary to include in programs, because these tables were physically in the program memory (EPROM eg a microprocessor).

Microcontrollers

Microcontrollers contain basically all the elements required by a microcomputer on a single chip, this is also a memory containing processor unit (which may be RAM, EPROM or a combination of both), have input interfaces and / or output etc..

16xxx PIC Microcontrollers

are composed of a Harvard-type architecture and are called accumulator or working register w. simply register

Caractericsticas of microcontrollers

Clock Circuit

Responsible for generating the impulses that synchronize the operation of all system.

Timers

Aimed at controlling time.

Watchdog (Watch dog timer)

Designed to cause a reset when the program is
blocked.

AD and DA Converters

To receive and send signals fail protection analógicas.Sistema food

Idle State

In the system is frozen and the power consumption is minimal.

The great advantage that these microcontrollers, due to its low cost and ease of implementation, however, having all integrated in one chip restricts the amount of information being entered, the program length and number of instructions may have defined each microcontroller, for this reason that it occurs in the field of process control very specific and bounded

Memory of CIPs

As mentioned, the internal memory is divided into two groups called Program Memory and Data Memory .Program Memory: The architecture of the mid-range PIC allows up to 8192 instructions contain 14 bits each divided into positions of 2,048 pages each. To address 8K positions, they need 13-bit register holds the program counter PC. In the case of PIC 16F84 or similar, has only 1K of addresses (from the address 0000h to 03FFh address), then three more positions of PC register value are ignored. The first address for the reset and interrupt vector is an indirect addressing, so this memory location must contain the start address of the application program. The address 04h
also contains an interrupt vector, so it is ideal that the start address of the application program starts at address 05h.
Data memory: The memory data, also called register file (register file), is divided into two groups: the special registers and general purpose registers. The first occupied the first position and second positions that follow.
Among the special registers are the status register (STATUS); records of the Tri-state input / output; Ports E / S as the Port A, Port B, Port C,.), The 8 least significant bits of program counter (PC), the real time counter or Real Time Clock / Counter (RTCC) and a pointer register called File Select Register (FSR). Position 00 contains no records and is used especially in the indirect addressing mechanism. Program Counter: This register, usually called PC, is fully equivalent to all the microprocessors and contains the address of next instruction to execute. Automatically increases to execute each instruction, so that the natural sequence of program execution is linear, one instruction after another. Some
call control instructions, change the PC content by altering the linear sequence of execution. Within these instructions are the CALL GOTO and permitting loading at a constant value directly on the PC making the program jump to any memory location.Snack PIC microcontrollers in the stack is a dedicated internal memory of limited size, separated from the data memory and program inaccessible to the programmer, and organized as a stack, which is used alone, and automatically, to save return addresses subrrutinas and interruptions. Each
position is the right size to store a complete copy of the PC. As in any type memory cell, data is accessed so that the first thing that comes is the last sale. Word Processor Status The status word processor contains the three status bits ALU (C, DC Z), and other bits that were included for convenience in this record.
Bit C: indicates hauling most significant bit (bit 7) the outcome of the last operation of addition. In the case of subtraction behaves conversely, C is 1 if no loan request. The C bit is also used in the operations of rotation left or right as an intermediate step between bit 0 and bit 7.The DC bit (digit carry) indicates the fourth carry bit (bit 3) of the final result of addition or subtraction operation with a behavior similar to the C bit, and it is useful to operate in BCD (to add or subtract numbers packaged in BCD). The Z bit: indicates that the outcome of the last operation was zero. The PD bit (POWER DOWN) or low bit serves to detect whether the power was off and on again, has to do with the initialization sequence, the watch dog timer and sleep instruction that places the bit to zero. 1 = Normal operation 0 = Low power mode function Bit TO: (TIME-OUT) is used to detect if a reset condition was caused by the watch dog timer, is related to the same elements as the previous bit and is placed in 0 when the circuit surveillance Watch dog timer finishes. PA0 and PA1:or so-called RP0 and RP1, is a page selector direct addressing (OPCODE) and used in the direct branch instructions like GOTO and CALL: RP1, RP0 = 0,0 = 00 — Active bank RP1, RP0 = 0.1 = Active bank 01 — RP1, RP0 = 1.0 = Active bank 10 — RP1, RP0 = 1.1 = 11 bank assets
16C54 In fact in these bits are unused and used for general purposes. In the 16C57 the PA0 if used but the other two. 16C55 In the PA0 and PA1 are used. PA2 is reserved for future use and only RP0 is used in the PIC 16F84. RP1 can be used as a general purpose bit.
PA2: or also known as IRP, is a page selector for indirect addressing (FSR). Yes IRP = 0
Active indicates the bank 00 or bank 01. Yes IRP = 1 indicates the bank active 10 or 11. This bit is not used
effectively in the PIC 16F84, so can also be used as a general purpose bit.
16C5X PIC microcontrollers, and 17CXX have 16CXX Harvard architecture with a data memory of 8 bits, and a program memory, according to the model may be:
12 bits for 16C5X.