582 views
0 votes
0 votes

1 Answer

Best answer
0 votes
0 votes
XOR(r1,r2) :- Microporcessor perform exclusive xor operation between r1 and r2 and store the result in r1.
Lets take an example, suppose r1 contains 1010 ( i.e 10 in decimal) and r2 contains 0110 ( i.e 6 in decimal )
Instructions are

XOR( r2, r1 ) :- XOR will happen between r2 and r1 and result will store in r2, 0110 XOR 1010 = 1100, so after this operation r1 contain 1010 and r2 contain 1100.
XOR (r1, r2 ) :- Similarly after this operation r1 contain 0110 and r2 contain 1100
XOR (r2, r1 ) :- Similarly after this operation r2 contains 1010 ( i.e 10 in decimal ) and r1 contains 0110 ( i.e 6 in decimal)

We can observe that, values of r1 and r2 get swapped after execution of these 3 instruction. Infact, its one of the way we swap two value using XOR operation.

None of the options are matching.
selected by

Related questions

0 votes
0 votes
2 answers
2
rajveer43 asked Jan 12
178 views
The number of full and half-adders required to add $32$-bit numbers is______________________
0 votes
0 votes
0 answers
3
Redcom1988 asked Dec 23, 2023
176 views
Design a counter according to the state diagram above using only NAND gates and JK Flip-flops (if needed) complete with state tables
0 votes
0 votes
0 answers
4