1
00:00:01,170 --> 00:00:07,020
On several occasions, we should use a single clock cycle pulse to start an event or report the end

2
00:00:07,020 --> 00:00:13,110
of an event, this lecture will explain how to generate the single cycle pulse in each of us.

3
00:00:15,560 --> 00:00:22,130
A single psychopath generates a circuit, has an input and an output, it generates a one clock cycle

4
00:00:22,130 --> 00:00:26,670
with pulse on its output when it detects a rising signal on its input.

5
00:00:27,770 --> 00:00:30,650
Let's consider a clock signal and a white with pulse.

6
00:00:30,890 --> 00:00:34,520
Then as shown in this figure, the output should be a single cycle.

7
00:00:34,520 --> 00:00:35,510
Narrow pulse.

8
00:00:37,660 --> 00:00:44,500
The proposed path generates a circuit, has two estates, wait for one and wait for the wait for one

9
00:00:44,500 --> 00:00:49,900
state is the initial estate during which the input carries the logic value zero.

10
00:00:50,170 --> 00:00:55,900
In this estate, the circuit is waiting for a high voltage level on the input signal.

11
00:00:56,920 --> 00:01:03,250
The wait for zero state is when the input signal carries the logic value one during this to say the

12
00:01:03,250 --> 00:01:06,870
circuit is waiting for a low level voltage on the input signal.

13
00:01:08,640 --> 00:01:14,310
As soon as the circuit detects the one logic value on the input when it is in the wait for one state,

14
00:01:14,640 --> 00:01:16,680
it goes to the wait for zero state.

15
00:01:17,730 --> 00:01:23,460
And assigns the lodging value one to the output, in other cases, the output is zero.

16
00:01:23,670 --> 00:01:28,200
This results in a single cycle, positive pulse on the output.

17
00:01:31,250 --> 00:01:37,900
The design detects a rising edge on the input signal when it is in the wait for one state and the logic

18
00:01:37,940 --> 00:01:40,880
value of one is detected on the input signal.

19
00:01:41,270 --> 00:01:47,450
In this case, it assigns the logical value of one to the output signal and goes to the wait for zero

20
00:01:47,450 --> 00:01:47,860
state.

21
00:01:48,400 --> 00:01:52,970
It goes back to the wait for one state when the input changes to zero.

22
00:01:53,880 --> 00:01:56,460
OK, let's ascribe the design and each of us.

23
00:01:57,090 --> 00:02:01,740
We need a function that receives the one bit input and returns at one bit output.

24
00:02:03,460 --> 00:02:10,180
We can define a static variable to represent the design state, we need to temporary variables, one

25
00:02:10,180 --> 00:02:12,990
for the state and the other for the output.

26
00:02:13,900 --> 00:02:16,900
Then we need a state machine with two states.

27
00:02:17,290 --> 00:02:20,560
After that, the state and output should be modified.

28
00:02:21,910 --> 00:02:28,360
The second, the texturizing edge on the input signal, if it is in the W one or wait for one state

29
00:02:28,780 --> 00:02:30,250
and the input signal is one.

30
00:02:31,480 --> 00:02:38,290
In this case, it goes to the W zero or right four zero state and puts a logging value one on the output

31
00:02:38,290 --> 00:02:38,710
signal.

32
00:02:39,460 --> 00:02:46,000
If the circuit is in the W zero state and the input is also one, the second stays in that state.

33
00:02:46,480 --> 00:02:51,520
It goes to the W one state as soon as it receives a zero on its input.

34
00:02:56,670 --> 00:03:02,810
Now, let's simulate and synthesize the code corrida with a socialist project and add design and test

35
00:03:03,030 --> 00:03:06,360
fires to the project, you can find the files attached to this lecture.

36
00:03:16,460 --> 00:03:21,560
How we look at it has been Sourcefire, it consists of three times the first and last loops, put the

37
00:03:21,560 --> 00:03:26,330
logic value zero on the design function input argument for five cycles.

38
00:03:26,540 --> 00:03:32,690
And then we drill for loop puts a logic value one on the design input argument for five cycles.

39
00:03:32,870 --> 00:03:36,920
Therefore, it generates a five clock cycle pulse on the design input.

40
00:03:39,230 --> 00:03:40,610
Now, let's simulate the design.

41
00:03:55,230 --> 00:03:58,390
Down to chose the appearance of a single psychopath's on the.

42
00:04:04,500 --> 00:04:10,120
We can then synthesize the code and make sure our description is synthesized into a single cycle article

43
00:04:10,140 --> 00:04:10,530
code.

44
00:04:38,130 --> 00:04:42,120
Then run the article CECO Simulation and check the waveforms.

45
00:05:39,670 --> 00:05:42,440
We have generated a single cycle pulse in this lecture.

46
00:05:42,940 --> 00:05:48,390
The question is, how can we generate a regular single cycle pulse with a constant period?

47
00:05:48,910 --> 00:05:50,910
The next lecture will cope with this question.

48
00:05:54,710 --> 00:05:59,870
This is our takeaway message to the state machine can be used to detect an edge on a signal.

49
00:06:02,270 --> 00:06:08,150
Now, the quiz question modified the pulse generator code such that the outward pulse is generated on

50
00:06:08,150 --> 00:06:09,950
the following edge on the input signal.
