1
00:00:01,290 --> 00:00:07,410
In this lecture, I will explain how to describe the simple calculator project in Etchells to be synthesized

2
00:00:07,410 --> 00:00:08,850
into a combination circa.

3
00:00:11,400 --> 00:00:14,190
Let's first break the project into a couple of functions.

4
00:00:15,630 --> 00:00:19,440
The Atlas project contains two groups of C C++ functions.

5
00:00:20,480 --> 00:00:24,710
The first group is for the design and the second group is testing the design.

6
00:00:26,450 --> 00:00:30,810
The design should contain a top function that encompasses all the design functionality.

7
00:00:31,520 --> 00:00:38,490
There are three subtasks in the design performed operation, extract the results, digits, display

8
00:00:38,510 --> 00:00:39,140
the digits.

9
00:00:39,920 --> 00:00:46,010
Three functions will implement these tasks, the display digits, a function called another function

10
00:00:46,010 --> 00:00:48,290
to obtain the corresponding seven segment code.

11
00:00:49,730 --> 00:00:56,090
The Test match part starts with a C C++ main function, a software implementation of the project provides

12
00:00:56,090 --> 00:01:00,240
a golden model which its outputs should be compared with the design results.

13
00:01:00,740 --> 00:01:05,390
The main function should generate the input vectors and upload them to the design and the golden model

14
00:01:05,990 --> 00:01:07,940
and then compare the results and reports.

15
00:01:07,940 --> 00:01:08,810
Any discrepancy.

16
00:01:11,040 --> 00:01:17,220
Before describing the design functionality, it is better to define a few arbitrary precision data types.

17
00:01:19,160 --> 00:01:25,480
We also need to declare a constant Arry to keep the seven segments code from digit zero to EF.

18
00:01:28,510 --> 00:01:34,540
In addition, we need this segment code for the minus sign and when all the segments are off.

19
00:01:37,240 --> 00:01:42,880
They're designed to function Recife's five inputs and generates three outputs, the inputs are declared

20
00:01:42,880 --> 00:01:48,210
as called Waverly Arguments and outputs are defined as Coleby reference arguments.

21
00:01:48,700 --> 00:01:52,180
These inputs and output arguments model the hardware parts.

22
00:01:54,690 --> 00:02:01,230
As mentioned before, the design top function called three functions to perform three tasks, the first

23
00:02:01,230 --> 00:02:08,510
one is called Operations, which needs to input numbers along with operation code and generates a result.

24
00:02:09,240 --> 00:02:15,240
The second one, called Extract Digits, receives the result of the previous function and generous four

25
00:02:15,240 --> 00:02:17,580
digits to be shown on seven segments.

26
00:02:18,660 --> 00:02:23,010
The last function that is displayed digits shows the digits and seven segments.

27
00:02:24,020 --> 00:02:29,660
You also show all the input data generated by the slide switches, and these are available on the board.

28
00:02:31,840 --> 00:02:38,410
The operations function uses a switch case statement to select and perform one of the operations based

29
00:02:38,410 --> 00:02:39,460
on the code value.

30
00:02:53,190 --> 00:02:59,370
That selected its function, receives the result of the operations function, detects the result sinus

31
00:02:59,880 --> 00:03:01,650
and extracts its three digits.

32
00:03:03,170 --> 00:03:10,400
Firstly, it checks the result value and if it's negative, since the variable sign and then negate

33
00:03:10,400 --> 00:03:17,060
the results ready for extracting its digits, then based on the display, it uses two different methods

34
00:03:17,060 --> 00:03:18,190
to extract the digits.

35
00:03:18,710 --> 00:03:24,490
If the display mode is decimal, then the division by ten operator is used to exact the digits.

36
00:03:24,860 --> 00:03:29,000
If the display mode is hex, then every four bits constitute a digit.

37
00:03:31,130 --> 00:03:38,120
They display the dysfunction, call a segment digit code function to get the segment display code corresponding

38
00:03:38,120 --> 00:03:43,610
to each digit and then based on the press push button turns on a seven segment.

39
00:03:56,110 --> 00:04:02,170
The salmon segment digit code function utilizers to each case statement to retrieve a desired salmon

40
00:04:02,170 --> 00:04:04,960
segment code from the Salmon segment code ARRY.

41
00:04:10,950 --> 00:04:16,770
Now, let's explain the test punch code, which would start with the C C++ main function, as mentioned

42
00:04:16,770 --> 00:04:22,560
along the course, the main function defines the status variable to return the test bench success status.

43
00:04:29,010 --> 00:04:34,200
It utilizes five nested loops to generate all the possible inputs for the system.

44
00:04:37,110 --> 00:04:39,720
Then prepare the designs to function arguments.

45
00:04:41,610 --> 00:04:47,640
Finally, it applies the data recorders to the design function and the software implementation, then

46
00:04:47,640 --> 00:04:49,830
reports any differences in the results.

47
00:04:54,050 --> 00:05:00,260
After explaining the system functions, we should put all the courts together in a rather Atlas project

48
00:05:00,710 --> 00:05:03,570
and program our FPGA and play with the calculator.

49
00:05:04,460 --> 00:05:06,170
This would be the goal of the next lecture.
