Question: The following SystemVerilog modules show errors that the authors have seen students make in the laboratory. Explain the error in each module and show how
The following SystemVerilog modules show errors that the authors have seen students make in the laboratory. Explain the error in each module and show how to fix it.
(a)
![module latch(input logic clk. input logic [3:0] d. output reg [3:0] q): always @(clk) if (clk) q <= d: endmodule](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1547/3/0/9/6815c3a1271130d81547292320907.jpg)
(b)
![module gates (input logic [3:0] a, b. output logic [3:0] y1. y2. y3. y4. y5): always @(a) begin yl = a & b; y2 = a | b:](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1547/3/0/9/7015c3a12854c3a51547292341166.jpg)
(c)
![module latch(input logic clk. input logic [3:0] d. output reg [3:0] q):](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1547/3/0/9/7315c3a12a3dea0b1547292371826.jpg)
(d)

(e)


(f)

(g)

(h)

(i)


(j)

module latch(input logic clk. input logic [3:0] d. output reg [3:0] q): always @(clk) if (clk) q
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
a Problem Signal d is not included in the sensitivity list of the always statement Correction shown ... View full answer
Get step-by-step solutions from verified subject matter experts
