Jutge.org
The Virtual Learning Environment for Computer Programming
Prime number
X77384 en
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).
The top module must be called prime.
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 : 2013-07-17 16:32:00
© Jutge.org, 2006–2013.
http://www.jutge.org