nn-bit adder

Design a circuit that performs the addition of two nn-bit numbers. The result must be represented in nn bits also. The number of bits nn must be a parameter of the module.

Specification

module adder (a, b, cin, sum, cout);
    parameter N=16;
    input [N-1:0] a, b;
    input cin;
    output [N-1:0] sum;
    output cout;

Hint

You may want to use several instances of a 1-bit full adder.

Input

Output

Problem information

Author: Jordi Cortadella

Generation: 2026-02-03T12:11:33.657Z

© Jutge.org, 2006–2026.
https://jutge.org