edited by
1,006 views
0 votes
0 votes

Consider the following sequence of instructions : 

$a= a \oplus b, b= a \oplus b, a= b \oplus a$  This Sequence

  1. retains the value of the $a$ and $b$
  2. complements the value of $a$ and $b$
  3. swap $a$ and $b$
  4. negates values of $a$ and $b$
edited by

1 Answer

0 votes
0 votes
a=a⨁b

b=a⨁b

a= b⨁a

Let, a=1, b=0

a= 1⨁ 0= 1=> a=1

b= 1⨁ 0=1 => b=1

a= 1⨁1= 0=> a=0

Hence, a=0, b=1.

It can be seen that above statements swap the values of a and b.

Related questions

0 votes
0 votes
1 answer
1
go_editor asked Mar 27, 2020
405 views
The Register or main memory location which contains the effective address of the operand is known as:PointerIndexed registerSpecial LocationsScratch Pad
0 votes
0 votes
1 answer
2
go_editor asked Mar 27, 2020
2,189 views
A general macroprocessor is an in built function of :LoaderLinkerEditorAssembler
0 votes
0 votes
1 answer
3
go_editor asked Mar 27, 2020
2,689 views
Producer consumer problem can be solved using :semaphoresevent countersmonitorsall the above
0 votes
0 votes
1 answer
4
go_editor asked Mar 27, 2020
426 views
If you want to execute more than one program at a time, the systems software that are used must be capable of :word processingvirtual memorycompilingmultitasking