Browse Source

changed readme

subDesTagesMitExtraKaese 3 years ago
parent
commit
8d8034d324
3 changed files with 31 additions and 3 deletions
  1. 2 1
      .gitignore
  2. 28 1
      README.md
  3. 1 1
      myfirst_niosii.vhd

+ 2 - 1
.gitignore

@@ -70,4 +70,5 @@ testbench/
 # ignore eclipse temp files
 obj/
 .metadata/
-*.log
+*.log
+.vscode/settings.json

+ 28 - 1
README.md

@@ -29,16 +29,43 @@ This is a Pong game on an Altera FPGA as an exercise in Hardware-/Software-Codes
 This diagram shows all the implemented parts and the singnals to connect them. The implementation is split in pysical Hareware, programmable logic as VHDL and instruction based C software.
 ![](images/data_graph.png)
 
-## Flowcharts of the VHDL program
+## VHDL program
 
 Below are shown the two main processes that are implemented in VHDL. They run simultanously and independent of each other. All processes and the synthesized CPU are connected to a common 50 MHz clock and a reset signal. When reset, all processes are asynchronously forced to output their default values, as seen in the first block.
 
 ### Multiplex process
+
+The matrix multiplexing timer has been sized regarding the following equations:
+- Timer frequency: `50Mhz / 2**20 = 1526 Hz`
+- Time per column: `1 / 1526 Hz   = 0.66 ms`
+- 1526 Hz / 8 = 190 Hz matrix refresh rate
+
 ![](images/matrix_multiplex.png)
 
 ### Debounce process
 ![](images/button_debounce.png)
 
+### Matrix instruction
+
+The matrix instruction contains 20 bits that are split in three parts:
+```
+ 20   16   12   8    4    0
+   XXXX CCCC RRRR RRRR RRRR
+```
+| Symbol  | Bit range    | Description    |
+|---------|--------------|----------------|
+| X       | 19 downto 16 |  unused        |
+| C       | 15 downto 12 |  column number |
+| R       | 11 downto  0 |  row data      |
+
+
+The column number can be one of the following values:
+- 0000: don't set anything
+- 0001: set column 0 to row data
+- 0010: set column 1 to row data
+- 0011: set column 2 to row data
+- ...
+
 ## Flowcharts of the C program
 Below images show flowcharts for all featured software functions.
 Fist chart feature the main game function. Subfunctions are described below.

+ 1 - 1
myfirst_niosii.vhd

@@ -48,7 +48,7 @@ architecture behav of myfirst_niosii is
 		-- R: 11 downto  0:  row data
 		--
 		-- column number:
-		--  0000: don't set anythhing
+		--  0000: don't set anything
 		--  0001: set column 0 to row data
 		--  0010: set column 1 to row data 
 		--  0011: set column 2 to row data