{"id":138,"date":"2024-09-17T05:12:38","date_gmt":"2024-09-17T05:12:38","guid":{"rendered":"https:\/\/technicalley.com\/central\/ee\/?p=138"},"modified":"2024-09-17T05:12:38","modified_gmt":"2024-09-17T05:12:38","slug":"design-example-alu-01-testbench-alu_01_tb_01","status":"publish","type":"post","link":"https:\/\/technicalley.com\/central\/ee\/2024\/09\/17\/design-example-alu-01-testbench-alu_01_tb_01\/","title":{"rendered":"Design Example: ALU 01 Testbench (alu_01_tb_01)"},"content":{"rendered":"\n<p>Testbench for <a href=\"https:\/\/technicalley.com\/central\/ee\/2024\/09\/14\/design-example-alu-01\/\">ALU 01 design example<\/a> is shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\/\/ ALU 01 port list\n\/\/ Inputs A, B of 8 bits (operands)\n\/\/ Output Y of 8 bits (output)\n\/\/ Input C of 2 bits (control)\n\/\/ Input clock, input reset\n\n\/\/ Testbench\nmodule alu_01_tb_01;\n\n\/\/ Declare the wires\nlogic clk;\nlogic rst;\nlogic &#91;7:0] a, b, y;\nlogic &#91;1:0] c;\n\n\/\/ instantiate the device-under-test\nalu dut (\n    .clock (clk),\n    .reset (rst),\n    .a (a),\n    .b (b),\n    .c (c),\n    .y (y)\n);\n\n\/\/ Reset controller\ninitial begin\n  reset = 1'b1;\n  #100;\n  reset = 1'b0;\nend\n\n\/\/ Clock generator\nalways @(*) begin\n    if (reset) begin\n        clk = 1'b0;\n    end else begin\n         clk = ~clk;\n         #10;\n    end\nend\n\n\/\/ Input stimulus\ninitial begin\nend\n\n\nendmodule<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Testbench for ALU 01 design example is shown below.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,10],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-design-example","category-systemverilog","category-verilog","wpcat-4-id","wpcat-9-id","wpcat-10-id"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":0,"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"wp:attachment":[{"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technicalley.com\/central\/ee\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}