answersLogoWhite

0

every odd no. has "1" in its last bit and every even no has "0" (in binary)

eg-

2=0010 ,3=0011

4=0100 ,5=0101....and so on

so just logically "AND" the no with "01H" using instruction [HAVING THAT NO. IN ACCUMULATOR (A)]

ANI 01H

so if the no. is even =>

A=0 (and zero flag is set i.e. "1"

but if the no is odd then => A=1

means zero flag is reset i.e. "0"

so using instruction "JZ"

you can find if the no. if even or odd. :)

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How can a given number can be checked as even or odd in 8085?

AND it to 1 and test for zero. All even numbers have 0 in the last bit.


How can you separate odd and even numbers from the array of 10 numbers in 8085 microprocessor?

To separate odd and even numbers from an array of 10 numbers in the 8085 microprocessor, you can utilize a loop and the AND instruction. First, load each number from the array into a register and perform a bitwise AND operation with the value 1. If the result is 0, the number is even; if the result is 1, the number is odd. You can then store the odd numbers in one memory location and the even numbers in another, iterating through the entire array until all numbers are processed.


How do you find a number is odd or even numbers using flowchart?

Get number Find modulo 2 of number If the result is zero, number is even Else number is odd


How do you find number is even or odd?

An even number can be divided by 2 evenly. An odd number will have a remainder of 1 when divided by 2.


The sum of an even and odd number?

Lets find out.2 + 3 = 5 (Odd)4 + 7 = 11 (Odd)12 + 13 = 25 (Odd)So it appears that the sum of an even and odd number is an odd number.


How can dawson find out if his number is odd or even?

An even number can be divided by 2 evenly. An odd number will have a remainder of 1 when divided by 2.


What do you notice when you find the difference between an odd and even numbers?

The answer is an odd number.


Does multiplying an odd number by an even number give an even answer?

odd * odd = odd answer even * even = even answer odd * even = even answer


How do you detect odd number in microprocessor 8085?

Test the least significant bit of the number. If it is 1, the number must be odd. If it 0 it must be even. To achieve this, place the value in B then use the ANI instruction: ANI 01H Thus if B is 01H, B is odd, otherwise it is even. Works for both positive and negative integers.


An even number minus a odd number?

"IT IS ALWAYS A ODD"


Is the sum of an odd number and an even number always even?

No. Sum of odd + odd = even Sum of odd + even = odd Sum of even + even = even


Is the sum of an odd number and an even number odd or even?

Odd