This lab is short, like the last one, but is more focused on technical issues and will probably be more challenging, at least for some students.

**Due date:** please have your answers to the questions below available
by the end of lab on **Monday 6 February**.

We will therefore use your name and birthdate to generate some numbers that are uniquely yours: let's call them your "small number" and your "large number":

- to generate your small number, take the number of the month you were
born in, drop any first digit, and append the day you were born on on
that month, including a leading zero if the day number is less than 10.

For example, if you were born on November 5th, your number is 105, where the leading "1" has been dropped from month number 11, and the leading zero inserted since 5 is less than 10. (March 31st would yield 331.) - to generate your large number, take the initials of your first and last name and figure out which letters of the alphabet they are (my initials are "FR", so the numbers are 6 and 18). If the first number is less than 10 (one digit), put a 1 in front of it. If the second number is less than 10, put a 3 in front of it. Now put the two numbers together, side by side, to get your "large number" (so I would get 1618).

- The Wikipedia on the binary numeral system
- A binary counter graphic
- A binary-decimal converter
- A conversion game
- Some thoughts on the Korean flag
- A Virginia Tech tutorial (look at I, II.A and II.B)
- A post on the Laputan Logic blog

Now add the two numbers together, in binary, being careful to show all your work in the tabular format usual for addition (i.e., numbers right-aligned, digits in columns, "carries" shown in the usual way, etc.). Be prepared to show this work during your demo, and perhaps to do some more binary addition "live".(Yes, yes, the large number in particular will no doubt involve an annoyingly large number of binary digits. But one of the hidden purposes behind this lab is to motivate ways of "abbreviating" large binary numbers so that they can be written and remembered more efficiently, but also easily converted back to their original binary form.)

*
If you have trouble adding the two numbers together, look again at the
reference material above. Remember that it's
just like adding numbers in decimal, working place by place from right to left,
except there are fewer cases to handle:
*

- 0 and 0: write down a 0;
- 0 and 1 (or 1 and 0): write down a 1;
- 1 and 1: write down a 0, but carry the 1 (1 and 1 make 2, which in binary is "10");
- if you have to add in a carry, it either reduces to one of the previous cases or (horrors!) you have 1 carry plus 1 and 1: this makes 3, which in binary is "11", so ...: write down a 1 and carry a 1.

We lay out two numbers, one above the other, aligning their digits so that they are flush to the right. We then proceed through the digits of the lower number from right to left. For each digit, we multiply this digit by the upper number, and write it down below the line, remembering to move the result one place to the left each time. Now we add the columns of digits together, writing down the rightmost digit of the result and carrying any other digits into the next column:

Multiplying binary numbers is almost the same, except easier:

- when we multiply by a 1 digit, we can just
*copy*the other number into the result. - when we multiply be a 0 digit, we can just write a zero line in the result
(just like in decimal, but it comes up more often in binary!).
- of course, we still move successive results to the left and then add the columns; this last part is only a little harder, since you may not be used to adding binary in your head. But just count the number of 1 digits, convert this (small) number to binary, then write down the rightmost bit and carry the rest (you can even write the carries in decimal, if you like; I used binary carries in the picture just for fun).

- your large and small numbers, in decimal and binary forms;
- the addition of these two numbers in binary, written out in full,
in columns, with carries, etc.
- the ability to add two smallish numbers in binary "on demand";
- the multiplication of your two numbers in binary, written out in full;
- your large number (in decimal) multiplied by eight (in decimal),
written out in full;
- knowledge (based on experience) of how a number in binary can be multiplied by eight very quickly.