1
00:00:01,350 --> 00:00:05,770
How can we generate a single cycle, regular pulses with a given period?

2
00:00:06,540 --> 00:00:08,660
This lecture will cope with this question.

3
00:00:11,840 --> 00:00:19,500
The single cycle regular generator receives a clock with the period of and generates another clock with

4
00:00:19,500 --> 00:00:25,160
the period of TP in which the high state is only one cycle of the input clock.

5
00:00:27,660 --> 00:00:33,750
And denotes the number of design or input clock cycles that fits in a period of the output clock.

6
00:00:34,590 --> 00:00:42,190
And it can be calculated by dividing the TPE to take the output signal should be in the high level voltage

7
00:00:42,210 --> 00:00:43,400
for one clock cycle.

8
00:00:45,740 --> 00:00:49,910
And it should be in the low level voltage for N minus one clock cycles.

9
00:00:55,180 --> 00:01:02,830
Let's write the code, we assume there are 20 clock cycles in the output pulse part that is and is 20.

10
00:01:05,000 --> 00:01:11,570
The circuit has two states, zero and one corresponding to the output clock logic values, the design

11
00:01:11,690 --> 00:01:18,500
of function has one argument, which is the output node, that the design clock will be added to the

12
00:01:18,500 --> 00:01:20,240
circuit by their is to.

13
00:01:21,860 --> 00:01:23,650
We should add port interfaces.

14
00:01:24,560 --> 00:01:29,720
Now we need a static variable synthesized into a register to save a design state.

15
00:01:30,830 --> 00:01:37,520
Also, we did a static variable to count the number of input clock cycles, according to our coding

16
00:01:37,520 --> 00:01:39,960
style, describing a state machine.

17
00:01:40,310 --> 00:01:45,890
We need a temporary variable corresponding to each register that keeps track of intermediate values

18
00:01:46,040 --> 00:01:48,550
for registers throughout the state machine.

19
00:01:51,950 --> 00:01:55,850
Similarly, we define a temporary variable for the output.

20
00:01:57,020 --> 00:02:03,740
Now we should describe our state machine and after that, the registers and the output ports should

21
00:02:03,740 --> 00:02:04,460
be updated.

22
00:02:05,750 --> 00:02:13,190
The state machine has two states, the second should be and minus one clock cycles in the 08 state and

23
00:02:13,190 --> 00:02:21,170
only one caucus cycle in the state as can be seen, the 08 state starts the counter from polls underscore

24
00:02:21,170 --> 00:02:28,160
period minus one and decrements that on each clock cycle, when the counter is one, the state machine

25
00:02:28,310 --> 00:02:31,160
goes to state one to spend one clock cycle.

26
00:02:31,730 --> 00:02:34,280
Then it goes back to the zero state.

27
00:02:35,680 --> 00:02:37,780
Let's check the design, invite Satchel's.

28
00:02:41,900 --> 00:02:48,200
Create a new White House project with the name of single underscore cycle, underscore, regular, underscore

29
00:02:48,200 --> 00:02:50,060
Pulsers Dash Wiki suchness.

30
00:02:54,620 --> 00:02:56,810
Choose the basis three as a target of.

31
00:03:01,660 --> 00:03:07,300
Download the design and test bench fines from the resources attached to this lecture and add them to

32
00:03:07,300 --> 00:03:08,020
the project's.

33
00:03:29,580 --> 00:03:34,630
Now, let's have a look at the coats we saw the design Sourcefire earlier in this lecture.

34
00:03:43,700 --> 00:03:51,230
The test bench phone calls are designed to function 100 times and print the output argument on the screen

35
00:03:51,230 --> 00:03:51,740
each time.

36
00:03:55,810 --> 00:03:57,970
Now we can perform the simulation.

37
00:04:02,560 --> 00:04:09,760
Know that our design follows a single cycle design approach, the result shows that the output signal

38
00:04:09,760 --> 00:04:15,200
is zero for 19 clock cycles and is one for one clock cycle on each part.

39
00:04:16,280 --> 00:04:22,820
By synthesizing our code, we can make sure that the result of the article description is a single cycle

40
00:04:22,820 --> 00:04:24,470
designed for this purpose.

41
00:04:24,770 --> 00:04:27,280
Please have a look at the analysis perspective.

42
00:04:43,810 --> 00:04:46,750
Now, let's part on the R TLC simulation.

43
00:04:47,320 --> 00:04:51,060
Don't forget to select the all option in the dumped race feature.

44
00:04:55,790 --> 00:05:00,020
After finishing the simulation process, click on The Open Viewer.

45
00:05:05,980 --> 00:05:09,940
So the design out to Don Clark signals in the event of a viewer.

46
00:05:11,000 --> 00:05:13,550
And check the output signal, period and pulse.

47
00:05:48,620 --> 00:05:53,150
How to detect edges on an input signal, the next lecture will answer this question.

48
00:05:54,740 --> 00:06:01,570
This is our takeaway message, using a counter can help in some designs to determine the number of clock

49
00:06:01,580 --> 00:06:05,120
cycles that a state machine should stay in each state.

50
00:06:07,760 --> 00:06:14,630
Now, the quiz question modified the code in a single cycle, regular pulses, top function and generate

51
00:06:14,630 --> 00:06:15,890
the following signal.
