WEBVTT

1
00:00:00.000 --> 00:00:02.660
A television starts on channel five.

2
00:00:03.300 --> 00:00:05.720
Press channel up to reach six.

3
00:00:06.320 --> 00:00:08.540
Press again to reach seven.

4
00:00:09.500 --> 00:00:13.040
The same command gives different results
because

5
00:00:13.040 --> 00:00:15.980
the television remembers its current
channel.

6
00:00:16.860 --> 00:00:20.060
A sensor receiver can use stored state,
too.

7
00:00:20.460 --> 00:00:24.520
The sensor produces one result and moves
on to the next.

8
00:00:25.300 --> 00:00:28.800
If the receiver only has a wire, it may

9
00:00:28.800 --> 00:00:31.980
find a newer result by the time it is
ready.

10
00:00:33.080 --> 00:00:37.260
A register keeps a sample taken at an
agreed time.

11
00:00:38.220 --> 00:00:42.520
The receiver can read that saved value
while the input changes.

12
00:00:43.090 --> 00:00:44.670
D is the input.

13
00:00:45.710 --> 00:00:48.110
Q is the retained output.

14
00:00:49.170 --> 00:00:53.230
At twenty five nanoseconds, the rising
edge

15
00:00:53.230 --> 00:00:57.170
samples hexadecimal three C and Q updates.

16
00:00:58.370 --> 00:01:02.950
At twenty seven nanoseconds D changes to
four four.

17
00:01:03.670 --> 00:01:09.470
There is no sampling edge at that instant,
so Q still holds three C.

18
00:01:09.900 --> 00:01:16.140
At thirty five nanoseconds, the input has
changed again and enable is low.

19
00:01:16.980 --> 00:01:18.540
This edge preserves Q.

20
00:01:19.840 --> 00:01:25.540
At forty five nanoseconds a different
input is present, and Q still holds.

21
00:01:26.840 --> 00:01:33.360
At fifty five nanoseconds enable is high,
so the register finally stores seven D.

22
00:01:33.880 --> 00:01:37.160
Before any reset, enable is low.

23
00:01:37.880 --> 00:01:41.640
Q is still unknown in simulation after the
first edge.

24
00:01:42.640 --> 00:01:46.040
At fifteen nanoseconds, reset and enable
are

25
00:01:46.040 --> 00:01:49.340
both asserted, so the register clears to
zero.

26
00:01:50.300 --> 00:01:52.740
The same control combination at sixty five

27
00:01:52.740 --> 00:01:55.620
nanoseconds clears the value it had
stored.

28
00:01:56.050 --> 00:01:59.390
After reset, Q contains zero.

29
00:02:00.170 --> 00:02:05.070
At the following rising edge, reset has
been released, but enable is still low.

30
00:02:05.710 --> 00:02:06.590
Q keeps zero.

31
00:02:07.470 --> 00:02:10.110
At the next rising edge enable is high,

32
00:02:10.630 --> 00:02:14.050
and the register stores the new
hexadecimal D eight.

33
00:02:14.450 --> 00:02:16.790
This block runs on the rising edge.

34
00:02:17.390 --> 00:02:20.950
It checks active low reset first, then
enable.

35
00:02:21.750 --> 00:02:25.150
If neither branch requests a write, Q
keeps its value.

36
00:02:26.150 --> 00:02:29.810
The nonblocking assignment samples the
input at the edge

37
00:02:29.810 --> 00:02:33.670
and schedules the update for later in the
same time step.

38
00:02:35.110 --> 00:02:38.130
Drive the test vectors on falling edges

39
00:02:38.130 --> 00:02:41.150
to keep the drive away from the sampling
edge.

40
00:02:41.910 --> 00:02:44.787
At twenty seven nanoseconds, we
deliberately change

41
00:02:44.787 --> 00:02:48.990
D between rising edges to test whether Q
holds.

42
00:02:49.710 --> 00:02:52.170
Which value did the prior rising edge
save?

43
00:02:52.875 --> 00:02:57.235
Pull synchronous reset low between edges
and keep it low.

44
00:02:57.935 --> 00:03:00.115
The next rising edge clears the register.

45
00:03:01.015 --> 00:03:04.415
An asynchronous reset can clear it between
clock edges.

46
00:03:05.135 --> 00:03:07.715
Its release has timing requirements of its
own.

47
00:03:08.235 --> 00:03:10.135
The lab uses synchronous reset.

