Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!pyramid!prls!mips!hansen From: hansen@mips.COM (Craig Hansen) Newsgroups: comp.arch Subject: Re: conditional branches Message-ID: <1689@mips.mips.COM> Date: 26 Feb 88 23:36:58 GMT References: <191@telesoft.UUCP> <9782@tekecs.TEK.COM> <1042@edge.UUCP> Lines: 19 ]I've seen this assertion a couple of times, but it ain't so. You need ]to worry about carry when doing a subtract, but not when just doing a ]compare. If both operands are positive, a simple bit-for-bit ]comparison is sufficient, analogous to the way that C programs compare ]strings. When the operands can be signed, a little extra logic is ]required, but nothing as fancy as a full adder/subtractor. However, to do the bit-for-bit comparison in parallel (most C programs compare strings one byte at a time), you need a structure that looks _remarkably_ like a carry chain. In fact, the structure's just as "fancy" as the carry chain in a subtractor, because it is functionally identical to the carry chain in a subtractor. Remember that the comparison of the high-order bits has priority over the comparison of low-order bits.... -- Craig Hansen Manager, Architecture Development MIPS Computer Systems, Inc. ...{ames,decwrl,prls}!mips!hansen or hansen@mips.com 408-991-0234