Codiode

4x4 Array Multiplier from Gates

HardVerilog / SystemVerilogBuild

An array multiplier lays out the partial products as a grid of AND gates and adders. Building it by hand shows the exact adder network that * would hide.

This module computes the 8-bit product of two 4-bit unsigned integers using a pure structural array multiplier topology. The multiplication of two 4-bit numbers a and b generates a matrix of 16 partial products, where each partial product bit is the logical AND of a[i] and b[j]. These 16 partial products must be summed using a network of half adders and full adders to produce the final 8-bit product p.

This is a purely combinational circuit. There is no clock and no reset. The output p must reflect the product of a and b immediately following any propagation delay through the adder network.

Signal Direction Width Description
a input 4 Multiplicand
b input 4 Multiplier
p output 8 Product of a and b

Constraints

  • The multiplication operator is strictly forbidden.
  • The design must be strictly combinational; no registers, flip-flops, or clocks may be used.
  • The output p must be valid combinationally based on the current inputs a and b.
  • You must implement the logic structurally using boolean logic gates (AND, XOR, OR) or by defining and instantiating custom half-adder and full-adder submodules.

Topics

ArithmeticCombinational LogicDatapath

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 Datapath Design

Problem 5 of 27 in the Datapath Design track.

Related problems

Browse all problems · Verilog practice problems · Learning tracks

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