HI guys. i am working on this project..design digital comparator using Manchester carry chain approach. i really need your help. i just want to know what is the relation between Manchester carry chain adder to digital comparator
thanks for replying my post..i really appreciate it. pls explain me more the part where we need to invert either one of the input.. i am bit blur on that part? Pls..
If you want to compare A and B you need to do A-B and check if the result is < 0 or > 0
(you can do this if you the final carry flag)
A and B have to be in twos complement notation. If this is not the case you just need to
concatinate a 0 at the begining (e.g. 9 = 0b1001 have to be extended to 5 bit = 0b01001)
You can do the substraction of B by adding -B.
-B can be calculated by doing the twos complement
tows complement means inverting and adding 1
(e.g. 9 = 0b01001 twos complement (-9) = 0b10110 + b1 = 0b10111 = 0x17)
now you could add this to A and look for the final carry (with the manchester carry chain look ahead)
the adding of the 0b1 from the twos complement can be done if you set the carry input of the manchester chain to 1.
Now you only need to use the inverted B and you will have a comparator.
thanks again for helping me. basically we need to set either A or B as two complement. for example if i take B, i need to invert B and add 1 , the value 1 is coming from the carry input from the Manchester carry chain..after i add with the carry in ..i add -B to A..is my concept correct? how if i want to determine A=B?
hello qieda..thanks for helping me again. just wanna ask u for a favour..do u have any idea how to design cmos digital comparator using Manchester carry chain approach using dcsh and microwind software ,if can all in transistor level..do u know any website or refrence that can help me ?
hello qieda..thanks for helping me again. just wanna ask u for a favour..do u have any idea how to design cmos digital comparator using Manchester carry chain approach using dcsh and microwind software ,if can all in transistor level..do u know any website or refrence that can help me ?
hey qieda need to reconfirm with -B thing..sorry i am abit slow. first i need to invert B and add 1 after that i need to add the carry from Manchester adder or izzit i invert B and add 1 (this 1 is comin from the carry input)..which concept is correct? pls help me..
A=5 = 0b0101
B=7 = 0b0111
=>
~B = 0b1000
G = A & (~B) = 0b0000
P = A + (~B) = 0b1101
now use a carry look ahead with C0 = 1 (e.g. manchester carry chain)
C4 = G3 + G2&P3 + G1&P2&3 + G0&P1&P2&P3 + C0&P0&P1&P2&P3
C4 = 0 => B greater A
second example
A=7 = 0b0111
B=5 = 0b0101
=>
~B = 0b1010
G = A & (~B) = 0b0010
P = A + (~B) = 0b1111
again carry look ahead with C0 = 1 (e.g. manchester carry chain)
C4 = G3 + G2&P3 + G1&P2&3 + G0&P1&P2&P3 + C0&P0&P1&P2&P3
C4 = 1 => A greater(or equal) B
now with inverting A
A=5 = 0b0101
B=7 = 0b0111
=>
~A = 0b1010
G = (~A) & B = 0b0010
P = (~A) + B = 0b1111
now use a carry look ahead with C0 = 1 (e.g. manchester carry chain)
C4 = G3 + G2&P3 + G1&P2&3 + G0&P1&P2&P3 + C0&P0&P1&P2&P3
C4 = 1 => B greater (or equal) A
thanks for the example qieda..one more question qieda we determine A>B or B<A by comparing C0 and C4. for example if i invert B and i get C4=0 and C0=1, my answer is B>A and vice versa..i dun understand the part u said B>=A..it should be either B>A or B<A..in is the any possibility i get A=B?
hey qieda really need your help..for example one of my input is negative..A=5 and B= -7..what should i do so that my comparator can show that A> B using the Manchester carry chain approach? pls help me...pls.