GATE CSE
First time here? Checkout the FAQ!
x
0 votes
27 views

asked in Digital Logic by Loyal (3.2k points) 2 11 26 | 27 views

Here is correct question..

1 Answer

0 votes
Best answer
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.
answered by Boss (6.4k points) 3 11 31
selected by

Related questions

0 votes
1 answer
1
asked ago in Digital Logic by Kaluti Loyal (3.2k points) 2 11 26 | 34 views
0 votes
0 answers
2
asked ago in Digital Logic by air1ankit Active (1.7k points) 8 30 | 24 views
+1 vote
0 answers
3
asked in Digital Logic by air1ankit Active (1.7k points) 8 30 | 44 views


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23210 Points

  2. Bikram

    17018 Points

  3. Habibkhan

    6652 Points

  4. srestha

    5864 Points

  5. Debashish Deka

    5430 Points

  6. jothee

    4908 Points

  7. Sachin Mittal 1

    4762 Points

  8. joshi_nitish

    4274 Points

  9. sushmita

    3954 Points

  10. Silpa

    3698 Points


Recent Badges

Regular Juhi Sehgal
Popular Question vineet.ildm
Nice Comment Arjun
100 Club vipul verma
Notable Question jothee
Popular Question jothee
Nice Question shivangi5
Regular rinks5
Notable Question shipra tressa
Regular sasi
27,247 questions
35,056 answers
83,703 comments
33,183 users