This is to be done in VHDL Code Please show VHDL CodingSolut

*******This is to be done in VHDL Code.

*******Please show VHDL Coding

Solution

A number <100 , if composite, will always have a prime factor less than 10. Since only two prime factors are of interest in this problem, we just need to check if the other divisor is prime or not using the same test. That means, we need to check if 2,3,5,7 divides the input number, If so, divide the number and check if 2,3,5,7 divide the other divisor.

Program logic:

1. Divide input number by 2, 3, 5, 7

2. If divisible, number is composite. Find the quotient after division. If not divisible, the number is prime

3. If Divide the quotient by 2, 3, 5, 7. If divisible, note the number that divides it. Thus we have two prime factors. If not divisble, the quotient is prime.

4. Display according to the rules given.

*******This is to be done in VHDL Code. *******Please show VHDL CodingSolutionA number <100 , if composite, will always have a prime factor less than 10. Sin

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site