I wrote three different types of code (gate level modeling, dataflow level modeling and behavioral modeling).  below I have attached the three codes hoping you could write a comment on each line of code describing what each line does and then explain how each code is different.  (Gate level modeling) module project_gate1 (q, qbar, s, r, clk ); //(EXAMPLE COMMENTS WOULD GO HERE FOR EACH LINE) /this is to model a SR Flip-flop in gate level modeling input s, r, clk; output q, qbar; wire nand1_out; wire nand2_out; nand(nand1_out, s, clk); nand(nand2_out, r, clk); nand(q, nand1_out, qbar); nand(qbar, nand2_out, q); endmodule (Data flow modeling) module srff_dataflow(q, qbar, s, r, clk); output q, qbar; input s, r, clk; wire s_bar, r_bar; assign s_bar = ~(s & clk & qbar); assign r_bar = ~(r & clk & q); assign q = s_bar; assign qbar = r_bar; endmodule (Behavioral level modeling) module srff_07 (s, r, clk, q, qbar); input s, r, clk; output q, qbar; reg q, qbar; always@(posedge clk) begin if (s == 1 && r == 0) begin q <= 1; qbar <= 0; end else if (s == 0 && r == 1) begin q <= 0; qbar <= 1; end else if (s==0 && r==0) begin q <= q; qbar <= qbar; end end

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
icon
Concept explainers
Question

I wrote three different types of code (gate level modeling, dataflow level modeling and behavioral modeling). 

below I have attached the three codes hoping you could write a comment on each line of code describing what each line does and then explain how each code is different. 

(Gate level modeling)

module project_gate1 (q, qbar, s, r, clk ); //(EXAMPLE COMMENTS WOULD GO HERE FOR EACH LINE)

/this is to model a SR Flip-flop in gate level modeling

input s, r, clk;

output q, qbar;

wire nand1_out;

wire nand2_out;

nand(nand1_out, s, clk);

nand(nand2_out, r, clk);

nand(q, nand1_out, qbar);

nand(qbar, nand2_out, q);

endmodule

(Data flow modeling)

module srff_dataflow(q, qbar, s, r, clk);

output q, qbar;

input s, r, clk;

wire s_bar, r_bar;

assign s_bar = ~(s & clk & qbar);

assign r_bar = ~(r & clk & q);

assign q = s_bar;

assign qbar = r_bar;

endmodule

(Behavioral level modeling)

module srff_07 (s, r, clk, q, qbar);

input s, r, clk;

output q, qbar;

reg q, qbar;

always@(posedge clk)

begin

if (s == 1 && r == 0)

begin

q <= 1;

qbar <= 0;

end

else if (s == 0 && r == 1)

begin

q <= 0;

qbar <= 1;

end

else if (s==0 && r==0)

begin

q <= q;

qbar <= qbar;

end

end

 

Expert Solution
Step 1: Define as gates

Gates can be defined in such a way that they are electronic devices or logical components that perform basic logical functions based on Boolean algebra.

steps

Step by step

Solved in 6 steps

Blurred answer
Knowledge Booster
Design of User Interface
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