Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The objective of this assignment is to implement a parameterized carry save multiplier and Design of Digital Systems: Lab Assign heavily test it using advanced

The objective of this assignment is to implement a parameterized carry save multiplier and Design of Digital Systems: Lab Assign
heavily test it using advanced techniques learned in VHDL.
Background
Multiplication, which is required by many hardware systems, is heavily studied since it is
a very expensive operation that requires a large area and long critical path to implement.
Carry-save multiplication is one technique that optimizes the standard ripple-carry multi-
plication by improving the critical path delay. Furthermore, in order to avoid any issues in
the design, the unit needs to be heavily tested using a large number of test vectors which
is usually generated using an external tool (such as Matlab, Python, Magma, ...). VHDL
provides the textio library to allow reading from files which holds these test vectors
************************************************************************************
I will need the design and the testbench file for vivado. Do not copy and paste from chat gpt, please and thank you!
************************************************************
The design should look like -- FULL_ADDER COMPONENT
library ieee;
use ieee.std_logic_1164.all;
entity full_adder is
port(
-- add ports for full_adder as described in the pdf
);
end full_adder;
architecture dataflow of full_adder is
-- add signals here if needed
begin
-- write the architecture for full_adder based on Figure 1 schematic
end dataflow;
-- CARRY_SAVE_MULT COMPONENT
library ieee;
use ieee.std_logic_1164.all;
entity carry_save_mult is
-- add generic n
generic ();
port(
-- add ports for carry_save_mult as described in the pdf
);
end carry_save_mult;
architecture structural of carry_save_mult is
-- add full_adder as component
-- variable array of n-bit std_logic_vector
type arr2d is array (integer range <>) of std_logic_vector(n-1 downto
0);
-- signal ab has dimensions (n x n)
signal ab : arr2d(0 to n-1);
-- full_adder signals, all have dimension ((n-1) x n)
signal FA_a : arr2d(0 to n-2);
signal FA_b : arr2d(0 to n-2);
signal FA_cin : arr2d(0 to n-2);
signal FA_sum : arr2d(0 to n-2);
signal FA_cout : arr2d(0 to n-2);
begin
-- use nested for-generate to assign values to ab 2D-array
gen_ab_rows: for i in 0 to n-1 generate
gen_ab_cols: for j in 0 to n-1 generate
-- write code here
end generate;
end generate;
-- Figure 3 shows that we will use ((n-1) x n) full adders
-- use nested for-generate to instantiate each full_adder component.
-- ports are mapped to each bit of the 2D-arrays FA_a, FA_b, FA_cin,
FA_sum, FA_cout
-- after instantiating the full adders, we need to assign values
-- for the inputs of the FAs.
-- use the three patterns from the pdf to complete this part
-- and assign values to each row.
-- First row:
-- Intermediate rows:
-- Last row:
-- finally, do the last steps to compute the product.
-- Product:
end structural;
-- MULT WRAPPER
library ieee;
use ieee.std_logic_1164.all;
entity mult is
port(
-- add ports for mult as described in the pdf
);
end mult;
architecture structural of mult is
-- add carry_save_mult as a component
-- we don't need to the full_adder as component here
-- signals
signal a_reg : std_logic_vector(7 downto 0);
signal b_reg : std_logic_vector(7 downto 0);
signal p_s : std_logic_vector(15 downto 0);
begin
-- instantiate carry_save_mult (create port map)
reg_mult : process(clk)
begin
if rising_edge(clk) then
-- on the rising edge, make the signals equal
-- to the inputs and outputs carry_save_mult
end if;
end process;
end structural;
-- after completing the design, write the simulation testbench.
-- make sure to add "create clock -period 10-name clk [get ports clk]" to
your constraints file.
*********************************************************************************************************************
The testbench should look like library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_textio.all;
library std;
use std.textio.all;
entity mult_tb is
end mult_tb;
architecture behavioral of mult_tb is
-- ADD "mult8x8.dat" AS A SIMULATION SOURCE FIRST
-- file variable to read data from
file MULT_FILE : text OPEN READ_MODE is "mult8x8.dat";
-- create period constant
-- mult components
component mult is
-- add ports here
end component;
-- add signals
begin
-- instantiate mult component and complete the port map for it
-- generate the process for the clock similar to previous lab 0 and
lab 2
-- variables for reading for MULT_FILE
tb: process
variable cur_line : integer :=1;
variable v_line : line;
variable v_space : character;
variable v_a : std_logic_vector(7 downto 0);
variable v_b : std_logic_vector(7 downto 0);
variable v_p_exp : std_logic_vector(15 downto 0);
begin
-- useful functions
-- while not endfile("FILE"): keeps reading until reaching the end
of the file.
-- readline("FILE","VARIABLE"): reads 1 line at a time from file
and stores it in variable.
-- hread("VARIABLE", "VARIABLE"): reads from the 1st variable into
the 2nd variable in HEX format.
-

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions