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
€34.07
List Price:  €127.88
You save:  €93.81
£29.52
List Price:  £110.82
You save:  £81.29
CA$55.15
List Price:  CA$207.02
You save:  CA$151.87
A$60.65
List Price:  A$227.65
You save:  A$166.99
S$51.30
List Price:  S$192.58
You save:  S$141.27
HK$311.36
List Price:  HK$1,168.68
You save:  HK$857.31
CHF 31.77
List Price:  CHF 119.26
You save:  CHF 87.49
NOK kr398.75
List Price:  NOK kr1,496.69
You save:  NOK kr1,097.93
DKK kr254.36
List Price:  DKK kr954.72
You save:  DKK kr700.36
NZ$67.35
List Price:  NZ$252.83
You save:  NZ$185.47
د.إ146.71
List Price:  د.إ550.69
You save:  د.إ403.97
৳4,852.37
List Price:  ৳18,213.10
You save:  ৳13,360.73
RM168.55
List Price:  RM632.65
You save:  RM464.10
₦60,610.54
List Price:  ₦227,498.14
You save:  ₦166,887.60
₨11,313.88
List Price:  ₨42,466.02
You save:  ₨31,152.13
฿1,269.81
List Price:  ฿4,766.16
You save:  ฿3,496.35
₺1,648.57
List Price:  ₺6,187.83
You save:  ₺4,539.26
B$216.15
List Price:  B$811.33
You save:  B$595.17
R701.51
List Price:  R2,633.07
You save:  R1,931.56
Лв66.63
List Price:  Лв250.11
You save:  Лв183.48
₩55,513.10
List Price:  ₩208,365.21
You save:  ₩152,852.10
₪132.84
List Price:  ₪498.61
You save:  ₪365.77
₱2,268.56
List Price:  ₱8,514.91
You save:  ₱6,246.34
¥5,904.71
List Price:  ¥22,162.99
You save:  ¥16,258.28
MX$746.38
List Price:  MX$2,801.51
You save:  MX$2,055.13
QR145.52
List Price:  QR546.20
You save:  QR400.68
P536.05
List Price:  P2,012.03
You save:  P1,475.98
KSh5,159.54
List Price:  KSh19,366.04
You save:  KSh14,206.50
E£1,927.38
List Price:  E£7,234.33
You save:  E£5,306.95
ብር5,703.46
List Price:  ብር21,407.62
You save:  ብር15,704.16
Kz36,432.60
List Price:  Kz136,747.65
You save:  Kz100,315.05
CLP$38,413.46
List Price:  CLP$144,182.69
You save:  CLP$105,769.23
CN¥284.85
List Price:  CN¥1,069.18
You save:  CN¥784.33
RD$2,521.53
List Price:  RD$9,464.43
You save:  RD$6,942.90
DA5,180.06
List Price:  DA19,443.07
You save:  DA14,263
FJ$89.99
List Price:  FJ$337.80
You save:  FJ$247.80
Q305.59
List Price:  Q1,147.02
You save:  Q841.43
GY$8,336.25
List Price:  GY$31,289.63
You save:  GY$22,953.38
ISK kr4,871.90
List Price:  ISK kr18,286.40
You save:  ISK kr13,414.50
DH362.32
List Price:  DH1,359.95
You save:  DH997.63
L667.17
List Price:  L2,504.18
You save:  L1,837.01
ден2,098.16
List Price:  ден7,875.33
You save:  ден5,777.17
MOP$320.43
List Price:  MOP$1,202.75
You save:  MOP$882.31
N$704.83
List Price:  N$2,645.56
You save:  N$1,940.72
C$1,467.40
List Price:  C$5,507.81
You save:  C$4,040.41
रु5,630.72
List Price:  रु21,134.59
You save:  रु15,503.87
S/140.44
List Price:  S/527.14
You save:  S/386.69
K166.41
List Price:  K624.64
You save:  K458.22
SAR149.89
List Price:  SAR562.62
You save:  SAR412.72
ZK951.92
List Price:  ZK3,573
You save:  ZK2,621.07
L172.78
List Price:  L648.54
You save:  L475.76
Kč830.14
List Price:  Kč3,115.89
You save:  Kč2,285.75
Ft13,406.50
List Price:  Ft50,320.54
You save:  Ft36,914.04
SEK kr374.64
List Price:  SEK kr1,406.19
You save:  SEK kr1,031.55
ARS$54,535.08
List Price:  ARS$204,694.24
You save:  ARS$150,159.16
Bs275.33
List Price:  Bs1,033.43
You save:  Bs758.10
COP$158,843.04
List Price:  COP$596,208.14
You save:  COP$437,365.09
₡20,202.31
List Price:  ₡75,828.19
You save:  ₡55,625.88
L1,044.62
List Price:  L3,920.94
You save:  L2,876.31
₲287,381.56
List Price:  ₲1,078,669.98
You save:  ₲791,288.42
$U1,604.02
List Price:  $U6,020.60
You save:  $U4,416.58
zł144.90
List Price:  zł543.87
You save:  zł398.97
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.