<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Puzzle #12 &#8211; Count and Add in Base -2</title>
	<atom:link href="http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/</link>
	<description>Tricks and Tips for ASIC Digital Designers</description>
	<lastBuildDate>Tue, 17 Nov 2009 20:00:40 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kee020041</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1707</link>
		<dc:creator>kee020041</dc:creator>
		<pubDate>Thu, 31 Jul 2008 10:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1707</guid>
		<description>continue from above, magnitude is
128   -64   32   -16   8   -4   2    -1

notice that, 
T(n) + T(n+1) = - T(n)       ----------[R1]

from above,
T(n) + T(n)   = - T(n+1)
2 * T(n)      = - T(n+1)         using [R1] above
2 * T(n)      =   T(n+1) + T(n+2)  -------------[R2]

at any bit, 
0 + 0 = 0
1 + 0 = 1
0 + 1 = 1
1 + 1 = T(n) + T(n) = 2 * T(n)     using [R2]
      = T(n+1) + T(n+2)
      = 0, CARRY_n+1 = 1, CARRY_n+2  = 1</description>
		<content:encoded><![CDATA[<p>continue from above, magnitude is<br />
128   -64   32   -16   8   -4   2    -1</p>
<p>notice that,<br />
T(n) + T(n+1) = &#8211; T(n)       &#8212;&#8212;&#8212;-[R1]</p>
<p>from above,<br />
T(n) + T(n)   = &#8211; T(n+1)<br />
2 * T(n)      = &#8211; T(n+1)         using [R1] above<br />
2 * T(n)      =   T(n+1) + T(n+2)  &#8212;&#8212;&#8212;&#8212;-[R2]</p>
<p>at any bit,<br />
0 + 0 = 0<br />
1 + 0 = 1<br />
0 + 1 = 1<br />
1 + 1 = T(n) + T(n) = 2 * T(n)     using [R2]<br />
      = T(n+1) + T(n+2)<br />
      = 0, CARRY_n+1 = 1, CARRY_n+2  = 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kee020041</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1706</link>
		<dc:creator>kee020041</dc:creator>
		<pubDate>Thu, 31 Jul 2008 09:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1706</guid>
		<description>so, the whole series is:
let consider a 8 bit number
the order of magnitude is:
(-2)^7  (-2)^6  (-2)^5  (-2)^4  (-2)^3  (-2)^2  (-2)^1  (-2)^0
  which is: (-128)  (64)  (-32)  (16)  (-8)  (4)  (-2)  (1)

for simplification let treat &#039;L&#039; as a symbol, that represent value of &#039;-1&#039;
then
0000000L = (-1) * (   1) =  -1
000000L0 = (-1) * (  -2) =   2
00000L00 = (-1) * (   4) =  -4
0000L000 = (-1) * (  -8) =   8
000L0000 = (-1) * (  16) = -16
00L00000 = (-1) * ( -32) =  32
0L000000 = (-1) * (  64) = -64
L0000000 = (-1) * (-128) = 128

Then by using convert &#039;L&#039; to value &#039;1&#039;, the order or magnitude is just multiply with negative,
so, the order of magnitude is:
(128)   (-64)   (32)   (-16)   (8)   (-4)   (2)   ( -1)

then, we can used value &#039;1&#039; and &#039;0&#039; to represent a base 2 number

i.e.
00000110 = -4 +  2 = -2 (base 10)
00001010 =  8 +  2 = 10 (base 10)
00001100 =  8 + -4 = 4 (base 10)</description>
		<content:encoded><![CDATA[<p>so, the whole series is:<br />
let consider a 8 bit number<br />
the order of magnitude is:<br />
(-2)^7  (-2)^6  (-2)^5  (-2)^4  (-2)^3  (-2)^2  (-2)^1  (-2)^0<br />
  which is: (-128)  (64)  (-32)  (16)  (-8)  (4)  (-2)  (1)</p>
<p>for simplification let treat &#8216;L&#8217; as a symbol, that represent value of &#8216;-1&#8242;<br />
then<br />
0000000L = (-1) * (   1) =  -1<br />
000000L0 = (-1) * (  -2) =   2<br />
00000L00 = (-1) * (   4) =  -4<br />
0000L000 = (-1) * (  -8) =   8<br />
000L0000 = (-1) * (  16) = -16<br />
00L00000 = (-1) * ( -32) =  32<br />
0L000000 = (-1) * (  64) = -64<br />
L0000000 = (-1) * (-128) = 128</p>
<p>Then by using convert &#8216;L&#8217; to value &#8216;1&#8242;, the order or magnitude is just multiply with negative,<br />
so, the order of magnitude is:<br />
(128)   (-64)   (32)   (-16)   (8)   (-4)   (2)   ( -1)</p>
<p>then, we can used value &#8216;1&#8242; and &#8216;0&#8242; to represent a base 2 number</p>
<p>i.e.<br />
00000110 = -4 +  2 = -2 (base 10)<br />
00001010 =  8 +  2 = 10 (base 10)<br />
00001100 =  8 + -4 = 4 (base 10)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kee020041</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1705</link>
		<dc:creator>kee020041</dc:creator>
		<pubDate>Thu, 31 Jul 2008 09:29:47 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1705</guid>
		<description>since 
base 2 using         {0 to 1}
base 8 number using  {0 to 7}
base 10 number using {0 to 9}

So,
base n number should used all integer start from 0 to the integer before N

then base -2 should use {0,-1}
base -8 should use {0,-1,-2,-3,-4,-5,-6,-7}</description>
		<content:encoded><![CDATA[<p>since<br />
base 2 using         {0 to 1}<br />
base 8 number using  {0 to 7}<br />
base 10 number using {0 to 9}</p>
<p>So,<br />
base n number should used all integer start from 0 to the integer before N</p>
<p>then base -2 should use {0,-1}<br />
base -8 should use {0,-1,-2,-3,-4,-5,-6,-7}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kee020041</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1704</link>
		<dc:creator>kee020041</dc:creator>
		<pubDate>Thu, 31 Jul 2008 06:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1704</guid>
		<description>the number that allow for base -2 is {0,1} or {0,-1}?</description>
		<content:encoded><![CDATA[<p>the number that allow for base -2 is {0,1} or {0,-1}?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sravan</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1685</link>
		<dc:creator>sravan</dc:creator>
		<pubDate>Thu, 17 Jul 2008 01:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1685</guid>
		<description>well i can not post every thing but i can give hint we represent base2 with ...(2)^3 (2)^2 (2)^1 (2)^0.(2)^-1 ..... similarly we can represent base -2 with .....(-2)^3 (-2)^2 (-2)^1 (-2)^0 ......</description>
		<content:encoded><![CDATA[<p>well i can not post every thing but i can give hint we represent base2 with &#8230;(2)^3 (2)^2 (2)^1 (2)^0.(2)^-1 &#8230;.. similarly we can represent base -2 with &#8230;..(-2)^3 (-2)^2 (-2)^1 (-2)^0 &#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: José</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1645</link>
		<dc:creator>José</dc:creator>
		<pubDate>Fri, 20 Jun 2008 06:08:01 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1645</guid>
		<description>Hi Nir,

  Extending the carries does not have an efficient implementation (a second row of full-adders does not suffice! Actually, one needs n rows of full-adders (FAs) --though one less FA every subsequent row-- till the extension of carries is fully processed). 

  A more efficient implementation can be obtained by making use of the concept of &quot;generalized FA/HAs(half-adders)&quot;. As before, the first row is a conventional ripple adder. The output being S = -s_0 + s_1 x 2^1 - ... must be consequently inverted. A second row made of a simple incrementor (half-adders!) will do the job since -s = s_bar - 1.</description>
		<content:encoded><![CDATA[<p>Hi Nir,</p>
<p>  Extending the carries does not have an efficient implementation (a second row of full-adders does not suffice! Actually, one needs n rows of full-adders (FAs) &#8211;though one less FA every subsequent row&#8211; till the extension of carries is fully processed). </p>
<p>  A more efficient implementation can be obtained by making use of the concept of &#8220;generalized FA/HAs(half-adders)&#8221;. As before, the first row is a conventional ripple adder. The output being S = -s_0 + s_1 x 2^1 &#8211; &#8230; must be consequently inverted. A second row made of a simple incrementor (half-adders!) will do the job since -s = s_bar &#8211; 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir Dahan</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1626</link>
		<dc:creator>Nir Dahan</dc:creator>
		<pubDate>Fri, 06 Jun 2008 14:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1626</guid>
		<description>Nagaraj,

I think you understood it the other way around.
we are not interested in what the sequential binary count will result in, rather we are interested in how to represent the numbers sequentially in base -2.
But I think you got the general idea...</description>
		<content:encoded><![CDATA[<p>Nagaraj,</p>
<p>I think you understood it the other way around.<br />
we are not interested in what the sequential binary count will result in, rather we are interested in how to represent the numbers sequentially in base -2.<br />
But I think you got the general idea&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: José</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1625</link>
		<dc:creator>José</dc:creator>
		<pubDate>Thu, 05 Jun 2008 13:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1625</guid>
		<description>One possibly solution to binary addition in base -2 is the following:

Let A = {a_0 a_1 ... a_n-1} and B = {b_0 b_1 ... b_n-1} represent the algebraic value of two numbers in base -2. 

That is, A = sum_i (a_i x (-2)^i) and B = sum_i (b_i x (-2)^i) with i = 0...n-1 and, a_i and b_i in {0,1}.

Note that (a_i + b_i)x(-1)^i takes values in {0,+1,+2} if i even and {0,-1,-2} if i odd. 

Also, it is obvious that, +2 = +4 + (-2) and -2 = (-4) + (+2). Note that +2 and -2 do not have a representation in the next bit position i+1, but they do in i+1 and i+2.

By extending the carry output of a conventional full-adder to bit positions i+1 and i+2 we are done. 

For example, one can use two ripple adders: the first connected as usual, and the second one takes the sum and the carries of the first one.</description>
		<content:encoded><![CDATA[<p>One possibly solution to binary addition in base -2 is the following:</p>
<p>Let A = {a_0 a_1 &#8230; a_n-1} and B = {b_0 b_1 &#8230; b_n-1} represent the algebraic value of two numbers in base -2. </p>
<p>That is, A = sum_i (a_i x (-2)^i) and B = sum_i (b_i x (-2)^i) with i = 0&#8230;n-1 and, a_i and b_i in {0,1}.</p>
<p>Note that (a_i + b_i)x(-1)^i takes values in {0,+1,+2} if i even and {0,-1,-2} if i odd. </p>
<p>Also, it is obvious that, +2 = +4 + (-2) and -2 = (-4) + (+2). Note that +2 and -2 do not have a representation in the next bit position i+1, but they do in i+1 and i+2.</p>
<p>By extending the carry output of a conventional full-adder to bit positions i+1 and i+2 we are done. </p>
<p>For example, one can use two ripple adders: the first connected as usual, and the second one takes the sum and the carries of the first one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nagaraj</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1623</link>
		<dc:creator>Nagaraj</dc:creator>
		<pubDate>Thu, 05 Jun 2008 06:50:01 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1623</guid>
		<description>Nir,

here is my thinking...
binary 
representation                    in decimal
0              =  0x(-2)^0   =    0
1              = 1x(-2)^0    =    1
10        = 1x(-2)^1+0x(-2)^0=   -2
11        = 1x(-2)^1+1x(-2)^0=   -1
100      =  1x(-2)^2+0+0     =    4
101      =  1x(-2)^2+0+1x(-2)^0=  5
and so on...

and as for counting 

the addition circuit will be same as the base 2 adder circuit.
since 101(5)+100(4)= 1001 which is 9 in base -2
and  100(4)+11(-1)=11 which is 3 in base -2
and say 101(5)+10(-2)= 11 which is 3 in base -2

Please let me know if im on the right track...


Thanks.</description>
		<content:encoded><![CDATA[<p>Nir,</p>
<p>here is my thinking&#8230;<br />
binary<br />
representation                    in decimal<br />
0              =  0x(-2)^0   =    0<br />
1              = 1x(-2)^0    =    1<br />
10        = 1x(-2)^1+0x(-2)^0=   -2<br />
11        = 1x(-2)^1+1x(-2)^0=   -1<br />
100      =  1x(-2)^2+0+0     =    4<br />
101      =  1x(-2)^2+0+1x(-2)^0=  5<br />
and so on&#8230;</p>
<p>and as for counting </p>
<p>the addition circuit will be same as the base 2 adder circuit.<br />
since 101(5)+100(4)= 1001 which is 9 in base -2<br />
and  100(4)+11(-1)=11 which is 3 in base -2<br />
and say 101(5)+10(-2)= 11 which is 3 in base -2</p>
<p>Please let me know if im on the right track&#8230;</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kj</title>
		<link>http://asicdigitaldesign.wordpress.com/2008/06/03/puzzle-12-count-and-add-in-base-2/#comment-1621</link>
		<dc:creator>kj</dc:creator>
		<pubDate>Wed, 04 Jun 2008 17:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://asicdigitaldesign.wordpress.com/?p=265#comment-1621</guid>
		<description>Amit, I assume the count will go like all counts:
1, 2, 3, 4, ... You may require a few more bits than you are used to though.</description>
		<content:encoded><![CDATA[<p>Amit, I assume the count will go like all counts:<br />
1, 2, 3, 4, &#8230; You may require a few more bits than you are used to though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
