In this lecture, I will explain how to describe the simple calculator project in Etchells to be synthesized
into a combination circa.
Let's first break the project into a couple of functions.
The Atlas project contains two groups of C C++ functions.
The first group is for the design and the second group is testing the design.
The design should contain a top function that encompasses all the design functionality.
There are three subtasks in the design performed operation, extract the results, digits, display
the digits.
Three functions will implement these tasks, the display digits, a function called another function
to obtain the corresponding seven segment code.
The Test match part starts with a C C++ main function, a software implementation of the project provides
a golden model which its outputs should be compared with the design results.
The main function should generate the input vectors and upload them to the design and the golden model
and then compare the results and reports.
Any discrepancy.
Before describing the design functionality, it is better to define a few arbitrary precision data types.
We also need to declare a constant Arry to keep the seven segments code from digit zero to EF.
In addition, we need this segment code for the minus sign and when all the segments are off.
They're designed to function Recife's five inputs and generates three outputs, the inputs are declared
as called Waverly Arguments and outputs are defined as Coleby reference arguments.
These inputs and output arguments model the hardware parts.
As mentioned before, the design top function called three functions to perform three tasks, the first
one is called Operations, which needs to input numbers along with operation code and generates a result.
The second one, called Extract Digits, receives the result of the previous function and generous four
digits to be shown on seven segments.
The last function that is displayed digits shows the digits and seven segments.
You also show all the input data generated by the slide switches, and these are available on the board.
The operations function uses a switch case statement to select and perform one of the operations based
on the code value.
That selected its function, receives the result of the operations function, detects the result sinus
and extracts its three digits.
Firstly, it checks the result value and if it's negative, since the variable sign and then negate
the results ready for extracting its digits, then based on the display, it uses two different methods
to extract the digits.
If the display mode is decimal, then the division by ten operator is used to exact the digits.
If the display mode is hex, then every four bits constitute a digit.
They display the dysfunction, call a segment digit code function to get the segment display code corresponding
to each digit and then based on the press push button turns on a seven segment.
The salmon segment digit code function utilizers to each case statement to retrieve a desired salmon
segment code from the Salmon segment code ARRY.
Now, let's explain the test punch code, which would start with the C C++ main function, as mentioned
along the course, the main function defines the status variable to return the test bench success status.
It utilizes five nested loops to generate all the possible inputs for the system.
Then prepare the designs to function arguments.
Finally, it applies the data recorders to the design function and the software implementation, then
reports any differences in the results.
After explaining the system functions, we should put all the courts together in a rather Atlas project
and program our FPGA and play with the calculator.
This would be the goal of the next lecture.