WEBVTT

1
00:00:00.000 --> 00:00:04.600
In the last lesson, we read the same bits
in different ways.

2
00:00:05.520 --> 00:00:07.980
Now a collector has two questions.

3
00:00:08.780 --> 00:00:10.260
Is the channel enabled?

4
00:00:11.060 --> 00:00:13.620
Does the format match the legal code?

5
00:00:14.580 --> 00:00:18.740
The collector accepts data only when both
answers are yes.

6
00:00:19.535 --> 00:00:23.775
Each condition has two values, so we have
four rows.

7
00:00:24.755 --> 00:00:26.835
A disabled channel cannot pass.

8
00:00:27.615 --> 00:00:31.035
An enabled channel with a bad format also
fails.

9
00:00:31.775 --> 00:00:33.715
Only the last row passes.

10
00:00:34.595 --> 00:00:41.215
AND needs both, OR needs at least one, and
NOT flips one condition.

11
00:00:41.670 --> 00:00:47.510
Put zero zero one zero above zero one zero
zero.

12
00:00:48.130 --> 00:00:51.430
The first one is in the second column from
the right.

13
00:00:52.190 --> 00:00:53.530
The other is in the third.

14
00:00:54.310 --> 00:01:00.210
No column has a pair of ones, so bitwise
AND returns four zero bits.

15
00:01:00.720 --> 00:01:04.580
Keep the same vectors and use the double
ampersand.

16
00:01:05.240 --> 00:01:09.560
Logical AND asks whether each whole vector
is true.

17
00:01:10.240 --> 00:01:13.663
A known binary vector is true if it is
nonzero.

18
00:01:13.880 --> 00:01:18.320
Both pass that check, so the result is one
bit with value one.

19
00:01:19.180 --> 00:01:22.460
Use zero zero one zero again.

20
00:01:23.360 --> 00:01:28.100
A tilde flips each position and gives one
one zero one.

21
00:01:28.760 --> 00:01:30.200
The width stays four.

22
00:01:31.400 --> 00:01:37.140
An exclamation mark sees a true condition
and returns false, a one-bit zero.

23
00:01:37.840 --> 00:01:40.680
Look at the result width before using it.

24
00:01:41.310 --> 00:01:44.570
Only zero zero one zero is legal.

25
00:01:45.210 --> 00:01:48.150
Compare the whole format field with this
constant.

26
00:01:48.530 --> 00:01:51.410
Then combine the result with the channel
enable.

27
00:01:52.250 --> 00:01:56.710
A range would need lower and upper
comparisons with explicit endpoints.

28
00:01:57.310 --> 00:01:59.310
This design accepts one code.

29
00:01:59.760 --> 00:02:03.200
Replace the one on the left with X.

30
00:02:04.040 --> 00:02:09.740
The other bits give us no known mismatch,
so ordinary equality returns X.

31
00:02:10.660 --> 00:02:14.760
Case equality compares states exactly and
returns zero.

32
00:02:15.540 --> 00:02:21.140
Case inequality returns one, so a test can
catch an unknown output.

33
00:02:21.620 --> 00:02:24.740
Now XOR the four data bits.

34
00:02:25.540 --> 00:02:27.900
A zero leaves the running result alone.

35
00:02:28.620 --> 00:02:29.860
A one flips it.

36
00:02:31.020 --> 00:02:37.260
Zero zero one zero contains one set bit,
so the reduction gives one.

37
00:02:38.240 --> 00:02:44.640
With the parity bit appended, the whole
group has two ones, an even count.

38
00:02:45.305 --> 00:02:49.660
XOR the received data with the original
parity bit.

39
00:02:50.540 --> 00:02:52.820
The intact group gives zero.

40
00:02:53.680 --> 00:02:59.040
One flip changes the data to zero zero one
one and gives one.

41
00:02:59.940 --> 00:03:04.560
Two flips give zero one zero zero,
restoring

42
00:03:04.560 --> 00:03:08.240
a zero syndrome even though the data
changed.

43
00:03:08.930 --> 00:03:12.770
Replace exact equality with a nonzero
check.

44
00:03:13.630 --> 00:03:17.150
The legal code still passes and zero still
fails.

45
00:03:18.130 --> 00:03:19.830
That test pair misses the bug.

46
00:03:20.690 --> 00:03:24.010
Add zero one zero zero and all ones.

47
00:03:24.590 --> 00:03:25.590
Both slip through.

48
00:03:26.450 --> 00:03:31.210
With enable high, the mutant lets fourteen
illegal codes pass.

49
00:03:31.920 --> 00:03:37.380
For format checking, pair both enable
values with all sixteen codes.

50
00:03:38.220 --> 00:03:42.180
For parity, count the ones in each of
sixteen inputs.

51
00:03:43.120 --> 00:03:46.860
Build the expected results from the
requirement and your own calculation.

52
00:03:47.760 --> 00:03:51.000
Next we use a decision to select a data
path.

