Binary Numbers


Yes
. I know this is my first post.
Yes. I know it is about binary numbers.

David: Guess what I did today?
You Guys: What?
David: I taught myself how to read binary numbers.

So here it goes:

Binary Numbers work on the base 2 system. We are used to counting with a base 10 system. For example:

12 has two numbers. A 1 and a 2. 2 is in the first column. The “one” column.
Every column to the left of this goes up by a multiple of 10 (base 10).
Hence, 12 has ONE ten and TWO ones.

So far so good right? Now for binaries.

Binary numbers can only be 0 or 1.
The first column is the “one” column.
Every column to the left of this goes up by a multiple of 2 (base 2).
Hence, 11 in binary is equal to 3.
11 has ONE two and ONE one.

Got it? Good. So when dealing with computers (usually 8-bit binaries)

128 64 32 16 8 4 2 1
—————————-
0 0 0 0 0 0 0 0 = 0
1 1 1 1 1 1 1 1 = 255 (128+64+32+16+8+4+2+1)

OK. Then what about 10101010?

128 64 32 16 8 4 2 1
—————————-
1 0 1 0 1 0 1 0 = 170 (128+32+8+2)

What about going the other way?? Easy. Let’s take 159.

Divide 159 by 2. (base 2, remember?) = ONE 128 with 31 remaining.
Divide 31 by 2. = ONE 16 with 15 remaining.
Divide 15 by 2. = ONE 8 with 7 remaining.
Divide 7 by 4. = ONE 4 with 3 remaining.
Divide 3 by 2. = ONE 2 with 1 remaining.

Therefore it must be:

128 64 32 16 8 4 2 1
—————————-
1 0 0 1 1 1 1 1 = 159 (128+16+8+4+2+1)

To summarize, here is a chart I pulled.

Base 2 = Base 10
0 = 0
1 = 1
10 = 2
11 = 3
100 = 4
101 = 5
110 = 6
111 = 7
1000 = 8
1001 = 9
1010 = 10
1011 = 11
1100 = 12
1101 = 13
1110 = 14
1111 = 15

Interestingly enough, and this IS a tangent, it really comes into play with subnet masks.

There are a couple intresting things about subnet masks. They don’t really behave like you would initially expect them to. The numbers of a subnet mask count ip addresses that are not there. This means higher the numbers of a subnet mask are the less ip addresses belong to it.

For example:
255.255.255.255 = There are no ip addresses in this range.
0.0.0.0 = This is the range of all ip addresses.

The rest of this article is also pulled.

Lets take one of the most basic subnets the 255.255.255.0 one, and see how many addresses are in it’s range. The first step is to put the subnet into binary. Let go ahead and do that now. If you don’t know how to put something into binary read Binary Numbers for more information.

11111111.11111111.11111111.00000000 = 255.255.255.0

So how do we find out how many ip addresses are in this group? Well its rather simple actually. Just count the number of zeros, and then take 2 to the number of zeros power. In this case it would be 2^8 = 256. Another way to do it is to multiply 2 times itself 7 times. 2*2*2*2*2*2*2*2=256 So we have two hundred and fifty six ip addresses in that range! Another thing that is intresting to know. Subnets will always be all ones on one side, and all zeros on the other. I mean that they will always look like 111111000000 and never like 1010101101.

Lets take a closer look at what a group of ip addresses looks like. Using the 255.255.255.0 subnet from above let me make a table.

192.168.1.0 – Subnet Address
192.168.1.1 – usually the gateway
192.168.1.2
192.168.1.3
192.168.1.4
192.168.1.5
192.168.1.6

192.168.1.252
192.168.1.253
192.168.1.254
192.168.1.255 – Broadcast Address

Every group of ip addresses, has a Subnet Address, Broadcast Address, and Gateway. Both the Subnet Address ip address and the Broadcast Address ip address are used to send information to every ip address in the group. The Gateway acts sort of like the group’s controller. For instance, let’s say that your computer is on the ip address 192.168.1.3. When you send send information to the internet, your computer sends data to the gateway. Then the gateway sends that data on to the internet. The same thing is true when you get data from the internet. The internet sends data to the gateway, and then the gateway passes that information on to your computer. The gateway can be on any ip address in the range. Usually it is on the second ip address in the range, or the second ip address from the end of the range. The Subnet Address is always on the first ip address in the range, and the Broadcast Address is always on the last one in the range.

Okay I’m going to change our subnet from 255.255.255.0 to 255.255.255.240. Lets say the ip address of our computer is 192.168.1.132. How many ip addresses do we have? Well lets convert the subnet to binary. You should get the following binary subnet.

