Checker : Legal and Illegal Conditions

5 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$39.95
List Price:  $149.95
You save:  $110
₹1,480
List Price:  ₹9,995
You save:  ₹8,515
€37.39
List Price:  €140.35
You save:  €102.95
£32.14
List Price:  £120.65
You save:  £88.51
CA$54.66
List Price:  CA$205.17
You save:  CA$150.51
A$61.46
List Price:  A$230.72
You save:  A$169.25
S$54.37
List Price:  S$204.11
You save:  S$149.73
HK$312.91
List Price:  HK$1,174.51
You save:  HK$861.59
CHF 36.52
List Price:  CHF 137.09
You save:  CHF 100.57
NOK kr437.63
List Price:  NOK kr1,642.62
You save:  NOK kr1,204.99
DKK kr278.85
List Price:  DKK kr1,046.65
You save:  DKK kr767.80
NZ$67.31
List Price:  NZ$252.67
You save:  NZ$185.35
د.إ146.73
List Price:  د.إ550.75
You save:  د.إ404.01
৳4,379.34
List Price:  ৳16,437.61
You save:  ৳12,058.27
RM190.86
List Price:  RM716.38
You save:  RM525.52
₦50,356.97
List Price:  ₦189,011.97
You save:  ₦138,655
₨11,078.47
List Price:  ₨41,582.42
You save:  ₨30,503.94
฿1,479.01
List Price:  ฿5,551.39
You save:  ฿4,072.38
₺1,299.17
List Price:  ₺4,876.37
You save:  ₺3,577.20
B$205.03
List Price:  B$769.58
You save:  B$564.55
R764.52
List Price:  R2,869.60
You save:  R2,105.07
Лв73.13
List Price:  Лв274.49
You save:  Лв201.36
₩54,936.80
List Price:  ₩206,202.11
You save:  ₩151,265.30
₪150.26
List Price:  ₪563.99
You save:  ₪413.73
₱2,300.82
List Price:  ₱8,635.99
You save:  ₱6,335.17
¥6,189.71
List Price:  ¥23,232.72
You save:  ¥17,043.01
MX$678.11
List Price:  MX$2,545.26
You save:  MX$1,867.15
QR144.95
List Price:  QR544.06
You save:  QR399.11
P554.20
List Price:  P2,080.19
You save:  P1,525.98
KSh5,373.27
List Price:  KSh20,168.27
You save:  KSh14,795
E£1,912.60
List Price:  E£7,178.85
You save:  E£5,266.25
ብር2,263.10
List Price:  ብር8,494.41
You save:  ብር6,231.31
Kz33,355.91
List Price:  Kz125,199.50
You save:  Kz91,843.58
CLP$38,100.31
List Price:  CLP$143,007.31
You save:  CLP$104,907
CN¥289.48
List Price:  CN¥1,086.55
You save:  CN¥797.07
RD$2,358.27
List Price:  RD$8,851.64
You save:  RD$6,493.36
DA5,369.66
List Price:  DA20,154.72
You save:  DA14,785.06
FJ$91.61
List Price:  FJ$343.85
You save:  FJ$252.24
Q310.23
List Price:  Q1,164.43
You save:  Q854.20
GY$8,348.16
List Price:  GY$31,334.33
You save:  GY$22,986.17
ISK kr5,619.76
List Price:  ISK kr21,093.46
You save:  ISK kr15,473.70
DH403.24
List Price:  DH1,513.54
You save:  DH1,110.30
L711.11
List Price:  L2,669.11
You save:  L1,958
ден2,300.75
List Price:  ден8,635.74
You save:  ден6,334.98
MOP$322.07
List Price:  MOP$1,208.89
You save:  MOP$886.82
N$764.41
List Price:  N$2,869.17
You save:  N$2,104.76
C$1,463.02
List Price:  C$5,491.39
You save:  C$4,028.36
रु5,322.32
List Price:  रु19,977.02
You save:  रु14,654.70
S/147.05
List Price:  S/551.96
You save:  S/404.90
K151.07
List Price:  K567.06
You save:  K415.98
SAR149.84
List Price:  SAR562.41
You save:  SAR412.57
ZK1,028.45
List Price:  ZK3,860.25
You save:  ZK2,831.79
L186.04
List Price:  L698.31
You save:  L512.27
Kč943.79
List Price:  Kč3,542.47
You save:  Kč2,598.68
Ft14,707.23
List Price:  Ft55,202.73
You save:  Ft40,495.50
SEK kr434.09
List Price:  SEK kr1,629.35
You save:  SEK kr1,195.26
ARS$34,866.52
List Price:  ARS$130,869.47
You save:  ARS$96,002.95
Bs274.66
List Price:  Bs1,030.94
You save:  Bs756.27
COP$155,927.93
List Price:  COP$585,266.43
You save:  COP$429,338.49
₡20,023.88
List Price:  ₡75,158.48
You save:  ₡55,134.59
L981.04
List Price:  L3,682.28
You save:  L2,701.24
₲294,922.92
List Price:  ₲1,106,976.03
You save:  ₲812,053.11
$U1,532.67
List Price:  $U5,752.80
You save:  $U4,220.12
zł161.60
List Price:  zł606.56
You save:  zł444.96
Subscription
$149.95
$39.95
per week
Payment Plan
$149.96
$39.95
per week
4 payments
Already have an account? Log In

Transcript

Hello and welcome to this short lecture on legal and illegal conditions of a checker. So, I have declared a checker for my check. And inside that I have a variable my bit of type bit. Now in the initial block, you would like to assign a value to this variable my bit, but that is illegal. Now, that seems like a real limitation. But there are ways around it.

And one of the ways that you can assign a value directly during the declaration of the variable. So if you say bit my beta equal to one, then that is legal. But what if you want to have some kind of a complex condition here, some addition, subtraction, or shift operation or something like that, you cannot do that directly in the initial block. So there is a way around it that I'll show you in the next slide. In addition I have to get the same checker here with the same bit my bit. And I'm instantiating my check here, with MC k one being the instance name, I'd like to display my bit from the instance MC k one.

So normally, you would do this if you had a module and everything would be fine. But you cannot hierarchically reference a variable in the instance of a checker. That is illegal. And you can pass declare a formal here and then get an actual during the instantiation. And that is another way that you can access internal base, but that's kind of a workaround, you cannot directly access hierarchical bits or hierarchical references. So as I showed in the previous slide, if you do want to assign up value to a variable inside the initial blog, you can do that we are using a function.

So you can have a function call on the right hand side, and then you can assign whatever value the function returns to your variable. So here what I've done is I have declared a function called return a value, and I'm returning a plus one. So a will be equal to a plus one. But the important thing to note here is that big a, I have not passed it, when I call return a value because it is visible since the function is within the scope of the checker. So that's a good feature. And so this is one way you can assign values to variables in the initial block and then you can have anything complex that you like here or you can do anything you like to go in a function.

This is a very simple point here. I have declared Add my bus to be of type logic a bit wide. And what I'm saying is that at the edge of claw assign one colon zero equal to zero and assign seven colon one equal to one. And you know notice that the big one is overlapping between these two parts selects, that is illegal in a module. This is also from a design point of view illegal button system or one complaint. The if you run a link type to then the Link Type tool will flag this as a violation.

Because you know you probably did that by a typewriter for example. So, if you do not overlap one colon zero and seven colon two, then everything is fine. Meaning you can assign values to parts elects in a checker. This is another finer point. Again, in the checker, my check I have two inputs buss and I bought our four bits wide. Now inside the initial block, I'm saying that bus I bus that uses is an index will be some return value.

This part is the same as what I showed you in the earlier slide. So I'm just returning bus plus one. Now, in my module, my mod, I'm instantiating the checker twice my check am one and here I'm passing two variables data from bus and bus index. Well, these index i cannot be a variable. So you cannot pass a non constant value on bus index bus index is the actual for I formal, but you can indeed Pass a constant value on the index. So the rule of thumb is that it is illegal to pass non constant index value to a checker variable which is used on the left hand side of an assignment.

There is another point also that if you insane shit a checker meaning let's say you want to create multiple checkers from a loop, then the loop index cannot be used as actual for the checker variable. So that's another thing that you may miss. And hopefully this clarifies it. So that's all very short and sweet lecture. Hopefully it's of help to you. Thank you.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.