MATLAB: Multiplier using HDL library

binary multiplicationHDL Codermulipliersimulinkvhdl

Hi, I want to make a multiplier of 4bit and to generate vhdl code using "HDL code generation" in simulink. for example A = [ 1 0 1 1]; B = [ 1 1 0 1];
Y= A*B ;
should give us 10001111; Thank you;
Safiya

Best Answer

Place a Product block in your design subsystem; feed it two ufix4 inputs.
Alternatively: use a MATLAB Function block that contains Y = A*B; feed it two ufix4 inputs.
Related Question