11111111.11111111.11111111.11110000

Okay, we have four zeros. So take 2^4 which equals 16. Alternatively 2*2*2*2 equals 16 as well. We have 16 ip addresses in our range. Well lets draw out our table. We can’t draw our ip address table without knowing where the range starts. This is how you figure that out. We take our subnet and AND it to our ip address converted into binary. Go ahead and conver our ip address into binary. You should get the following.

11000000.10101000.00000001.10000100 = 192.168.1.132

Now we AND that with our subnet. It is easy to think of ANDing as finding the truth of two numbers. Every 1 is true and every 0 is false.

True and true is true! 1 and 1 is 1.
True and false is false. 1 and 0 is 0.
False and true is false. 0 and 1 is 0.
False and false is false. 0 and 0 is 0.

So lets line up our subnet and our ip address.

11000000.10101000.00000001.10000100 = 192.168.1.132
11111111.11111111.11111111.11110000 = 255.255.255.240
———————————–
11000000.10101000.00000001.10000000

So look at the first column. We have a 1 and a 1. 1(true) and 1(true) = 1(true) The next column is the same thing. The thrid column is a 0 and a 1. 0(false) and 1(true) = 0(false). Continue doing that for the whole number. Now that we have our result lets take it and convert it back to base 10, so we can get the first ip address in our range.

11000000.10101000.00000001.10000000 = 192.168.1.128

Great! Now that we have our first ip address and we know that we have 16 ip addresses, we can make our table.

192.168.1.128 – Subnet Address
192.168.1.129 – Gateway
192.168.1.130 –
192.168.1.131 –
192.168.1.132 – Our computer!
192.168.1.133 –
192.168.1.134 –
192.168.1.135 –
192.168.1.136 –
192.168.1.137 –
192.168.1.138 –
192.168.1.139 –
192.168.1.140 –
192.168.1.141 –
192.168.1.142 –
192.168.1.1

43 – Broadcast Address

Makes you think.
That is all.

Japanese Candies

First there was “The Mountain of Mushrooms” chocolate mushroom candy.

Chocolate Mushrooms Picture

and then there was “The field of Bamboo shoots” chocolate bamboo shoot (possibly acorns) candy.

Chocolate Bamboo Shoots Picture

… and now, ranked as my new favourite Japanese candy, I am proud to announce “Chocolate Tree Stumps.”

Chocolate Tree Stumps Picture

They are so good. No joke. Really really good. They can only be outdone by the extra large Mountain of Mushrooms I found in the convenience store a few months ago. It was like 200 yen for 4 of them, but they were really really good.

White Day … and Shogi!

What the hell is White Day you ask? It is March 14th, one month after Valentines Day! You see, in Japan, on Valentines Day, Japanese girls give chocolate to the boys. Boyfriends, Husbands, Fathers, Male Employees…. everyone! (size depends on who is getting it. Not to mention a term they have for “pity chocolate” which is what they give to people they don’t want to give chocolate to… because they have to… because its Japan.)

Look what Kiko got me for Valentines Day!!!

My present from Kiko for valentines day

At any rate, on White Day the boys are expected to return the favour with candy. Chocolate isn’t the right thing to give on White Day. No… on white day everyone that you got chocolate from has to get a special treat which is usually decided by the Japanese Confectionary Companies. This year it was marshmellow.

Also remember how I was telling you about Shogi???!! In case you don’t, its the Japanese equivalent of Chess only a thousand times better. Anyways I am also going to start playing Chu-shogi (middle shogi). Imagine Shogi, but with a thousand billion more pieces. Here is a game I setup but we didn’t play… because it took to long to setup… because there were too many pieces.

Jim and I's Chu-Shogi setup!

Now go look at the Shogi link, learn how to play, and I will buy you a set!!! (Mike, we are playing next time I see you!!!)

I know you guys aren’t going to like this…

… because there are no pictures. In fact, you might not even read this.

At any rate, I am doing a pre-update of an update scheduled for tomorrow. What is Tomorrow? Tomorrow is the day Franz comes to Japan and I take him around. 10 days of action packed excitement.

In case anyone is curious we will be going to:

Osaka -> Nara -> Kyoto -> Himeji -> Kagawa (my home!) -> Nagoya -> Yamanashi (Mt. Fuji’s home!) -> Tokyo

Crap. That’s a long and very expensive trip. Whoever else is reading this, please know that when you come to Japan I will be happy to show you around as well! The important thing to remember is that you can only spend so much time in Chunan without going crazy.

