EMAT 6690: Using Computers in Mathematics Instruction

Article #2: Using Microsoft Excel® for the Arithmetic of Different Number Base

By Ryan Fox

 

            My motivation for creating this came from my experience as my school’s Math Team coach.  A seemingly frequent question that was asked was to add or subtract two numbers in a different base: 4318 – 3758 being one such example.  I was surprised how attached to the typical decimal number base my very bright and motivated high school students were that they could not think in different bases.  My hope for this article is to use the computer software program to motivate ways to think of a decimal conversion of a number in a different base, so that the students would connect the number in a new number base to its decimal equivalent, and to get the students to begin arithmetic operations within the new number base. 

 

            The Excel spreadsheet program already does some work with different number bases.  The program can convert numbers within three additional number bases: binary (base 2), octonary (base 8), and hexadecimal (base 16).  My goal will be to try to increase the number bases that are available.  My current intentions would be to do as much work as possible with bases between 3 and 9, with possible extensions to bases that are greater than 10. 

 

Part I: Understanding the New Number Base

 

            It was my impression that my students thought of place value very rigidly.  The terminology “ones”, “tens”, “hundreds”, “thousands”, and so on were so strictly constructed that the students did not necessarily make the connection between one and 100, tens and 101, hundreds and 102, thousands and 103, and so on.  To me, making this connection is critical; once the student understands that the place value is really 10 raised to these powers, place value almost becomes arbitrary.  Why is it that it is 10 raised to every power?  Why not 8, or 3, or 12?  Once I could get the students to think this way, I think I could explain new number bases this way.

            It is at this point I want to introduce to the Microsoft Excel program.  I am using Excel, although any spreadsheet program would suffice.  The first connection I want make is to show how a different number base would make a decimal place value number.  One could follow the link to the spreadsheet, while I provide a rationale to my constructed worksheet below:

 

 

 

Base System=

 

2

 

 

 

 

 

 

 

 

 

 

 

Eighth

Seventh

Sixth

Fifth

Fourth

Third

Second

First

Decimal #

0

1

1

1

0

0

1

1

115

 

 

 

 

 

 

 

In the top cell listed after “Base System =”, I wanted to give the students an opportunity to pick any base system that wanted to work with.  (Currently my plan only works for number bases less than 10.  The addition of letters to represent 11, 12, 13, etc. in a single place value is something I need to work on.)  The students could then put the number from the different number system in the cells on the bottom row.  I put the generic label “First”, “Second”, “Third”, etc., instead “Ones”, “Tens”, “Hundreds”, etc., not to confound the students’ investigation of the new base with their firm understanding of the decimal place value system.  Students could see what value a number in the new number base system has in relation to the decimal system.  Students could type in the first eight digits of the new number into these cells.  The spreadsheet program would generate the decimal equivalent to that number.  In the example listed above, 11100112 = 115 in the typical decimal form. 

            What is happening in this table is the spreadsheet program is using the number entered at the top of the table as the number base.  The “First” digit used in this table is the “ones” place value, just like it is in the decimal place value system.  However, looking at the “Second” digit is where the spreadsheet takes the value entered by the student and raises it to the first power.  In the example above, the “Second” place value, represents the “twos” place value.  To convert to decimal values, having a 1 in the “twos” column is the decimal equivalent of 2, which is found by multiplying the 1 the student entered by 21 that is represented by the “Second” column.  The “Third” digit represents the value of the base raised to the second power.  Once again, in the above example, the “Third” place value would be the “fours” place, since 22 = 4.  This pattern continues for the remaining 5 place values in our spreadsheet.  For example, in the example above, 1 in the “Sixth” place corresponds to a decimal value of 32, since the “Sixth” place refers to the base number being raised to the 5th power, 25 = 32 (in decimal form).  Just like in the decimal place value of natural numbers, the number in the nth position from the right represents the base number being raised to the (n – 1)st power.   

            For clarification, and maybe to strengthen the understanding of place value, immediately underneath the “First”, “Second, “Third”, etc., columns, I placed the new place value that the students selected.  In the example above, we could say a little more clearly now that the “First” column represents the Ones place, the “Second” column represents the Two places, the “Third” column represents the Fours place, and so down the line. 

 

Part II: Converting Back to Decimal Numbers

 

            What I am hoping to do in this portion of the spreadsheet is to strengthen the connection back and forth between the two number bases.  As a result, the second worksheet is to take a number in the decimal system and give its equivalent form in the new number base. 

            An example of the spreadsheet printout is given below.

 

 

 

Base System=

 

8

 

 

 

 

 

Decimal Number =

 

4000000

 

 

Eighth

