n-bit adder X84292


Statement
 

pdf   zip   verilog

html

Design a circuit that performs the addition of two n-bit numbers. The result must be represented in n bits also. The number of bits n 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

  • a and b are the two n-bit numbers.
  • cin is the input carry.

Output

  • sum is the n-bit output representing (a+b)  mod  2n.
  • cout is the output carry.
Information
Author
Jordi Cortadella
Language
English
Official solutions
Unknown. This problem is being checked.
User solutions
Verilog