At any rate, other than that… things are good! My new computer should be here soon and those problems will be fixed. We are moving to medium-high speed Internet by the end of April and this 10 day vacation should give me the much needed rest (even though it is bound to stress me out because Franz is stressful.)

Where is Shane? I don’t know because he doesn’t answer my e-mails.
Where are my friends? I don’t know because I don’t e-mail anyone. (Sorry!)

… Why am I rewriting the homepage from scratch? Because I am a loser.

Now send me some love.

David

Lots of Good News!

It looks like we will be getting back (semi)hi-speed Internet in April. It is not nearly as fast as what we were using, but is much faster than the ISDN line we have now. The website will be updated, and our VOIP (416) phone will be back in operation… so now you have no excuse for not calling

Kiko’s older brother, Takao, father of the super cute Hina and Kana:

Our nieces, Hina and Kana

(Takao) just had another baby. His name is Shuichiro! We haven’t got pictures yet,but when we do we will post them!

In other, less exciting news, Graduation photos came in from one of my other schools, along with another small write up in the Shikoku Newspaper. Have a look.

East Elementary SchoolEast Elementary School

Article about me in the newspaper

Shane’s Movie Debut

I’ve finally gotten off my lazy butt and started the new site. (Along with a few other surprises.) I am also debating buying a new camera, and building a MythBox. Wish me luck. By June I hope to have completely switched off of Windows for Linux.

There will be a new movie section where Kiko and I take little clips of things that are happening around us. As there is still a ways to go before davidandkiko.com 3.0, here is a sneak peak.

The Wonder of Shane     The Wonder of Shane part 2

My Fan Mail…

Ever since Kiko and I moved to our new house, we have stalkers.

Well… I have stalkers. Two little girls from one of my elementary schools. One of them follows me around and calls me fat (a play on the name “dave” in Japanese. They pronounce “Dave” = “De-bu” and if you shorten it to “debu” it becomes the Japanese word for fat.)

Incidentally, I also made her cry one day by implying she was a little hefty herself. The other one dresses up in make up and ho boots and comes to my house. She also regularily lifts her skirt while I am teaching.

They are cute.

At any rate, every weekend they come to our house and leave me homemade chocolates and homemade candles. I usually send Kiko to the door to dissapoint them by having her say that I am not home.

Here is a note they recently left me:

A love note to me

It reads (in Romaji, Japanese written with English characters) “Dear David. You speak English very well. Please continue to teach us. From Haruna (fatty) and Kazuki (ho boots.)”

I was also surprised to look at the chalkboard at the back of the classroom and see this:

A chalkboard picture of me!

The blond hair gave it away. Note that I am also saying realistic English sentences (which I am sure I say all the time!) such as: “Hello.” “English!” “My name is …” “Orange” and “Red”.

This just makes me laugh. It was a sign below the shampoo and soaps at a hotel Kiko and I stayed at when we went to Matsuyama last weekend.

A funny sign in a hotel we stayed at
“We make up for deficiency.”

School Photos

We are in the process of redesigning and updating the main page, so updates have been few and far between. (Well, big updates anyways!) But we visit everyday, and Kiko is always excited when someone leaves a message or a note in the guestbook. Comments on the pictures are always nice too!

Here are some pictures from one of the schools that I teach at, and where Kiko has her part time job. This job ends in April and we are on the hunt for her next job!

Picture from North-Chunan Elementary School Picture from North-Chunan Elementary School

Next is a picture of the children that are in the tea ceremony club. Look at them in their gear!

Picture of the kids in the tea ceremony club

Below is a picture from our towns sejinshiki (Coming of Age Ceremony). This is when all the children turning 20 dress up in kimonos and become adults. I thought someone somewhere might find it interesting.

Picture from the Coming of Age Ceremony

(Chris: Convenience store pictures are coming!!)

An Update…

Hey Everyone!

Just a small update. Yes we are still alive. The site is constantly being updated, but just not where it makes any big difference 🙂 There are a couple of new galleries, but they are only available if you go to the “main gallery“. Check it out!

We are just putting the last touches on the new house, and our internet is slow. very very very slow. Most of the site updates and pictures will have to be done from work. Kiko is taking pictures of the house as we speak, and we will have them up soon.

We’re here… we’re alive and we miss you lots. There will be a number of new galleries coming online over the next few days and a big overhaul in March.

love
David & Kiko

ps. No pictures… so maybe no one will read this 😉