Microcontrollers generally use two types of Architecture.
- Von Neumann Architecture
- Harvard Architecture
Von Neumann Architecture consists of Control Unit, Arithmetic and LOGIC unit, Input/ Output, and Registers.
In Von Neumann Architecture, which is used by many microcontrollers, memory space is on the same bus and thereby instructions and data intend to use the same memory. It uses the concept of the stored-program computer.
Harvard Architecture consists of Arithmetic Logic Unit, Data Memory, Input/output, Data Memory, Instruction Memory, and the Control Unit.
Harvard Architecture, has separate memory for data and instructions. In that way, both instruction and data can be fetched at the same time, thus making it comfortable to the users.
In Harvard Architecture, Instructions are used in Read-only memory and, Data are used in Read-Write Memory.
Harvard Architecture is used with CPU mostly, but it is used with main memory at times as it is a little complex and on the expensive side.
The size of memory for both instructions and data are different in the case of Harvard Architecture. Programs cannot never run automatically and the organization of memory is not in the hands of the user. We can look at the various features of Harvard Architecture in this article.
EXAMPLES OF HARVARD ARCHITECTURE
One example of Harvard Architecture is the early computer Mainframe systems where instructions are stored in one programming media such as punch cards and data are stored in the other [programming media such as Tapes. The results of the Harvard Architecture are their corresponding images.
Dataflow machines and Reduction machines are examples of Harvard Architecture as well. They exhibit a high rate of parallelism meaning that the results from data and instructions can be obtained at the same time.
Quantum computers can also be cited as an example of Harvard Architecture. The difference between other computers and Quantum computer is that the time they require to complete a task and the order in which they prioritize their timings.
Enigma Machines which were used in World Wars also follow the Harvard Architecture,
Yet another main example of Harvard Architecture is the DIGITAL SIGNAL PROCESSOR, which is primarily dependent on the concept of Harvard Architecture. Let us see, how the DSP works in detail.
DIGITAL SIGNAL PROCESSOR
- Digital Signal Processors are used to stream data and they are used to fetch multiple instructions at the same time using a specialized memory architecture and separate data and program memory.
- DSP’s mathematically manipulate procedures taking real-world aspects such as audio, video, voice, pressure and, digitize them.
- They are also used for performing mathematical operations like Addition, Subtraction, Multiplication and, Division. The processing of signals is essential because the information that they contain must be displayed and analyzed so that they can be converted to another signal, to the format that users require, so that they find it interesting.
- Analog to Digital Converters take up the job of converting the above aspects to digital signals in terms of 0’s and 1’s. The DSP then takes the digitized signal and processes them.
- It takes the digitized signals and converts them to analog signals again using Analog to Digital Convertor making it useful to the real world. The speed at which all these processes occur is very high.
- Let’s see how the Digital Signal Processor works on Mp3 devices. It generally takes the inputs through receivers and converts them into a digital signal (in the form of 0’s and 1’s) using Analog-Digital Converter. Post the conversion phase, encoding is performed and the encoded file is thereby saved to memory.
- Next comes the decoding phase, where the file would be taken from memory, converted to analog signals using Digital-Analog Converter and, then the output is received through the speaker system. This is the process that happens in the Mp3 device. It also performs complex functions such as controlling volume, editing frequencies and, so on.
- A DPS can be used by the computer to control things such as efficiency, transmission, etc. Signals go through the processing phase first and then the transmission phase. Teleconferencing uses telephone signals to transmit audio and video lines. The quality of signals could be manipulated or improvised to appear better to the eyes of the user. It will be invisible to the eyes of the user. Example, Echo cancellation on telephones.
- Although signals in the real world can be processed in an analog way, these digitally processed signals can be transmitted with high speed and they are very much accurate.
COMPONENTS INSIDE A DSP
Digital Signal Processor consists of the following parts:
It uses processed data and stores the program inside memory. It is generally non-volatile. In this program memory, flash memory is used, where reprogramming is possible using a hardware interface. And program memory generally uses the concept of stack.
Data Memory is called Random Access Memory. It is a temporary place for storing variables and constants during program execution. The amount of memory that is RAM, varies from one microcontroller to another.
It performs mathematical operations and it collects data and programs from their respective places. It collects instructions from program memory and it also collects data from data memory.
The technique used to transfer data from an external device and a microcontroller is called Input/Output. The user communicates with the microcontroller through the Input/Output. The users enter their data through the input device keyboard, and collect their desired output from the external device printers or hard-disks. These Input/output devices are called peripherals and they are the most common devices that are used on the microcontroller system.
ARCHITECTURE OF DIGITAL SIGNAL PROCESSOR
The instruction sets used in DSP are irregular. While the common instruction sets are used in regular operations of a computer, DSP sets are used in specialized mathematical operations.
Assembly programs are generally put into libraries for re-use, instead, other machines use compiler methods to store essential algorithms. Many programs used in DSP are generally handwritten, to facilitate easy programming.
The data instructions include various operations such as arithmetic instructions, boolean instructions, logical instructions and, flow instructions.
Program flow consists of pipelined architecture and multiple accumulators.
Hardware Architecture consists of physical components of a system. Generally, they provide the space for other systems to fit into the device and they also assess the other software components. They also provide room for effective usage of software components. They combine the various sectors of engineering to work together and develop new machines and architecture.
However, we have to realize that hardware components cannot run properly without the help of software components. If we take modern aircraft, for example, we have to use software embedded code to make it run effectively.
Digital Signal Processors are generally used for running data and they use specialized memory techniques to fetch data and instructions separately on different pathways (the concept of Harvard Architecture) and data and instructions are fetched on the same bus as used in Von Neumann Architecture.
Memory at times used the cached storage to know about the delay operations.
DSP’s generally do not use virtual memory as they rely on multi-tasking operations. Operations that use virtual memory generally use the concept of concept switching which is proven to increase latency.
Modern Digital Signal Processors yield even better results. This is because of the low-level design, advanced-cache etc.
Each DSP can be of different speeds. There are many Digital Signal Processors with low speed designed to perform specific tasks.
XMOS produces many micro core processors. They are easily programmable using C language.
SEVA is the modern DSP that uses MAC structure.
Analog Devices uses SHARC based DSP system.
Microchip Technologies are used in PIC 24 images.
Most of the DSP’s use fixed arithmetic values. Floating DSP’s might become void in case of dynamic values. Many product designers use floating DSP’s, if they think that the device should be cost-effective as well as in exchange of reliable software for expensive hardware systems.
Modern DSP’s are generally used in easily implementable algorithms.
PROS AND CONS OF DSP’S
- They are highly accurate. Their outputs have high accuracy when compared to analog devices.
- Re-organizing analog devices might turn to be very difficult. In Digital Signal Processors, it’s easy as the code gets flashed in seconds, thus making it comfortable to the users.
- High-level algorithms can be implemented using specific methods.
- The cost of implementation in Digital Signal Processors is much lesser when compared to the analog processors.
- The DSP’s can easily be descended when compared to the other processors.
- DSP’s can be also operated offline, which makes it accessible for easy transportation.
- It is quite complex as it uses convertors. ADC (Analog to Digital Converter) and DAC (Digital to Analog Converter).
- Each DSP has separate hardware and software devices. Thus, DSP’s cannot be used without proper training.
- More bandwidth is required for digital transmission than analog transmission.
- IC’s have to be used cautiously as they are very expensive.
- We have to master the concepts clearly as the control unit which is present is more complex and re-designing would be a tedious work.
FACTS ABOUT HARVARD ARCHITECTURE
- Harvard Architecture speeds up the processor rate. Since data and instructions are stored in separate buses, it is very advantageous to many users.
- Harvard Architecture follows the “Pipeline” arrangement. If the execution of one instruction is going on, the other instruction would be fetched from memory. This allows overlapping of instructions thus the execution rate is increased considerably.
- RISC (Reduced Instruction Set Computer) and CISC (Complex Instruction Set Computer) are the methodologies used in Harvard Architecture. In RISC microcontroller data is 8 bits, whereas instructions are 12 bits or 16 bits wide. Thus, everything is executed at a time resulting in increased performance.
- In CISC both data and instructions are 8 bits wide. They have generally over 200 instructions. But they cannot be executed at a time rather fetched simultaneously.
- The execution unit consists of 2 Arithmetic and Logic Units, 1 shifter, 1 multiplier, accumulators, etc. Thus, they can execute arithmetic operations in a stable way and with excellent parallelism.
- Many microcontrollers also use Lookup Table. (LUT). They made used for modulation purposes.
ADVANTAGES AND DISADVANTAGES OF HARVARD ARCHITECTURE
- Since data and instructions are stored in separate buses there are very few chances of corruption.
- Data that uses Read-Only mode and instructions which uses Read-Write mode are operated in the same way. They can also be accessed similarly.
- Generally, two memories would be present, one for data and the other one for instructions, they have different cell sizes making use of the resources very effectively.
- The bandwidth that is used for memory is more predictable.
- They generally offer high performance as data and buses are kept in separate memory and travel on different buses.
- Parallel access to data and instructions can be maintained.
- Scheduling would no longer be required as there are separate buses for data and instructions.
- Programmers can design the memory unit according to their requirements.
- Control unit gets data and instructions from one memory. Thus, it simplifies the architecture of the control unit.
- The un-occupied data memory cannot be used by instructions and the free instruction memory cannot be used by data. Memory dedicated to each unit has to be balanced carefully.
- The program cannot be written by the machine on its own as in Von Neumann Architecture.
- Control Unit takes more time to develop and is on the expensive side.
- There are 2 buses on the architecture. Which in the way means that the motherboard would be more complex, which in turn means that there would be two RAMs and thus tends to have a very complex cache design. That is the reason for it being used mostly inside the CPU and not outside of it.
- Production of computer with 2 buses takes more time to get manufactured and is again on the expensive side like the control unit.
- It has more pins on its IC’s. Therefore, it is very difficult to implement it.
- It is not used widely, so the development of it would be on the backward edge.
- It does not make most of the Central Processing Unit, always.
SUMMARY OF HARVARD ARCHITECTURE
- Basics: It is based on the Harvard I computer model.
- Memory: It has separate memory for data and instructions. Thus, each system on the memory can be accessed simultaneously.
- Instruction Processing: In Harvard Architecture instruction processing can be completed at a single-phase if the pipelines are in their appropriate places.
- Cost: Control Unit in the Harvard Architecture takes more time to develop and is on the expensive side.
- Uses: They are primarily used in Microcontrollers and Digital Signal Processors.
So, we should opt to use Harvard Architecture if,
- Instructions are wider than data. In this case, if instructions would be processed separately, they can lead to a more reliable output. Whereas, if they are put in the same cell with data, they tend to overlap thus causing errands.
- We should look out if the Caches are Read-Only. This is because if the Caches have Read-Write option, that could take more time for its development and it could be complex too.
- They should have separate bandwidth for better optimization.
- Very effective in case of “JIT”, Just in Time Compilers where copy-paste penalty would be offended, metaprogramming is present and self-modifying code is also available.
- Where the programming aspect would be the main concern. Because with microcontrollers it would be difficult to design and develop other variants as the motherboards inside them would be complex to understand and would turn out to be a tedious task on the whole.
- Embedded processors can be developed because they are intended to have characteristics which in turn promotes cross-talk over both sides, if they have large memory bandwidths and flat address link.
- The concept of stack is implemented. The address unit should not get complicated as it may have to run at least 2 paths parallelly. The program counter and stack pointer would be present. Registers that are present in the pointers can be incremented or decremented.
- Some Digital Signal Processors use the “LIFO” concept. Last in First Out. This is also called Hardware stack. In this way, we can push and pop stack faster, therefore it does not require the usage of address buses.
Thus, we have discussed about Harvard Architecture in detail. We have also seen all the advantages and disadvantages of Harvard Architecture. Examples have been discussed to make it more clear to the eyes of the user. Thus, we have to make sure that, we master the architecture completely to obtain the best results of it. We should also be clear on which instance we should use Harvard and Von Neumann architecture and make the effective use of what we use. Feel free to post any comments and share your suggestions as well to discuss more!!