From 250b9c60d3509b837a9dcd84672905059b8a776f Mon Sep 17 00:00:00 2001 From: jf3g19 <jf3g19@soton.ac.uk> Date: Sun, 29 Nov 2020 22:09:06 +0000 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 99431b3..c0261ac 100644 --- a/README.md +++ b/README.md @@ -1 +1,36 @@ +**Contents** + Implementation of a Basic Distributed Arithmetic Architechture for MAC + +**Operation** + +- The Distributed Arithmetic Architechture is based on the assumption that for a given Sum Of Products (SoP) between two arrays `C` and `X` that you know the value of `C` at compile time. + +- Based on this assumption we can generate a LUT which allows us to transform the SoP to a series of shifts and adds. + +- The File generate_LUT.cpp can be used to generate the LUT values for a given set of input coefficients. If you compile the file it can be run in the command line in the following format: + +`> generate_LUT [Multiplicand Bit-Width] [C[0]] [C[1]] [C[2]] [C[3]] .... [C[n]] ` + +i.e + +`generate_LUT 16 -4 -3 1 9` + +would generate the LUT for the coefficients c[0] = -4, c[1] = -3, c[2] = 1, c[3] = 9, and a 16-bit Bit-Width for your Multiplicand. + +The generate multiplication coefficients can be stored as an unpacked array of packed values and should be connected directly to the `multiplication_coefficients` input port. + + +**Example** + +An Example ModelSim output for the testbench provided, which displays the inner product of + +`X = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]` +`C = [ [-79 -136 312 654 -1244 -2280 4501 14655 14655 4501 -2280 -1244 654 312 -136 -79]` + +[output](https://imgur.com/WczvADF) + +We can see that after input ready goes high, 17 clock cycles later, output ready goes high [with the correct value 278,511](https://imgur.com/ctePVPN) + + + -- GitLab