Sir in example no. 5 of multiple edge clock the variable c in always block should be a register type variable?
@jogeshsingh8543 жыл бұрын
Yes, we cannot assign value to non-register data type in procedural block .
@anuragagarwal45764 жыл бұрын
@17:05 shouldn't we use c as reg [7:0] instead of input [7:0] c
@naveenchander53495 жыл бұрын
@17:05, Shouldn't the variable 'c' be defined as output[7:0] rather than input[7:0] ?
@shubhurv5434 жыл бұрын
Yes exactly 👍👍
@anuragagarwal45764 жыл бұрын
Shouldn't we just use it as a reg [7:0] c ?
@iwbnwif3 жыл бұрын
@@anuragagarwal4576 Yes, but then we need to remove it from the list of ports in the module declaration. i.e., module multi_edge_clk (a, b, d, f, clk); ...
@Vishalkumar-ez5xy2 жыл бұрын
@@iwbnwif it should be module(a,b,d,c,f,clk), right?
@JayPatel-g8s Жыл бұрын
Yes, I tried synthesis and end up getting error.
@arghya.70985 ай бұрын
15:07 can't we achieve the same functionality using blocking assignment?
@NitishKumar-xw9qt3 жыл бұрын
sir @24.53 count[0 ] is assigned to 0 and 1 simultaneosly .So how can be decide whether the value of count[0] will be 1 or 0?
@gauravkaushal10373 жыл бұрын
I think that assignment will take after the shift, just the value of it will be taken as 1 before rotation
@emmanuelinnocent45052 жыл бұрын
Assignment will take place at the end of the procedural block and it's only the final update that will be reflected on count[0]. According to the code count[0] was supposed to be altered twice(the first and the second assignment statements) while the rest of the elements in the vector were supposed to be altered once( the first assignment statement). So for count[0] only the second assignment statement(since it's last alteration for count[0]) will be taken for update while for the rest the first assignment statement will be take for update(since that's the last alteration for them).
@aayushiaryam18442 жыл бұрын
@@emmanuelinnocent4505 Y in ring counter the rotation is being carried out in clockwise direction!? Shouldn't the 1 rotate in anti-clockwise direction?
@emmanuelinnocent45052 жыл бұрын
@@aayushiaryam1844 I do not understand the concept of rotation you're talking about. If you could explain it to me, it'll be appreciated. However, for a ring counter, I think what should matter is its ability to count from the lowest number possible to the highest number possible repeatedly. And in this case of the example given in this lecture, the ring counter does exactly that. How? We can see from the given sequence of bits - seven 0s and one 1- the combination of those sequence of bits that will give the highest number (unsigned) is 10000000 while the lowest is 00000001 (unsigned). And we can verify that the given code will do just that. If we start with 10000000 the code will give the following next results: 0000001, 00000010, 00000100, etc. Meanwhile, if we had started with 00000001 we'd get: 00000010, 00000100, etc. So what is essential about a ring counter is counting from lowest to highest number possible (or vise versa) repeatedly.
@arghya.70985 ай бұрын
@@emmanuelinnocent4505 thanks for your detailed explanation
@Shivamchaudhary-xx6ci2 жыл бұрын
What if we use blocking assignment in the example shown in time 9:00
@emmanuelinnocent45052 жыл бұрын
For this case I think there will be no problem if you use the blocking assignment. That is it'll be the same result with the non-blocking. This is because the if-else statement has already created priority. Since it is only one expression of the if-else statement that is expected to evaluate to true, then it does not matter if assignment takes place immediately(as in blocking) or if it takes place at the end of the procedural block (as in non-blocking). Please let me know if this answers your question.
@avinasha2377 ай бұрын
Always is checking posedge or negedge of clock. But clock generation code is not written. clk1 =~clk1 clk2 = ~clk2
@arghya.70985 ай бұрын
ig the testbench program takes care of clk generation. correct me if i'm wrong.