MODIFY THIS VERILOG CODE. THE OUTPUT OF THE QA,QB & QC (that will be seen on gtkwave) SHOULD BE: qa qb qc 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 1 0 0 1   module finals_nake(in, clk, qa, qb, qc);   input in, clk;   output qa, qb, qc;   wire ja, jb, jc, ka, kb, kc;   // Negated inputs   wire in_n, clk_n;   assign in_n = ~in;   assign clk_n = ~clk;   // JK equations based on provided equations   assign ja = (qb & ~qc & ~in) | (qb & qc & in);   assign ka = clk & clk;   assign jb = (~qa & ~qc & ~in) | (~qa & qc & in);   assign kb = qa | (~qc & ~in) | (qc & in);   assign jc = (~qc & ~in) | (~qc & in);   assign kc = clk & clk;   //jka   wire jka1, jka2, jka3, jka4;   assign jka1 = ~(jka4 & ja);   assign jka2 = ~(jka3 & ka);   assign jka3 = ~(jka1 & jka4);   assign jka4 = ~(jka2 & jka3);   assign qa = jka3;   //jkb   wire jkb1, jkb2, jkb3, jkb4;   assign jkb1 = ~(jkb4 & jb);   assign jkb2 = ~(jkb3 & kb);   assign jkb3 = ~(jkb1 & jkb4);   assign jkb4 = ~(jkb2 & jkb3);   assign qb = jkb3;   //jkc   wire jkc1, jkc2, jkc3, jkc4;   assign jkc1 = ~(jkc4 & jc);   assign jkc2 = ~(jkc3 & kc);   assign jkc3 = ~(jkc1 & jkc4);   assign jkc4 = ~(jkc2 & jkc3);   assign qc = jkc3; endmodule module finals_nake_tb();   reg in, clk;   wire qa, qb, qc;   finals_nake finals_nake_ins(in, clk, qa, qb, qc);   initial     begin       in = 0; clk = 0;       #10 in = 0; clk = 1;       #10 in = 0; clk = 0;       #10 in = 0; clk = 1;       #10 in = 0; clk = 0;       #10 in = 0; clk = 1;       #10 in = 0; clk = 0;       #10 in = 0; clk = 1;       #10 in = 0; clk = 0;       #10 in = 0; clk = 1;       #10 in = 0; clk = 0;       #10 in = 1; clk = 1;       #10 in = 1; clk = 0;       #10 in = 1; clk = 1;       #10 in = 1; clk = 0;       #10 in = 1; clk = 1;       #10 in = 1; clk = 0;       #10 in = 1; clk = 1;       #10 in = 1; clk = 0;       #10 in = 1; clk = 1;       #10 in = 1; clk = 0;       #10 in = 1; clk = 1;       #10 in = 0; clk = 0;     end   initial     begin       $dumpfile("finals_nake_ins.vcd");       $dumpvars();       $finish;     end endmodule

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

MODIFY THIS VERILOG CODE. THE OUTPUT OF THE QA,QB & QC (that will be seen on gtkwave) SHOULD BE:

qa qb qc

0 1 0

0 1 1

0 1 1

1 0 0

1 0 0

0 0 1

1 0 1

1 0 1

0 0 1

 

module finals_nake(in, clk, qa, qb, qc);
  input in, clk;
  output qa, qb, qc;
  wire ja, jb, jc, ka, kb, kc;

  // Negated inputs
  wire in_n, clk_n;
  assign in_n = ~in;
  assign clk_n = ~clk;

  // JK equations based on provided equations
  assign ja = (qb & ~qc & ~in) | (qb & qc & in);
  assign ka = clk & clk;
  assign jb = (~qa & ~qc & ~in) | (~qa & qc & in);
  assign kb = qa | (~qc & ~in) | (qc & in);
  assign jc = (~qc & ~in) | (~qc & in);
  assign kc = clk & clk;

  //jka
  wire jka1, jka2, jka3, jka4;
  assign jka1 = ~(jka4 & ja);
  assign jka2 = ~(jka3 & ka);
  assign jka3 = ~(jka1 & jka4);
  assign jka4 = ~(jka2 & jka3);
  assign qa = jka3;

  //jkb
  wire jkb1, jkb2, jkb3, jkb4;
  assign jkb1 = ~(jkb4 & jb);
  assign jkb2 = ~(jkb3 & kb);
  assign jkb3 = ~(jkb1 & jkb4);
  assign jkb4 = ~(jkb2 & jkb3);
  assign qb = jkb3;

  //jkc
  wire jkc1, jkc2, jkc3, jkc4;
  assign jkc1 = ~(jkc4 & jc);
  assign jkc2 = ~(jkc3 & kc);
  assign jkc3 = ~(jkc1 & jkc4);
  assign jkc4 = ~(jkc2 & jkc3);
  assign qc = jkc3;

endmodule

module finals_nake_tb();
  reg in, clk;
  wire qa, qb, qc;

  finals_nake finals_nake_ins(in, clk, qa, qb, qc);

  initial
    begin
      in = 0; clk = 0;
      #10 in = 0; clk = 1;
      #10 in = 0; clk = 0;
      #10 in = 0; clk = 1;
      #10 in = 0; clk = 0;
      #10 in = 0; clk = 1;
      #10 in = 0; clk = 0;
      #10 in = 0; clk = 1;
      #10 in = 0; clk = 0;
      #10 in = 0; clk = 1;
      #10 in = 0; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 1; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 1; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 1; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 1; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 1; clk = 0;
      #10 in = 1; clk = 1;
      #10 in = 0; clk = 0;
    end

  initial
    begin
      $dumpfile("finals_nake_ins.vcd");
      $dumpvars();
      $finish;
    end

endmodule

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education