The microprocessor can be seen has a large electrical circuit that can be serve a lot of different purposes and that needs to be supplied with a "binary file" of instructions to execute. The piece of silicon that doesn't change (microprocessor) is called hardware. The supplied binary code is called the software. By definition, hardware is fixed and software can be modified (with programming). I want to emphasize that point because I'll come back to that when discussing soft-core and hard-core in a FPGA. Throughout this article, I'll give practical examples with the PicoBlaze processor, which is a very simple soft processor core.
Computer bus
A bus in computing can be seen as a kind of highway for data. This highway can have several lanes (parallel bus) or the cars can line up one after the other (serial bus). This highway connects the different sub-systems of the computer. To show you the importance of device interconnect/communication here are some examples of common wired interface:Peripheral
- USB (Universal Serial Bus)
- RS-232
- FireWire
- Thunderbolt
Printed circuit board
- I²C (Inter-Integrated Circuit)
- SPI (Serial Peripheral Interface)
- 1-Wire
- PCI (Peripheral Component Interconnect)
- AGP (Accelerated Graphics Port)
Network
- Ethernet
- CAN (Controller Area Network)
- RS-485
Video
- VGA (Video Graphics Array)
- HDMI (High-Definition Multimedia Interface)
- DVI (Digital Visual Interface)
Hard drive
- SATA (Serial Advanced Technology Attachment)
- IDE (Integrated Drive Electronics)
Internal IC buses
Even more important for today discussion, there is a lot of different buses inside integrated circuits to connect the different memories/caches to the processing unit and the inputs/outputs.
Program memory
The program memory is where the microprocessor program instructions are stored. This memory has a fixed width that matches the computer instruction width. It is sometimes considered as a ROM (Read-only Memory) because the program storage don't change while the processor is running. Here is an excerpt of the 18-bit PicoBlaze instruction set; that is, available instructions opcode understood by the processing unit.
Data memory
The data memory is used to store temporary data/variables. This kind of memory is also called the RAM (Random-Access Memory). You can see it like a kind of scratchpad area, where you can make some calculations on it and retrieve it later for other uses. Some CPU can process RAM directly, some others using the Load/Store Architecture have to switch this data back and forth in their internal registers to process it.
Harvard versus Von Neumann architecture
There is basically two kind of architecture to access memories. The Harvard architecture can access the program and data memory independently because it has two distinct buses to access them. In the Von Neumann architecture, the program and data memories share a single datapath. With a single memory bus, the processor will be less complex, but will also be slower than with separate buses. The Harvard architecture is mainstream now because of the Von Neumann Bottleneck.
CPU
The CPU (Central Processing Unit) is where everything is processed in a computer. Let's take a look at the internals schematics of the 8-bit PicoBlaze core:
At the top-left corner, there is the program memory. In this case, it's limited to 1024 18-bit instructions. The next block at the right is a small 10-bit pointer register called the PC (Program Counter). It is used to store the address of the next instruction to be executed. It can address all the 1024 instruction because it is 10 bits wide (2^10=1024). In the PicoBlaze, there's a quite small amount of RAM, only 64 bytes. There is however 16 registers that you can use for general purposes.
The CPU specific components in this schematics are the registers, PC, instruction decoder, buses and the ALU (Arithmetic Logic Unit). The ALU is the heart of the CPU, it's used to process the data that are brought to it by the different buses. You can see that it has 2 input buses and one output bus that work in conjunction with the registers. Everything that has to be processed has to be in the registers and is stored back in the registers. That it why it's a Load/Store Architecture core, there is no direct access between the ALU and the RAM. By the way, that PicoBlaze has a separate bus for instructions and data (as you can see above), so it's an Harvard processor.
The big arrows at the far left and right of the schematic is the interrupt line and the IO. It is what allow the PicoBlaze to talk and interact with the external world, like sensors and actuators.
At the top-left corner, there is the program memory. In this case, it's limited to 1024 18-bit instructions. The next block at the right is a small 10-bit pointer register called the PC (Program Counter). It is used to store the address of the next instruction to be executed. It can address all the 1024 instruction because it is 10 bits wide (2^10=1024). In the PicoBlaze, there's a quite small amount of RAM, only 64 bytes. There is however 16 registers that you can use for general purposes.
The CPU specific components in this schematics are the registers, PC, instruction decoder, buses and the ALU (Arithmetic Logic Unit). The ALU is the heart of the CPU, it's used to process the data that are brought to it by the different buses. You can see that it has 2 input buses and one output bus that work in conjunction with the registers. Everything that has to be processed has to be in the registers and is stored back in the registers. That it why it's a Load/Store Architecture core, there is no direct access between the ALU and the RAM. By the way, that PicoBlaze has a separate bus for instructions and data (as you can see above), so it's an Harvard processor.
The big arrows at the far left and right of the schematic is the interrupt line and the IO. It is what allow the PicoBlaze to talk and interact with the external world, like sensors and actuators.
MCU (µC)
A last thing I would like to discuss about is MCUs (Microcontroller Unit). A microcontroller contains all we've talked about previously on a single chip. They are mostly used in embedded systems, where they do repetitive tasks in a reliable way.
In contrast, personal computers have a motherboard with separate components : CPU, GPU, RAM, hard drives, etc. They have much larger memories and faster clock frequencies.
The advantages of µC are their low cost and small power consumption. They're all around and you don't even see them; watches, Bluetooth headset, keyboard/mouse, microwave oven, remote control, digital photo frame, radio...
Conclusion
In the next part of this article, I'll write a little tutorial on PicoBlaze ASM programming and you will be able to simulate it on your computer!
No comments:
Post a Comment