Assignment 8
Problems P1-P6 are considered to be warm-up/practice for the in-class assessment on Dec 8th (the last day of our class)
Problems P7 is not expected practice for Dec 8th, which is why all at-home work is due Dec 9th (the last day of classes for the semester)
These problems with be graded based on assessment of completion as submitted on Dec 9th
Grade Distribution for Assignment 8
- 25% at-home practice due Dec 9th
- 75% in-class: Dec 8th
1 P1 Fixed-Point Design
Assume that you are tasked with a hardware implementation of the following polynomial.
- \(2x^6−13x^5+26x^4−7x^3−28x^2\)
The inputs are in range [0,2] and will be 32 bit. The output is also 32-bit. Provide the design as a detailed digital circuit drawing OR as Verilog. Provide the recommended Qm.f representation for the input and output.
Provide a demonstration of this in Python or Verilog. Submit code and demonstration in your report.
2 P2 Fixed-Point Design
Assume that you want to implement the following expression every cycle:
- \(y = y/2 + x\) where x is an integer between 10 and -10.
- After each reset, 400 values of X will be provided, one per clock cycle.
Assume that you are allowed to implement registers only up to 32-bits (intermediate and final). Draw the circuit to compute the result, noting the the Qm.f notation https://en.wikipedia.org/wiki/Fixed-point_arithmetic#Notation for each register. Discuss the specifications and capabilities of your system.
Provide a demonstration of this in Python or Verilog. Submit code and demonstration output in your report.
3 P3 (Fixed Point and Carry Save)
Consider the addition of three numbers, with the respective formats listed here:
- Signed Q2.2
- Signed Q2.2
- Unsigned Q3.3
Depict a system to perform this addition. The building blocks of your drawing should be 1-bit half-adders and 1-bit full adders. The design must demonstrate carry-save addition and the final format should be a single fixed-point word. Specify the format for interpretation of the bits in that word.
What is the output word size and format to instead capture the multiplication of these three words?
Provide a demonstration of this in Python or Verilog. Submit code and demonstration output in your report.
4 P4
Perform non-restoring division (long-division shown in-class) to compute X/D with
- X = 0.01100 (base 2) = 3/8
- D = 0.11101 (base 2) = 29/32
The answer is Q=0.01101 (base 2) = 13/32
Perform work in binary, not decimal and show work.
Comment on how many bits of the result are computed per iteration.
5 P5
Multiplicative Normalization: Adapted from Example 7.4 in Computer Arithmetic Algorithms , Israel Koren , CRC Press, 2018
- X = 0.01100 (base 2) = 3/8
- D = 0.11101 (base 2) = 29/32
- The correct 5-bit quotient is Q=0.01101 (base 2) = 13/32
- Use the Div by Convergence method (the name used in my slides) to compute the quotient.
- Comment on how many iterations are required.
- Perform handwork in binary, not decimal.
6 P6
Consider the following C code which computes the nthnth value in the Fibonacci sequence, where n is at most 255. For reference, the sequence is 0,1,1,2,3,5,8,13,21,34,… where Fib(0) = 0 , Fib(1)= 1,Fib (2)= 1, Fib(3) = 2,… Fib(255) = 87571595343018854458033386304178158174356588264390370 Note that log2(Fib(255))=175.870723928
int Fib(int n){ int a = 0,b=0,temp=0; if(n!=0){ b = 1; for (int i= 1; i<n;i++){ temp = a + b; a = b; b = temp; } } return b; }
- Would it be possible to implement this as purely combinatorial (not sequential) circuit give the information in the problem? Explain / justify your answer.
- Describe in some detail one method and implementation for how augmenting the design using a lookup table with a a minimal number of entries could be used to reduce the maximum number of iterations required by a factor of FOUR.
7 P7
Additive Normalization: At time 8:26 an example of additive normalization is used in the CORDIC algorithm to show rotation by 20 degrees [https://youtu.be/pTgmySlijAs](https://youtu.be/pTgmySlijAs)
As initial practice, repeat the example decisions yourself for rotation choices in iterations 0 to 7 (each choice is add or sub).
Using the recorded add/sub decisions in each step, rotate the starting vector X=0.5, Y=0.5 (as opposed to X=1,Y=0) going through the CORDIC algorithm iterations and see if you can find the correct result.
Assume that the multiplication by the cosine factor in each stage is sufficient so as to not lose any accuracy, or assume that it is performed after the final stage as a system gain.
Up to how many bits is your output accurate?