Prime number

Design a circuit that has a 4-bit number as input. The output of the
circuit must be 1 if the number represented by the input in binary code
is prime, and 0 otherwise (0 and 1 are not prime).

Specification

    module prime (n, is_prime);
        input [3:0] n;
        output is_prime;

Input

- n is the 4-bit input number.

Output

- is_prime is the output indicating whether the number is prime or not.

Problem information

Author: Jordi Cortadella

Generation: 2026-02-03T12:18:03.593Z

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