Digital design is an entirely new genre of programming with a completely different style. More specifically, in hardware design languages you specify the arrangements of AND / OR / NOT gates to make digital circuits. Languages like VHDL and Verilog are used for hardware design. These languages have powerful data structures and techniques to make digital design simple and effective. In about 2000-3000 lines of VHDL, you can make your own functional microprocessor!
- Digital Systems - It's good to know basic digital systems before you begin hardware design. You must know basic Boolean Algebra, Logic Gates, Karnaugh Maps, Flip-Flops, Karnaugh Maps at the very least. For more advanced design, make sure you understand basics of Registers, RTL, Memory and Turing Machines. It's best to do a complete course on MIT OCW / NPTEL / CDEEP, but you should be able to manage with some good articles.
- Basic Programming - Though not essential, helpful to know a language. Digital design is vastly different from standard programming, but many concepts are easily understood with good programming knowledge.
What's so Different?
- Well here, code runs parallelly rather than sequentially. Atleast a significant portion of it. The sequential element is added by specialized structures called "Finite State Machines", which use Flip-Flops. Since you are specifying the layout of a digital system, all of its components will accept inputs and produce outputs at the same time. Digital Design languages have specific set of rules to evaluate such code.
- Your code won't always work on hardware, despite a successful simulation. Unfortunately, you need to write "synthesizable" code, or code that can be easily implemented in a hardware. This is what makes digital design so different. For instance, VHDL does have it's own
forloop. But using the
forloop sometimes makes your code unsynthesizable, forcing you to change your design. This new style could take a while to get used to.
- Digital design is highly error prone. There is a lot more detail in digital design when compared to standard coding and hence it's imperative to make extensive testbenches which test your system through and through. Figuring out the cause of errors can get challenging at times, since it's easy to get the wiring wrong in a large system.
- Digital design often needs repetitive code - Code can get extremely repetitive in digital design as you are constrained when you want to make synthesizable code.
- Initial design is very important - Lastly, it's super necessary to properly plan your system. If you lack the planning, you will realize you need to make many more small additions as you go about constructing your system. Even small wiring changes can lead to massive repititve changes in the code to make it fully functional again. So sit down, draw it out on a paper before you begin!
Where can I learn VHDL?
There is a great book by Ashden, Designer's Guide to VHDL. Along with this book, you should use StackOverflow well. The VHDL community is very good and has written some excellent synthesizable solutions for common problems.
Why is Digital Design so Important?
All your computers run on microprocessors which are built using such code. All code eventually runs on processors, and hence it is extremely important to design a processor which executes instructions in the fastest way possible. All our favourite Intel buzz words, i3, i5, Xeon, Pentium, multi-threaded, stem out of this world of digital design. It's a fascinating field to say the least.