Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Give values for a, b, c, d, and e in the following table. Only ll in rows of the

ID: 2081293 • Letter: G

Question

Give values for a, b, c, d, and e in the following table. Only ll in rows of the table until all values
reach their steady state values. For example, if the values in the table do not change for time 3 and
beyond, only ll in the rows for time 0 through time 2. If a value is assigned multiple times within the
same simulation time, only show its nal value for that simulation time.
module timing;
reg [4:0] a, b, c, d, e;
reg clk;
initial
begin
c=3;d=2,e=4;#2 clk=1;
end
always@(a, b)
begin
#1 c = #1 a + 2; d = # 1 c + b;
end
always @(posedge clk)
begin
#2 e<= c+d; a <= #1 e - d; b <= #1 e + d;
end
endmodule

time a b c d e 0 1 2 3 4 5 6 7 8 9

Explanation / Answer

ANSWER:

Before answering your question, there is one point that I would like to mention. If there is no value assigned to any variable, we cannot tell the value of the corresponding net and we can mention that the value of the corresponding signal is 'x'.

If we broadly look at the given code, the clk signal goes to 1 after 2 units of time. Hence posedge occurs only after 2 units of time and the code inside posedge (clk) will be executed accordingly. the variable e gets assigned the value after 2 more units of time from the generation of posedge clk, i.e. after 4 units of time. Hence, it's effect can be seen at 4.1 or 4.5 or 5 units of time, not at 4 units of time. Also, we have non-blocking statements inside the always block, which means that the execution of the 3 statements

#2 e<= c+d;

a <= #1 e - d;

b <= #1 e + d;

all occur simultaneously. of course, since #delays are present in every line, the result of the execution of the individual line will be delayed accordingly. But the start of execution happens parallelly.

But, the case of the always@(a,b) block, the statements inside this block are blocking in nature. Hence only after the first statement completes execution, the next statement will start executing.

Keeping all these points in consideration, the following values were the results of the problem.

time a b c d e 0 x x 3 2 4 1 x x 3 2 4 2 x x 3 2 4 3 x x 3 2 4 4 x x 3 2 4 5 x x 3 2 5 6 2 6 3 2 5 7 2 6 3 2 5 8 2 6 4 2 5 9 2 6 4 10 5 10 2 6 4 10 5
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote