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.

How to implement two compliment circuits using sequential circuit?

Status
Not open for further replies.

MSRA

Full Member level 2
Joined
Nov 18, 2006
Messages
130
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
NED Pakistan
Activity points
2,207
How to impliment 2's compliment circuit using sequential circuit...?
 

2's compliment

A simple logic wil be to implement it directly as we do in straight forward hand calculations..

First complement every bit using an inverter and feed it to shift registers(if you want 4 bit,then use 4 shift registers..).. Now they wil be storing the 1's complement in them.. Feed it to an adder with the 1's complement as one input and 1 as another input.. The adder result wil be your 2's complement!
 

2's compliment

is it the whole sequential procedur.....?
 

Re: 2's compliment

ya that is the required sequential circuit... 2's compliment is just 1's compliment plus 1....
 

Re: 2's compliment

MSRA said:
is it the whole sequential procedur.....?


Yes it is the whole sequential procedure..
 

2's compliment

If you are talking about an ADC output, then the matter is different. If you want to find the rep for any number, for seq circuits, the way to go is compliment all and add one...
 

Re: 2's compliment

MSRA,
One way:
Shift the original number LSB first. The bits are unaltered until the bit after the first "1" is encountered. All subsequent bits are complemented.
Regards,
Kral
 

2's compliment

first invert and then use adder circuit to add 1.
 

2's compliment

1). Start shifting from LSB bits unaltered until the first "1" is encountered.
2).All subsequent bits are complemented.
 

2's compliment

through VHDL coding also can be done.
simple code.

signal x;std_logic;
begin
x<= not y;
x<=X+'1';
 

Re: 2's compliment

as it is a sequential input...u cant take 1's complement n then add 1...
so follow this..

1. start from LSB go left until u encounter 1, leave all the inputs as it is...
2. complement all the bits after the first one...

it will give u 2's complement...while workin sequentially...
 

Re: 2's compliment

One way to do it is the following :

1. Using an X-OR gate (it is a controlled inverter) pass logic 1 into one pin and the data (say pin B) in the other if you want to invert the data. If you pass logic 0 then no inversion occurs.
2. Then using an adder circuit using add 1 to the output from the X-OR gates and apply 0 to the other input (say pin A)
3. This way you will have an adder/subtractor circuit.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top