We can use initial in module by knowing it's use. Initial will execute only once. And here we are storing data in memory so no need of always block. The thing is we can't use always block in testbench.
tell me the reason why shouldn't we consider, it because mem[i]'s are unpacked part selected bits, such that we shouldn't use the "continuous assignment" for those LHS="reg data_type" and RHS has value in binary formate we should use it, that's why with the use of procedural block and blocking statements we can write the mem[addr]=value;
When instantiating a memory module in a testbench, we may want that memory module to initially have stored certain values. Hence, for this to be the case each time we instantiate a memory module, we can initialize the memory locations using an initial block in the module.
At 25:42 you have written read which is not defined.
He even did not define data which is inside for loop
eg:4 of ram3 we do not declare any signal like read, why should we consider that "read_signal" in the ram_test,,why?????
I believe it's just a typo and it can be ignored. Earlier, prof said if write = 1, we write and if write = 0, we read.
is the code given at the end correct?
At 5:48 how can we use initial block inside a module...we can use initial block under test benches only I guess...
We can use initial in module by knowing it's use. Initial will execute only once. And here we are storing data in memory so no need of always block. The thing is we can't use always block in testbench.
tell me the reason why shouldn't we consider, it because mem[i]'s are unpacked part selected bits, such that we shouldn't use the "continuous assignment" for those LHS="reg data_type" and RHS has value in binary formate we should use it, that's why with the use of procedural block and blocking statements we can write the mem[addr]=value;
When instantiating a memory module in a testbench, we may want that memory module to initially have stored certain values. Hence, for this to be the case each time we instantiate a memory module, we can initialize the memory locations using an initial block in the module.
@@pratikpawar5842 In pretty much all synchronous circuits, the testbench uses an always block for the clock?
module ram_test;
reg [9:0] address;
wire [7:0] data_out;
reg [7:0] data_in;
reg write, select;
integer k, myseed;
// Correct module instantiation
ram2 RAM(data_in,data_out, select, write, address);
initial begin
myseed = 35; // Move this inside the initial block
// Writing to memory
for (k = 0; k
I love you prof
thank you for videos sir