CS 130 Lab #3: Binary conversion, via "programming"


In this lab you will "write a program" to do conversion to binary numerals (and other bases as well) using a spreadsheet (Microsoft Excel will do, and is installed on the lab machines, although you could use any spreadsheet).

The goals of this third lab of the course are as follows:


Here are some concepts that will be introduced briefly during lecture and which you will find useful in developing your spreadsheet; you will be expected to fill out the background on these concepts by reading documentation on the spreadsheet program. You may also wish to use various formatting options (font, color, number, border) to make your spreadsheet easier to read and understand.

A binary converter

For the lab you should write a binary converter in a spreadsheet, as demonstrated in class (we will generalize to other bases below). There should be room for an input, for a reasonably large row of binary digits and a cell for a "check", i.e., a calculation which checks the accuracy of your answer by re-computing the total value and displaying it in decimal.

So, you might want to use the following strategy:

Here's a picture showing what your final lab might look like (you don't need to follow this format exactly, in terms of fonts and colors for example, but the main features should all be there):

Abstracting out the base

Once you have gotten your program to work for a base of 2, you should go through and re-write it so that the program works with any base specified by the user (in some fixed, labeled cell).

Results to demo

A spreadsheet which can convert any number into a series of digits in any base, and which checks its own work by calculating the summed value of those digits in the given base and re-displaying the result in decimal.