Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!hplabs!gatech!hubcap!Wen-King From: Wen-King@hubcap.UUCP Newsgroups: comp.hypercube Subject: Re: T or routing (Grey Code ring in Binary N-cube) Message-ID: <288@hubcap.UUCP> Date: Tue, 14-Jul-87 08:20:09 EDT Article-I.D.: hubcap.288 Posted: Tue Jul 14 08:20:09 1987 Date-Received: Fri, 17-Jul-87 04:25:01 EDT Sender: fpst@hubcap.UUCP Lines: 25 Approved: hypercube@hubcap.clemson.edu In article <282@hubcap.UUCP> gdburns@TCGOULD.TN.CORNELL.EDU (Greg Burns) writes: >I have a semi-interesting problem with routing on a loop that is actually >threaded through a hypercube. Let's say that a loop is mapped onto >a hypercube in the following way: > >000 001 011 010 110 111 101 100 Given that: NODE = node number of this node. MASK = (2**(dimension of cube)) - 1. Using these routines: bin_grey(n) int n; { return(n ^ (n >> 1)); } grey_bin(n) int n; { int i; for(i = n; n >>= 1; i ^= n); return(i); } To make a ring: preceeding node = bin_grey( ( grey_bin(NODE) - 1 ) & MASK ); suceeding node = bin_grey( ( grey_bin(NODE) + 1 ) & MASK ); +--------------------------------------------------------------------------+ | Wen-King Su wen-king@vlsi.caltech.edu Caltech Corp of Cosmic Engineers | +--------------------------------------------------------------------------+