Residue mod 7

Design a circuit that computes the residue mod 7 of a 4-bit number
represented in binary code.

Specification

    module mod7(n, residue);
        input [3:0] n;
        output [2:0] residue;

Input

- n is a 4-bit number represented in binary code.

Output

- residue represents n mod 7 in binary code.

Problem information

Author: Jordi Cortadella

Generation: 2026-02-03T12:16:57.448Z

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