Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Location arithmetic
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Multiplication== To multiply a pair of binary numbers, first mark the two numbers on the bottom and the right side of the grid. Say we want to multiply 22 (= 10110) by 9 (= 1001). {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |+'''10110 * 1001''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | '''1''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | '''0''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | '''0''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="background-color: white;" | '''1''' |- style="height:30px; background-color:white; color: black;" | style="width:30px;"| | style="width:30px;"|'''1''' | style="width:30px;"|'''0''' | style="width:30px;"|'''1''' | style="width:30px;"|'''1''' | style="width:30px;"|'''0''' |} Now place counters at every "intersection" of vertical and horizontal rows of the 1s in each number. {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="background-color: white;" | |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="background-color: white;" | |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="background-color: white;" | '''1''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="background-color: white;" | '''0''' |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"|[[Image:Location arithmetic vertical.svg]] | style="width:30px;"| | style="background-color: white;" | '''0''' |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic horizontal.svg]] | style="background-color: white;" | '''1''' |- style="height:30px; background-color:white; color: black;" | style="width:30px;"| | style="width:30px;"|'''1''' | style="width:30px;"|'''0''' | style="width:30px;"|'''1''' | style="width:30px;"|'''1''' | style="width:30px;"|'''0''' |} Notice that each row of counters on the grid is just 22 multiplied by some power of two. In fact, the total value of the counters is the sum of two rows : 22*8 + 22*1 = 22*(8+1) = 22*9 So the counters on the board actually represent the product of the two numbers, except it is not possible to "read off" the answer just yet. Recall that moving counters diagonally does not change the value, so move all the counters on inner squares diagonally until they hit either the bottom row or the left column. {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic diagonal half.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic diagonal half.svg]] | style="width:30px;"|[[Image:Location arithmetic diagonal half.svg]] | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic diagonal.svg]] | style="width:30px;"|[[Image:Location arithmetic diagonal.svg]] | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic diagonal.svg]] | style="width:30px;"|[[Image:Location arithmetic diagonal.svg]] | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic two counters.svg]] | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| |} Now we make the same moves we did for addition. Replace two counters on a square with one to its left. If the square is on the left column, replace two counters with one ''above'' it. Recall that the value of a square doubles if you move up, so this does not change the value on the grid. Let's first replace the two counters on the second square at the bottom with one to its left which leaves two counters at the corner. {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="width:30px;"|[[Image:Location arithmetic two counters.svg]] | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| |} Finally, replace the two counters on the corner with one above it and "read off" the binary number in an L-shaped fashion, starting from the top left down to the bottom left corner, and then over to the bottom right. {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |+ '''Result 11000110''' |- style="height:30px; background-color: silver;" | style="background-color: white;" | | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | '''1''' | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | '''1''' | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"|[[Image:Location arithmetic one counter.svg]] | style="width:30px;"| |- style="height:30px; background-color:white; color: black;" | style="width:30px;"| | style="width:30px;"|'''0''' | style="width:30px;"|'''0''' | style="width:30px;"|'''0''' | style="width:30px;"|'''1''' | style="width:30px;"|'''1''' | style="width:30px;"|'''0''' |} Read the counters along the L but do not double count the corner square. You will read the binary result 11000110 = 198 which is indeed 22*9. Why can we read the binary number in this L-shaped fashion? The bottom row is of course just the first six powers of two, but notice that the leftmost column has the next five powers of two. So we can directly read off an 11 digit binary number from the L-shaped set of 11 squares that lie along the left and bottom sides of the grid. {| border="0" cellpadding="0" cellspacing="1" style="text-align:center; background-color: white; color: black;" |- style="height:30px; background-color: silver;" | style="background-color: white;" | 1024 | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | 512 | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | 256 | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | 128 | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | 64 | style="width:30px;"|β | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| | style="width:30px;"| |- style="height:30px; background-color: silver;" | style="background-color: white;" | | style="width:30px;"|β | style="width:30px;"|β | style="width:30px;"|β | style="width:30px;"|β | style="width:30px;"|β | style="width:30px;"|β |- style="height:30px; background-color:white; color: black;" | | style="width:30px;"|32 | style="width:30px;"|16 | style="width:30px;"|8 | style="width:30px;"|4 | style="width:30px;"|2 | style="width:30px;"|1 |} Our small 6x6 grid can only multiply numbers each up to 63, and in general an ''n''x''n'' grid can multiply two numbers each up to 2<sup>''n''</sup>-1. This scales very fast, so board with 20 numbers per side, for instance, can multiply numbers each up to a little over one million.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)