at 10:24 , Sir u have said XX can be 1X, 0X, X0. So according to it when a=0X then b should be equal to 1 instead of 0 ?
@ComponentByte Жыл бұрын
For casex When a=0X b=0 When a=XX b=1
@abhilash29130 Жыл бұрын
As u have said in 1st example of casex, 2'b1X = 2'b10, 2'b11, 2'b1X, 2'b1Z and 1 should be fix and X should change So, why in testbench code in casex 2'b1X as, a=XX is taken? Will here 1 is not fixed ? [I mean how XX is inside casex ?] Please clarify..
@ComponentByte Жыл бұрын
Xx can be 1x,0x,x1,x0,00,01,10,11 and few others for casex only and not case. So when a=xx it results b=1 as here xx can be 1x also
@abhilash29130 Жыл бұрын
Sir then why, When a=0X b=0 It should be b=1 right ? I am bit confused in this!! Please clarify..
@ComponentByte Жыл бұрын
When a=0X Here second bit is fixed that is 0 and can't be changed and 1st bit is X so can be 0,1,Z So 0x can't be 1x For 1X , we get b=1 for 10,11,1x,1z and for rest we get 0
@ujwalkumarbcj936210 ай бұрын
Hi sir, at 10:25 you took case expression as 2'bxx (i.e a = 2'bxx) and we have case item as 2'b1x, you said that it will match the case statement, so the b became 1. When I tried from my side for the below code I am getting Matched for case items: 00 ,01,0x,0z,x0,x1,xz,xx,z0,z1,zx,zz Not Matched for case items: 10,11,1x,1z module tb; reg [0:0] a=2'bxx,b; initial begin casex(a) 2'b1x: $display("Matched"); default: $display("Not Matched"); endcase end endmodule my doubt is as we are giving case expression as 2'bxx , then it should match the case items (10,11,1x,1z also). But here it is not happening. Could you please give me clarification regarding this?
@ujwalkumarbcj936210 ай бұрын
It’s now resolved sir, I did a mistake while declaring varibales it should be reg [1:0] a,b; Now for all the values i am getting b = 1 . Thank you for the explanation sir
@jitubaba54504 жыл бұрын
Thank you for sharing. Always love learning your verilog tutorial.
@circuitsanalytica43483 жыл бұрын
Yes Jitu, really nice videos.....
@teketinikhilkumar79052 жыл бұрын
sir In 1st example , given encoding =10xz it can be 101z right so in the third case(xx1x = 101z) so cant we write next state=1
@ComponentByte2 жыл бұрын
It's decided by simulator. If input=10xz then simulator will first check 1st case : if it matches then it will give 1st case output, if no matches it will go to next state. Thus 10xz matches 1st case 1xxx so simulator stops there and gives corresponding output .
@teketinikhilkumar79052 жыл бұрын
@@ComponentByte thank you sir
@rajsambhav6652 жыл бұрын
Great explanation. what if there are multiple ones in the input. e.g for an input encoding = 4'b011x which next state will be executed ?
@ComponentByte2 жыл бұрын
Thank you. It is decided by simulator. 011x equals 0110 and 0111 so next can be 8,9,10.... so 1xxx is enough for 8 to 15
@Deadpie_speaking3 жыл бұрын
Sir in case statement eg. Case( s1, s2) =case(s1, s2) are same ????
@ComponentByte3 жыл бұрын
No.They are different. 'case' is case sensitive(If I have written somewhere then it's just an example and definitely it's not in program)
@muhammedsayedm817410 ай бұрын
In case of casex why xz=zx compilation is not coming
@prasannan20842 жыл бұрын
In casex 2'bzz also possible right?
@ComponentByte2 жыл бұрын
Yes, possible. 2'bzz , here zz is considered as 2 don't care. zz can be 00,01,10,11
@digambarbhole9467 Жыл бұрын
sir, what is the physical significance of caseX and caseZ statements? can you please clear it?
@ComponentByte Жыл бұрын
This is a tool dependent construct means it generates a piece of different hardware as described in a synthesis tool. It generates mostly MUX based hardware.
@digambarbhole9467 Жыл бұрын
Ok thank you sir
@darageorgieva3203 Жыл бұрын
Imagine we are in casex and we have 3'b1xz as in the first slide of the presentation. Aren't the possible options: 3'b1xz, 3'b1zx, 3'b1zz, 3'b1xx, 3'b100, 3'b101, 3'b110 and 3'b111?
@ComponentByte Жыл бұрын
Yes, you are absolutely correct.
@vishal_moladiya_music3 жыл бұрын
Nice explanation: But in the last example When a=xx then I think b=1 and c=1 or 0 in c value I confused because in verilog casex has value of x is 0 1 x and z! But in simulation x take only value of 0 and 1 ? Is this r8?
@ComponentByte3 жыл бұрын
In casex X value can be 0 or 1 and Z value can be 0 or 1. X is 0,1,X Z is 0,1,Z
@hulkmania94872 жыл бұрын
@@ComponentByte so why in starting u have taken 2'b1Z (first example in casex)
@ComponentByte2 жыл бұрын
You mean why 2'b1X = 2'b1Z ? If it's your query then in casex all X and Z can be considered as don't care so X can be 0,1,X,Z So 2'b1x = 2'b10,11,1x,1z Don't care means your output doesn't depend on those input bits. If it's not your query then please let me know.
@hulkmania94872 жыл бұрын
@@ComponentByte cleared 👌
@SebJames553 жыл бұрын
Thank you 😁
@ComponentByte3 жыл бұрын
Happy learning.
@circuitsanalytica43483 жыл бұрын
Yes, really nice video, isn't it....
@shivammahato163 Жыл бұрын
what is casee instl ?
@ComponentByte Жыл бұрын
casee is module name (in module casee() )and inst1 is the name of module instatitaion.it can be any name you wish to write.
@shivammahato163 Жыл бұрын
@@ComponentByte thank you
@sarathchandra53054 жыл бұрын
can you tell me where do we use the casez in real time?
@ComponentByte4 жыл бұрын
It can be used to design multiplexer if resources are available. Casez is used for testing the RTL code. During verification process code coverage is done to test every lines of code to check whether every lines of code is executed with valid input or not. In casez Z means if input is souriously 1 or 0 then the output should not be propagated and must be filtered out. Hope it helps.