answersLogoWhite

0


Best Answer

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
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How To find a number is odd or even in 8085?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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 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


Find the number is even or odd using if else?

if remainder (x/2) = 0 then even else odd


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

Odd