Seventh

Sixth

Fifth

Fourth

Third

Second

First

Decimal #

2097152

262144

32768

4096

512

64

8

1

 

1

7

2

0

4

4

0

0

4000000

           

 

           

 

 

 

The first entry is to give the new number base system in which the students will be working.  Currently, the only selections of numbers a student can enter are integer values between 2 and 9.  (The number 10 could be a selection, however there would be nothing significant about this selection.)  The entry below that is the decimal number that will be converted to the new number system. 

            Each of the columns underneath these two numbers represents the different place values for the new number base.  The spreadsheet works for all decimal numbers that are less than the expression new number base raised to the ninth power.  The “first” place value gives the ones place value of the decimal number converted to the new number base.  For the rest of the place values, I had to work backwards.  Each place value that listed as the nth place value in the third row of the spreadsheet, is equal to the new base being raised to the (n – 1)st power, which means for this particular example, the fifth place value represents the 4096s place, where 4096 = 84.  Each corresponding entry in the fifth row of the spreadsheet represents the number of units from that place value.  The decimal value 4,000,000 can be written in base eight as the following sum of the powers of 8: 

Once we represented the decimal number four million in terms of the powers of 8, we can then write the number in terms of the new number base. 


 

Part III: Learning to Add in the New Number Base

Now that the groundwork has been laid for understanding the new numbers in terms of the familiar decimal numbers, we can focus our attention to the arithmetic of the new number system.  Before getting too involved in addition of the two numbers, we might want to develop addition tables much in the same manner addition tables were traditionally taught.  Students have a familiarity that in the decimal system 5 + 4 = 9, but what does five plus four equal in base six (5 + 4 = ?6)?  At this point, I have introduced the addition table for the new number system.  An example of such is given below:

 

 

 

 

 

Base #

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

+

0

1

2

3

4

5

6

7

8

9

0

0

1

2

3

4

5

6

7

*

*

1

1

2

3

4

5

6

7

10

*

*

2

2

3

4

5

6

7

10

11

*

*

3

3

4

5

6

7

10

11

12

*

*

4

4

5

6

7

10

11

12

13

*

*

5

5

6

7

10

11

12

13

14

*

*

6

6

7

10

11

12

13

14

15

*

*

7

7

10

11

12

13

14

15

16

*

*

8

*

*

*

*

*

*

*

*

*

*

9

*

*

*

*

*

*

*

*

*

*

            This table was designed to look like the familiar addition table for adding two single-digit decimal numbers.  Those numbers are represented in bold in the above table.  If the number in the entry of the table is at least as big as the new number base, then an asterisk (*) is placed in the corresponding entry.  For this particular table, any entry that is either the 8 or 9 row or 8 or 9 column has an asterisk since 8 = 8 and 9 > 8.  At this point we will add the single-digit numbers of the new number base together.  The sum is also given in the new number base.  As a result, while most students would be able to recite the fact that 3 + 7 = 10 in the decimal number system the sum would appear to have a different result in the new number base of 8: 38 + 78 = 128.  If a student were to have particular difficulties with the addition number system, a suggestion would be to have the student figure the sum in the familiar decimal form then use a preceding worksheet to convert that decimal number into the new number base.    This particular worksheet will be useful when the student is able to determine the sum of multi-digit numbers in the new number base. 

 

Part IV: Learning to Multiply in the New Number Base

 

            Once addition made sense to the students, I wanted to move to multiplication.  I would believe, based on the level of the students I am intending for these spreadsheets, that subtraction would naturally follow from addition.  Also, in my progression of spreadsheets, I wanted the multiplication table to follow the addition table so that the tables were presented before any calculations were performed.

            I wanted to design a multiplication table that reminded the students of the multiplication of the decimal numbers they were familiar with.  Like the addition spreadsheet in the previous part, we will indicate when the numbers in the table are too

large for the new number base.  One example of a multiplication table is provided below.

The multiplication table provides an additional challenge compared to the addition table.  In the addition table, the only possible value for the second digit was 1; in the multiplication table, all numbers in that base are possible for the second digit. 

 

 

 

 

 

Base #

9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

0

1

2

3

4

5

6

7

8

9

0

0

0

0

0

0

0

0

0

0

*

1

0

1

2

3

4

5

6

7

8

*

2

0

2

4

6

8

11

13

15

17

*

3

0

3

6

10

13

16

20

23

26

*

4

0

4

8

13

17

22

26

31

35

*

5

0

5

11

16

22

27

33

38

44

*

6

0

6

13

20

26

33

40

46

53

*

7

0

7

15

23

31

38

46

54

62

*

8

0

8

17

