Question
7. Although the E15 processor has an add opcode, it does not have the built-in ability to multiply numbers. One way to fix that is
7. Although the E15 processor has an add opcode, it does not have the built-in ability to multiply numbers. One way to fix that is to provide a software solution: in this case, we want to build a program, written in E15 assembly language, that can multiply numbers, using only the limited instructions available in the hardware. Use your completed E15 processor from the previous exercise to develop and test your code for this exercise. Write a program in E15 assembly in a file named multiplier.v. Your program should be able to multiply any two 4-bit unsigned numbers in Rg0 and Rg1, storing the result in Rg2. Assume that the product fits in 4 bits. Assume that the inputs are positive. Lets initially assume that we want to multiply the decimal values 7 and 2. Use ROM location 0 to store 7 into Rg0 with the movi instruction; then use ROM location 1 to store the value 2 into Rg1. The remainder of the program, beginning at ROM location 2, should perform the multiplication of the value of Rg0 by the value of Rg1, and store the result into Rg2 before halting. Note that your program should work with an arbitrary multiplicand and multiplier, but for testing and grading purposes, make sure that your submitted code is for the specific values 7 and 2. Youll need to modify the provided E15Process.v file in order to make it load your assembly program. Look for the line include "program1.v" and change the filename to match that of your program (multiplier.v). Do not change the file E15Process.v in any other way. Test your code by compiling and running the E15Process_tb.v test bench and examining its output: when you run the test bench, it will print out the final state of the registers. Briefly describe how your solution works in a few sentences. Submit only your E15 assembly language file multiplier.v. Do not submit your modified E15Process.v or the test bench.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started