1
00:00:03,440 --> 00:00:09,530
FPGA boards usually provide the high speed clock signal, however, in some designs, we need a slower

2
00:00:09,530 --> 00:00:10,210
clock signal.

3
00:00:11,350 --> 00:00:16,740
Now, the question is, how can we generate this lower class signal based on the highest bidder bid

4
00:00:16,740 --> 00:00:19,900
FPGA O'Rourke, this section will answer this question.

5
00:00:23,040 --> 00:00:29,580
The idea of generating a slower clock with a frequency of slow from a fast clock with the frequency

6
00:00:29,580 --> 00:00:32,760
of fast is using a clock division circuit.

7
00:00:33,180 --> 00:00:40,400
Therefore, if the design clock frequency is a fast, then we can divide the frequency by 10 to generate.

8
00:00:41,640 --> 00:00:49,410
For example, if fast is one hundred megahertz and is 1000, then flow is hundred kilohertz.

9
00:00:50,690 --> 00:00:56,900
This diagram shows the relation between the design signal and the output of the clock generate or clock

10
00:00:56,900 --> 00:00:57,260
during.

11
00:00:59,250 --> 00:01:07,050
As can be seen, the output signal has to logic levels zero and one, our circuit also has two states

12
00:01:07,170 --> 00:01:13,740
corresponding to these logic levels the circuit, the states in each state four and divide by two clock

13
00:01:13,740 --> 00:01:16,740
cycles and then goes to the next state.

14
00:01:19,590 --> 00:01:27,150
Now, let's try the code for a generator circuit that generates five megahertz signal from 100 megahertz

15
00:01:27,300 --> 00:01:28,200
design clock.

16
00:01:30,060 --> 00:01:35,820
In this case, and is one hundred divided by five, which means 20.

17
00:01:38,350 --> 00:01:46,030
The of the designed clock is 10, 10:00, therefore, the period of the generated clock would be 200

18
00:01:46,030 --> 00:01:46,750
nanoseconds.

19
00:01:48,680 --> 00:01:53,900
The clerk's duty cycle is 50 percent, if it is in the logic level, one half of it's.

20
00:02:01,000 --> 00:02:07,600
For writing the actual code, create a new White House project with the name of Klok underscore generator

21
00:02:07,600 --> 00:02:12,510
dash want to select the clock underscored generator as a design top function.

22
00:02:13,330 --> 00:02:17,140
Don't forget to choose the basic storyboard as a target FPGA.

23
00:02:26,920 --> 00:02:33,940
And the design source folder create a design source and Heather Fart's also create the test bench in

24
00:02:33,940 --> 00:02:34,790
the test bench for.

25
00:02:57,090 --> 00:03:03,240
Upon the design, Sourcefire and defined the clock, underscore frequency, underscore deviser, macro

26
00:03:03,840 --> 00:03:09,210
and enumeration data type that contains the circuit states which are zero and bar.

27
00:03:10,130 --> 00:03:15,380
The design to function has only one output argument let's define the interfaces now.

28
00:03:16,700 --> 00:03:21,950
We should define a register to represent the sum of the states, let's initialize that with zeal.

29
00:03:22,970 --> 00:03:29,450
We also need to register with the name of counter that keeps track of clock cycles, and its initial

30
00:03:29,450 --> 00:03:33,050
value is one less than half of the clock frequency devi's.

31
00:03:34,710 --> 00:03:40,380
Following our single cycle design flaw, we should define two temporary variables to keep the counter

32
00:03:40,380 --> 00:03:43,620
and the state's intermediate values in the circuit state machine.

33
00:03:44,250 --> 00:03:48,300
Also, we need a temporary variable corresponding to the output argument.

34
00:03:49,170 --> 00:03:54,300
Now we can use a two state state machine to describe the behavior of the circuit.

35
00:03:55,200 --> 00:04:01,440
The state represents the time that the output is zero and the one state represents the time that the

36
00:04:01,440 --> 00:04:02,340
output is one.

37
00:04:03,570 --> 00:04:09,780
The country states half of its period in each state, the county register helps to keep track of the

38
00:04:09,780 --> 00:04:11,640
number of cycles in each state.

39
00:04:13,400 --> 00:04:19,280
When the circuit is in zero state, it decrements the counter on each clock cycle and when the counter

40
00:04:19,280 --> 00:04:25,010
gets to zero, the circuit goes to state one while the counter is set to one less than the half of the

41
00:04:25,010 --> 00:04:25,940
counter frequency.

42
00:04:26,330 --> 00:04:26,870
The value.

43
00:04:28,180 --> 00:04:31,180
The same behavior happens when the circuit is in a state one.

44
00:04:33,360 --> 00:04:37,230
After the state machine, we should modify the registers and update the.

45
00:04:40,610 --> 00:04:42,560
Now, let's try to test code.

46
00:04:43,670 --> 00:04:47,330
OpenNet has been shattered by another design, top function prototype.

47
00:04:48,980 --> 00:04:55,580
As we use the circuit for generating the output clock signal, the test bench file only calls the design

48
00:04:55,760 --> 00:04:56,960
one hundred times.

49
00:05:02,300 --> 00:05:04,160
Now we can perform the simulation.

50
00:05:10,150 --> 00:05:15,700
Downwith, printed on the screen, shows that the second output is ten times one and 10 times zero.

51
00:05:16,240 --> 00:05:21,130
This means the frequency of the output is one twentieth of the designed frequency.

52
00:05:24,130 --> 00:05:30,250
Now perform the high level syntheses task and check that the description is synthesized into a single

53
00:05:30,250 --> 00:05:31,570
cycle RTL code.

54
00:05:57,710 --> 00:06:03,680
After finishing the sentence, he successfully performed the archaeological simulation and selling all

55
00:06:03,680 --> 00:06:04,870
for the country's future.

56
00:06:09,930 --> 00:06:12,030
Now click on the Open Viewer IRC.

57
00:06:13,170 --> 00:06:15,320
Delivered away from the air will be opened.

58
00:06:17,390 --> 00:06:20,400
Showed the second output signal and Checketts Pariente.

59
00:07:12,780 --> 00:07:18,540
For triggering some circuits, we usually need a single cycle pulse, how can we generate a single cycle

60
00:07:18,540 --> 00:07:20,760
pulse in the next lecture?

61
00:07:20,790 --> 00:07:21,840
We'll address this question.

62
00:07:25,690 --> 00:07:30,430
This is our takeaway message, using a collective either circuit, the kind of scale, the designed

63
00:07:30,430 --> 00:07:32,830
frequency to generate a slower clock.

64
00:07:37,470 --> 00:07:42,570
Now, the quiz question, if you check the revised away form carefully, you can see that the recent

65
00:07:42,570 --> 00:07:48,930
signal doesn't have any impact on the circuit act, modify the project setting to reset the circuit

66
00:07:48,930 --> 00:07:51,000
output with the designers that signal.