26

35

44

53

62

71

*

9

*

*

*

*

*

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Part V: Adding Multi-digit Numbers

            The next thing I wanted to focus on was the addition of any two numbers in the new number base, provided that the numbers are eight digits in length or less.  I chose eight digits because of the size of the cells I selected to fit on one page.  Additionally, I believe the concept could easily be extended to larger numbers without being addressed in this spreadsheet.

 

 

 

 

 

Base System=

5

 

 

 

 

 

 

 

 

 

 

 

 

Eighth Place

Seventh Pl.

Sixth Place

Fifth Place

Fourth Place

Third Place

Second Pl.

First Place

 

78125

15625

3125

625

125

25

5

1

1st Number

2

3

4

0

1

1

3

4

2nd Number

3

1

2

4

3

2

1

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sum 1st Pl.

0

4

1

4

4

3

4

2

Sum 2nd Pl.

1

0

1

0

0

0

0

1

After Carrying…

 

 

 

 

 

 

 

1

0

0

1

4

4

3

0

2

0

0

1

0

0

0

0

1

0

Final Sum

 

 

 

 

 

 

 

 

Ninth Place

Eighth Place

Seventh Pl.

Sixth Place

Fifth Place

Fourth Place

Third Place

Second Pl.

First Place

390625

78125

15625

3125

625

125

25

5

1

1

1

0

1

4

4

4

0

2

           

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The first choice the student has to make is the value of the new number base.  Right now, the spreadsheet is set up for number bases less than 10.  I believe that bases greater than 10 could be created using logic statements.  After the selection of the new number base, I give the student the opportunity to enter the two addends that they would like to compute.  Right now, a student could insert a number larger than the base value and it would still compute the sum.  Above the two addends, I have given the student a chance to see the new place value.  This way, the student could see the new place value and hopefully visualize each place value in terms of the new number system, and not “ones”, “tens”, “hundreds”, and so forth.  I made each column color-coordinated so that the student may see the place values in the work that the spreadsheet is doing for them.

 

            Once the student has entered the place value and the addends, the spreadsheet program pretty much does the rest.  The resulting output shows the steps that are necessary to arrive at the final sum.  The first calculation that is being performed is the sum of the two addends being represented in terms of the new number base.  Referring back to the addition table in the earlier spreadsheet can check the sums.  A problem for this spreadsheet that was not a problem in the addition table spreadsheet is how this particular spreadsheet handles “carrying”.  In the example from above, if we look at the “ones” 45 + 35 =125, while this is not a problem in the addition table, we must account for the additional five that this sum has created.  We must move the one additional five to the next place value.  In this spreadsheet, we have represented 125 as 2 “ones” (in the yellow box) and 1 “five” (in the teal box immediately below the yellow box).  The staggering of  colors in the second group of boxes represent the “carrying” that occurs when the sum of the two addends is greater than the number base.  At this point, we must add a second time for the “carrying” that took place in the previous step.  It is possible that the “carrying” in the previous step might yield a number larger than the base; once again, we have to perform a carrying step.  In this example, if we look at the “ones” place we have 45 + 35 = 125, which means we have 2 in the “ones” place, and an additional 1 in the “fives” place.  When we go to add the “fives” place, we are adding 3 and 1 from the addends, and then we will also add 1 from the “carrying” in the ones place.  We now have 35 + 15 +15 = 105, meaning that our carrying caused a secondary carrying. This explains the third group of boxes we have.  The method works exactly the previous set of boxes, but this group accounts for the additional carrying that might occur when the sum of the two addends is less than the value of the base and the carrying, but the carrying makes the sum at least as much as the value of the base.

            The final answer is presented at the bottom of the spreadsheet outlined in a box.  The place values for the digits in the sum are provided immediately above corresponding digits.  I did this to help encourage the students who may have a difficult time understanding this concept a quicker way to verify the solution by converting back to the familiar decimal system.  Here’s what happens if a student were to make such a comparison:

All of the conversions could be verified by using earlier spreadsheets in this program. 

 

Part VI: Subtracting Multi-digit Numbers

 

            Now we want to handle subtraction. While we were concerned with carrying in the addition spreadsheet, we must focus our attention to borrowing.  Just like with addition, we start by declaring our number base and then creating the two numbers we will subtract.  In this spreadsheet, the place values for each digit are given to help facilitate the transition from the decimal number system to the new number base.  

 

 

 

 

 

 

Base System=

5

 

 

 

 

 

 

 

 

 

 

 

 

Eighth Place

Seventh Pl.

Sixth Place

Fifth Place

Fourth Place

Third Place

Second Pl.

First Place

 

78125

