{"id":603,"date":"2019-08-09T14:22:50","date_gmt":"2019-08-09T08:52:50","guid":{"rendered":"https:\/\/editor.eduplusnow.com\/?p=603"},"modified":"2019-08-09T14:22:50","modified_gmt":"2019-08-09T08:52:50","slug":"verilog-hdl-exploring-different-modelling-styles","status":"publish","type":"post","link":"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/","title":{"rendered":"Verilog HDL: Exploring Different Modelling Styles"},"content":{"rendered":"<h1>Verilog HDL: Exploring Different Modelling Styles<\/h1>\n<hr \/>\n<p><span style=\"font-weight: 400;\">When you think of any sequential or combination circuit, what modelling aspects come to mind?<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Schematic<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Truth table<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">And logical expression<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Similarly, when it\u2019s about Verilog HDL, three modelling aspects come to mind:\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Structural<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Behavioural<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Data flow<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">These three modelling styles of Verilog HDL are related to the three previously mentioned modelling aspects of the digital circuit. Let\u2019s see how.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Verilog HDL is a language that empowers developers to design a particular module in different coding styles. Based on the requirements of the project, three abstraction levels can be utilized to define the module. However, irrespective of the type of abstraction used internally, the interaction with the external environment remains the same.<\/span><\/p>\n<h3><b>Different Types of Modelling in Verilog HDL<\/b><\/h3>\n<h4><b>Structural Modelling Style<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The structural modelling style is the lowest level of abstraction obtained using logic gates. Similar to schematic or circuit diagrams of the digital circuit, Verilog uses primitive gates to compile and synthesize the program.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Of course, this abstraction can\u2019t be understood by humans. Machines, however, have the definite capability of compiling and logically synthesizing the code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The language supports multiple gates such as <\/span><b><i>and<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>or<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>nand<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>xor<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>nor<\/i><\/b><span style=\"font-weight: 400;\">, and <\/span><b><i>xnor<\/i><\/b><span style=\"font-weight: 400;\">. You can also use tri-state gates and multiple-output gates such as <\/span><b><i>bufif1<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>bufif0<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>notif1<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>notif0<\/i><\/b><span style=\"font-weight: 400;\">, <\/span><b><i>not<\/i><\/b><span style=\"font-weight: 400;\">, and <\/span><b><i>buf<\/i><\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s the syntax of these gates:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>and<\/b><span style=\"font-weight: 400;\"> | <\/span><b>or<\/b><span style=\"font-weight: 400;\"> | <\/span><b>nand<\/b><span style=\"font-weight: 400;\"> | <\/span><b>xor<\/b><span style=\"font-weight: 400;\"> | <\/span><b>nor<\/b><span style=\"font-weight: 400;\"> | <\/span><b>xnor <\/b><span style=\"font-weight: 400;\">[instance name] (output, input1, \u2026.., inputn);<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>not | buf <\/b><span style=\"font-weight: 400;\">[instance name] (output 1, output2, \u2026.., output n, input);<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>bufif1<\/b><span style=\"font-weight: 400;\"> | <\/span><b>bufif0<\/b><span style=\"font-weight: 400;\"> | <\/span><b>notif1<\/b><span style=\"font-weight: 400;\"> | <\/span><b>notif0 <\/b><span style=\"font-weight: 400;\">[instance name] (output, input, control);<\/span><\/li>\n<\/ul>\n<h4><b>Behavioural Modelling Style<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Behavioural modelling is the highest of level abstraction that completely depends on the circuit behaviour or on the truth table.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you know how your circuit will behave, you can design it. In fact, you can design the module without knowing the components of the hardware.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, even though it is the closest in terms of natural language understanding of the circuit functionality, this modelling type is hardest to implement and synthesize. Hence, it is utilized for complex circuits such as pure combinational or sequential circuits.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A module developed using behavioural modelling contains <\/span><b><i>initial<\/i><\/b><span style=\"font-weight: 400;\"> or <\/span><b><i>always<\/i><\/b><span style=\"font-weight: 400;\"> statements, which are executed concurrently (according to the parallelism of the model). The procedural statements in the module are executed sequentially.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">At time=0, both the <\/span><b><i>initial<\/i><\/b><span style=\"font-weight: 400;\"> and <\/span><b><i>always<\/i><\/b><span style=\"font-weight: 400;\"> will execute and then, <\/span><b><i>always<\/i><\/b><span style=\"font-weight: 400;\"> statements run for the remaining time. Here\u2019s the syntax:<\/span><\/p>\n<p><b>always<\/b><span style=\"font-weight: 400;\"> [timing control] procedural_statements;<\/span><\/p>\n<p><b>initial<\/b><span style=\"font-weight: 400;\"> [ timing control] procedural_statements;<\/span><\/p>\n<h4><b>Data Flow Modelling Style<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The data flow is a medium level abstraction, which is achieved by defining the data flow of the module. You can design the module by defining and expressing input signals which are assigned to the output, very much similar to logical expressions.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For most of the modules, data flow modelling is simple to implement and can be easily translated to structure such as in the case of combinational circuits.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The combinational circuits use continuous assignments, where value is defined for a data <\/span><b><i>net<\/i><\/b><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">assign[delay] LHS_net = RHS_expression<\/span><\/p>\n<h3><b>Conclusion\u00a0<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">All the Verilog HDL modelling styles are utilized for different requirements and purposes. While you can use a data flow model or structural model for combinational circuits, behavioural model is best suited for sequential or combination circuits. Evaluate your requirements first and then select one of the models for maximum output.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Verilog HDL: Exploring Different Modelling Styles When you think of any sequential or combination circuit, what modelling aspects come to mind? Schematic Truth table And logical expression Similarly, when it\u2019s about Verilog HDL, three modelling aspects come to mind:\u00a0 Structural Behavioural Data flow These three modelling styles of Verilog HDL are related to the three &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Verilog HDL: Exploring Different Modelling Styles&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":604,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3,21,4],"tags":[82,145,384,400],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Verilog HDL: Exploring Different Modelling Styles<\/title>\n<meta name=\"description\" content=\"In this article, we explore the different modelling styles in Verilog HDL Modelling language.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"3 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/#website\",\"url\":\"https:\/\/blog.eduplusnow.com\/blog\/\",\"name\":\"Edu plus now Blog\",\"description\":\"Just another WordPress site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/blog.eduplusnow.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/blog.eduplusnow.com\/blog\/wp-content\/uploads\/2019\/08\/Image1.jpg\",\"width\":1000,\"height\":563},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/#webpage\",\"url\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\",\"name\":\"Verilog HDL: Exploring Different Modelling Styles\",\"isPartOf\":{\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/#primaryimage\"},\"datePublished\":\"2019-08-09T08:52:50+00:00\",\"dateModified\":\"2019-08-09T08:52:50+00:00\",\"author\":{\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/#\/schema\/person\/5f873cbf920d9068c9190f6847b9b650\"},\"description\":\"In this article, we explore the different modelling styles in Verilog HDL Modelling language.\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/\",\"url\":\"https:\/\/blog.eduplusnow.com\/blog\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\",\"url\":\"https:\/\/blog.eduplusnow.com\/blog\/verilog-hdl-exploring-different-modelling-styles\/\",\"name\":\"Verilog HDL: Exploring Different Modelling Styles\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/#\/schema\/person\/5f873cbf920d9068c9190f6847b9b650\",\"name\":\"editor@eduplusnow.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/blog.eduplusnow.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a5b495db0bdab37964c4b2e2b72f45e6?s=96&d=mm&r=g\",\"caption\":\"editor@eduplusnow.com\"},\"sameAs\":[\"https:\/\/blog.eduplusnow.com\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/posts\/603"}],"collection":[{"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/comments?post=603"}],"version-history":[{"count":0,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/posts\/603\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/media\/604"}],"wp:attachment":[{"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/media?parent=603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/categories?post=603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eduplusnow.com\/blog\/wp-json\/wp\/v2\/tags?post=603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}