{"id":13363,"date":"2016-04-11T09:05:22","date_gmt":"2016-04-11T16:05:22","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=13363"},"modified":"2024-12-28T11:55:01","modified_gmt":"2024-12-28T19:55:01","slug":"battle-over-the-fpga-vhdl-vs-verilog-who-is-the-true-champ","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/battle-over-the-fpga-vhdl-vs-verilog-who-is-the-true-champ\/","title":{"rendered":"Verilog vs VHDL: Differences &#038; FPGA"},"content":{"rendered":"<p>With the intense tune of\u00a0<em>Eye of the Tiger<\/em> playing in the background, it is time to for this showdown\u00a0to begin. In the left\u00a0corner we have <a href=\"http:\/\/www.verilog.com\/\">Verilog<\/a>. Born in 1984, it didn&#8217;t make it to the big scene until 1995.\u00a0In the right\u00a0corner we have <a href=\"https:\/\/en.wikipedia.org\/wiki\/VHDLhttps:\/\/en.wikipedia.org\/wiki\/VHDL\">VHDL<\/a>, the language created by the US Department of Defense in the 1980&#8217;s.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-13376 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/vivadoedit-600x322.jpg\" alt=\"vivadoedit\" width=\"600\" height=\"322\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/vivadoedit-600x322.jpg 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/vivadoedit-768x412.jpg 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/vivadoedit-1024x550.jpg 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/vivadoedit-800x430.jpg 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Many people have different opinions on which language is better, but it really comes down to which language you prefer. I should also mention that there is of course System Verilog, but it is very closely related to Verilog so we&#8217;ll just leave that for another day. Let&#8217;s take a look at these languages and see what the differences are (though the <a href=\"https:\/\/digilent.com\/shop\/nexys-a7-fpga-trainer-board-recommended-for-ece-curriculum\/\">Nexys A7<\/a>, <a href=\"https:\/\/digilent.com\/shop\/cmod-a7-35t-breadboardable-artix-7-fpga-module\/\">Cmod A7<\/a>, and <a href=\"https:\/\/digilent.com\/shop\/cmod-s7-breadboardable-spartan-7-fpga-module\/\">Cmod S7<\/a> all support both languages).<\/p>\n<p>VHDL stands for VHSIC Hardware Description Language and VHSIC stands for Very High Speed Integrated Circuit. So on the whole VHDL actually stands for Very High Speed Integrated Circuit Hardware Description Language. Now, that&#8217;s a mouthful if I ever saw one!\u00a0One of the key features of VHDL is that it is a strongly typed language, which means that each data type (integer, character, or etc.) has been predefined by the language itself. All values or variables defined in this language must be described by one of the data types.<\/p>\n<p>VHDL is more verbose than Verilog and it is also has a non-C like syntax. With VHDL, you have a higher chance of writing more lines of code. VHDL can also just seem more natural to use at times. When you&#8217;re coding a program with VHDL, it can seem to flow better. But maybe that&#8217;s just my personal opinion.<\/p>\n<p>In Verilog, the language is more compact, as the Verilog language is more of a hardware modeling language. You will end up typing few lines of code and it draws similarities to the C language. Verilog has a better grasp on\u00a0hardware modeling, but has a lower level of programming constructs. Verilog is not as verbose as VHDL so that&#8217;s why it&#8217;s more compact. All in all, Verilog is pretty different from\u00a0VHDL. There are some similarities, but they are overshadowed by their differences.<\/p>\n<p>Looking at this example code, we can compare\u00a0at the how a MUX can be programmed through VHDL and Verilog.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-13365 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/code-600x212-600x212.png\" alt=\"code-600x212\" width=\"600\" height=\"212\" \/><\/p>\n<p>The layout of these programs are very similar; you can reasonably follow what each version of the code is doing. The VHDL version is longer then the Verilog, but it can be understood better.<\/p>\n<p>The last match of this competition is something that can&#8217;t be decided easily&#8230; it&#8217;s the personal preference challenge. This rides on the readers. Weigh in on why you like each\u00a0programming language, and which one you\u00a0prefer the most. This is a good opportunity to share some insight on to what beginners should look out for when starting to pick up VHDL or Verilog. If you want to see either language in action, check out some of the learn projects we have on\u00a0<a href=\"https:\/\/learn.blog.digilentinc.com\/Documents\/413\" target=\"_blank\" rel=\"noopener\">VHDL<\/a> and <a href=\"https:\/\/learn.blog.digilentinc.com\/Documents\/242\" target=\"_blank\" rel=\"noopener\">Verilog!<\/a><\/p>\n<p>Also check out some of our popular projects that use each language. Kaitlyn, a longtime supporter of Verilog details on Instructables some \u00a0of the awesome things you can do with this powerful tool.<\/p>\n<p>This includes controlling servos on your <a href=\"https:\/\/digilent.com\/shop\/boards-and-components\/system-boards\/fpga-boards\/\">FPGA<\/a>! <a href=\"http:\/\/www.instructables.com\/id\/Controlling-Servos-on-FPGA\/\">Here <\/a>she demonstrates how she used the <a href=\"https:\/\/digilent.com\/shop\/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users\/\">Basys 3<\/a> and Verilog to control the motion required for the <a href=\"https:\/\/digilent.com\/blog\/index.php\/the-claw-game-how-does-the-basys-3-know-what-to-do\/\">Claw Game Demo.<\/a><\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/cdn.instructables.com\/F1E\/ZVGJ\/IKIKTISN\/F1EZVGJIKIKTISN.MEDIUM.jpg\" alt=\"Picture of Put all the Pieces Together\" \/><\/p>\n<p>However despite a strong showing from Verilog, VHDL is not so quick to be outdone. <a href=\"https:\/\/digilent.com\/reference\/pmod:pmod:jstk\">Here <\/a>you can see it in action being used to program the popular <a href=\"https:\/\/digilent.com\/shop\/pmodjstk-two-axis-joystick\/\">PmodJSTK<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/digilent.com\/reference\/_media\/pmod:pmod:jstk:pmodjstk.png?w=300&amp;tok=30e972\" alt=\"Digilent's PmodJSTK (click to enlarge)\" width=\"434\" height=\"288\" \/><\/p>\n<p>This Pmod can then be used for a variety of applications&#8230;some even battle-related.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/cdn.instructables.com\/FJT\/ETEA\/IBUXMAAP\/FJTETEAIBUXMAAP.MEDIUM.jpg\" alt=\"Picture of Jousting Robot (Wiring Tutorial)\" \/><\/p>\n<p>Check out more on the PmodJSTK powered Jouster <a href=\"http:\/\/www.instructables.com\/id\/Jousting-Robot-Wiring-Tutorial\/\">here<\/a>!<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-13363 jlk' data-task='like' data-post_id='13363' data-nonce='35f55bdfa6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-13363 lc'>+6<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-13363 jlk' data-task='unlike' data-post_id='13363' data-nonce='35f55bdfa6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-13363 unlc'>-6<\/span><\/a><\/div><\/div> <div class='status-13363 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Check out the showdown between these two popular FPGA coding options!<\/p>\n","protected":false},"author":35,"featured_media":13365,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[35,1563],"tags":[],"ppma_author":[4488],"class_list":["post-13363","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fpga","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2016\/04\/code-600x212.png","authors":[{"term_id":4488,"user_id":35,"is_guest":0,"slug":"rp-prew","display_name":"Robert Prew","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/9b230ab7f67c22e5b9f8800d6ddee5f75d4797eeb0130a12b53d2fb0644a5bb4?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/13363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=13363"}],"version-history":[{"count":5,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/13363\/revisions"}],"predecessor-version":[{"id":31322,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/13363\/revisions\/31322"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/13365"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=13363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=13363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=13363"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=13363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}