15625

3125

625

125

25

5

1

1st Number

4

1

0

1

0

1

0

1

2nd Number

3

4

4

4

4

4

4

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Diff. 1st Pl.

1

2

1

2

1

2

1

2

Diff. 2nd Pl.

0

-1

-1

-1

-1

-1

-1

-1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

1

0

1

0

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

            In creating the spreadsheet for the operation of subtraction, we have to figure out a way to account for borrowing.  In addition, we had to be mindful of carrying.  In both of these instances, the operation involve one place value extends to a second place value.  If the value of the minuend is less than the value of the “first number”, then we need to account for the “borrowing” from the next higher place value to create a value that is larger than the minuend, allowing us to make the subtraction of the two integers.  To account for this in the Excel spreadsheet, we created a logical statement that said if our “second number” is larger than our “first number” then reduced the value of the next higher place value by 1.  To find the difference between the two numbers, we will subtract the “first number” (including any borrowed value) from the “second number”, which is the row listed in the spreadsheet as “Diff. 1st Pl.”.  Notice that the place values in the difference have the corresponding colors as the place values in the subtraction problem.  Had taking the difference required any “borrowing” from the next higher place value, a “-1” was placed in the row marked “Diff. 2nd Pl.” to signify as such.  The colors of the boxes in that row are staggered to emphasize that.  The final difference, represented in the final row of the spreadsheet, shows the difference after the “borrowing” had taken place.  Once again, the colors of the place values in the difference correspond to the colors of the boxes in the original numbers.

 

            If additional reinforcement were needed, we could convert the numbers back to the decimal number system and solve the subtraction problem as the student understands. 

 

 

Part VII: Multiplying Multi-digit Numbers

 

            The selection of multiplying a three-digit number by another three-digit number was completely arbitrary. The process to create my desired result was rather involved.

 

 

 

Base Number=

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Third

Second

First

 

 

 

 

1st Number

1

6

2

 

 

 

 

2nd Number

0

5

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Partial Products

2

15

4

 

 

 

 

 

5

42

13

 

 

 

 

 

0

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

4

 

 

 

 

 

1

5

 

 

 

 

 

0

2

 

 

 

 

 

 

 

1

3

 

 

 

 

 

4

2

 

 

 

 

 

0

5

 

 

 

 

 

 

 

0

0

 

 

 

 

 

0

0

 

 

 

 

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

2

6

1

4

 

 

0

0

1

0

1

0

 

 

0

1

3

0

1

4

 

 

 

 

 

 

 

 

 

            The first thing I wanted to start with was to find the product of each digit separately.  I included this portion of the spreadsheet to make the connection back to the multiplication table from an earlier worksheet.  These products are located in the 3 x 3 array next to “Partial Products”.

            The key for my developing the product of multi-digit numbers was to have the place values for the partial products in the correct location and to guarantee that any values that had to be “carried” were properly considered.  In the ones values, the place value highlighted in yellow, the only value that must be checked is the product of the ones place of each digit.  All that must be accounted for in the place value in the final product is the remainder when the base number divides the product.  Once we move to the second place value, the sevens place in the above example, the process of determining the product becomes more challenging.  There are values that contribute to the sevens place value: if the partial product was greater than the number base, the remainder when the base number divides the product of the second digit of the first number by the first digit of the second number, and the remainder when the base number divides the product of the first digit of the first number by the second digit of the second number.  Those three values are added together, for which it is possible that the sum of these three numbers is greater than the value of the number base.  As a result, the value of the second place value in the final product is equal to the remainder when the base value divides the sum of the three numbers.  If the value of the sum is greater than the number base, then there will be some “carrying” involved.  This is represented in our spreadsheet in the second column of our final answer with the red box that represents the second place value and the maroon box underneath it to represent the value that will be added to the maroon box for the third place value.  I continued this process until I arrived at my final result.

 

Part VIII: Potential Extensions: Bases Larger than 10

            I believe that this spreadsheet could be extended to double-digit bases.  The Excel program already comes understanding the hexadecimal, or base 16, number system.  Extending to double-digits would involve, in my opinion, creating logic statements so that anytime a number larger than 10 were needed, it would be converted to a letter.  For example, if we wanted to create work for base 11, we would reserve the letter “A” to represent the decimal number 10.  We could create a spreadsheet page that could help facilitate a conversion from base 11 back to base 10.  Likewise, if we wanted base 12, we would reserve “A” for the decimal number 10 and “B” for the decimal number 11.  We can continue this pattern up to base numbers of 36.  If we wanted larger base numbers, we might be tempted to include Greek letters.  The possibilities for extensions are nearly limitless.