Codiode

Multiplication Width Expansion

MediumVerilog / SystemVerilogBuild

An N-bit times an M-bit product needs N + M bits. Anything narrower throws away the top of the answer.

The module takes two 16-bit unsigned integer operands and computes their product. It continuously drives the full 32-bit result to the output port without truncating any bits.

This is a purely combinational circuit. Changes on any input port must immediately reflect on the output port.

Signal Direction Width Description
a input 16 Unsigned multiplicand
b input 16 Unsigned multiplier
prod output 32 Full-width product of a and b

Constraints

  • The module must be purely combinational with no clock or reset dependencies.
  • The output prod must capture the full 32-bit result to prevent overflow.
  • Operands a and b are treated as unsigned integers.

Topics

CombinationalArithmetic

Solve this problem

Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against the problem's testbench. You get the waveform back, not a stored answer.

This problem is part of Codiode Pro. The statement above is free to read.

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Part of Verilog Syntax and Language Basics

Problem 13 of 25 in the Verilog Syntax and Language Basics track.

Related problems

Browse all problems · Verilog practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.