To implement a Python program that checks whether the given number is a prime number or not.
A prime number is a positive integer greater than 1, that has no positive integer divisors other than 1 and itself. In other words, a prime number can only be divided evenly by 1 and itself. These numbers are important in many areas of mathematics including number theory, cryptography and computer science.
Here are some examples of first few prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
Number 6 is not a prime number because it can be evenly divided by either 2 or 3.
The program finds whether the given number is a prime and its equivalent low-level language instructions executed by the hardware. The low-level language instructions used are:
|It assigns a value to a variable.
|It divides the values contained in two registers and puts the result in the first register.
|It checks if the values contained in two registers are same.
|Checks if the condition evaluated to be false.
|Checks if the condition evaluated to true.
|It reads the input from the user and stores it in a variable.
|It increases the value contained in the register by 1.
|Is used to mark the position in the low-level instructions to enable jumping to the marked position.
|It loads a value of a global or local variable to the given register.
|Lesser than or equal to operator, check whether the first operand is lesser than second operand and return a boolean value based on the condition.
|It prints the output value to the screen.
|It performs division operation of the values contained in two registers and puts the remainder in the first register.
|It stores the value from the given register to the global or local variable.