Sunday, February 23, 2020

Application:

A simplified 'Fruit Ninja' has been built in this project, a falling square represent the falling 'Fruit' and another square represent the 'Knife'. Counter will add 1 if the 'Knife' reached the 'Fruit'. In this application, position of 'Knife' is determined by position of hand and initial position and falling speed of 'Fruit' is fixed because this game is only a simplified version.

Scoreboard:

Due to the lack of function of displaying number, this function has to be completed by a separated part. Actually, this part is a plot work, hence, this is not a difficult part but consume considerable time to plot each number.
Figure 1. Example of plotting '0'


Moreover, another important part is converter for converting the binary number to decimal number, then plot the number on the 'scoreboard', the lower right corner. However, this is different with the simple BCD, in this part, it applied a more complicated convention, shift register and add 2'b11 (decimal: 3) to each 4 bits after shift 1 bit. The example of this BCD algorithm is shown below.
Figure 2. BCD with shift register [1]

Then, the implementation can be seen in figure 3.
Figure 3. Implementation of BCD
Scaling:

A pink box will change its size within the changing size of hand. The original assumption is using a picture of Lena to represent the scaling function; however, the storage is not enough to store Lena's figure. This part is just using the position variables and very simple, hence, this part will not be described precisely.

Reference:

[1] N. McDonald, “Binary to BCD Conversion Algorithm,”
[Online]. Available: https://my.eng.utah.edu/~nmcdonal/Tutorials/BCDTutorial/BCDConversion.html

No comments:

Post a Comment