Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Hi EDA Users,

Status
Not open for further replies.

vakaspr3

Newbie level 1
Joined
Apr 6, 2014
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
0
Location
Visakhapatnma
Activity points
0
Swapping 2 values without using 3rd variable..??? Want to know.. Reply soon
 

just take a two variable a and b; a=5; b=2;

coding:
a <= a + b; a(7) <= a(5) + b(2);
b <= a - b; b(5) <= a(7) - b(2);
a <= a - b; a(2) <= a(7) - b(5);

and check the output msb bit if is "HIGH" means the value in negative; if its happen means take the 2's complement of that value

Regards
rajavel.rv
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top