Logout

3.5.1 Outline the use of binary to represent data.

 

Teaching Note:
Students must understand the relationship between number of digits
and number of patterns available (2n, for example: 4-bit colour
representation allows 16 colours; a 32-bit address bus can address
4GB RAM). The different features of ASCII and Unicode should be
known but students are not expected to know the specific
representations of characters.

JSR Notes:

The assessment statement itself is pretty broad, but we've gone over this idea pretty broadly too, over the course of the year. And the textbook does a pretty good job of conveying the key concepts. And really there are two: that binary makes perfect sense for a machine that can fundamentally only work with two states of electricity, and that in this system, when we add a digit, we double the number of things that can be represented.

And I hope you've got both those points down pat by now. But if one of the two hasn't quite sunk in yet, it's the later. So here's a visual for you. Here are all the possible combinations of 0s and 1s you can have in a 3 bit system:

000
001
010
011
100
101
110
111

If we add one more bit, we will double the number of combinations of 0s and 1s we can represent. Basically, I'm just going to copy and paste twice, the above combinations, but for those pasted second, and then I'll past a bunch of 0s at the front of the first paste, and a bunch of 1s at the front of the second paste. Voila. Doubled.

0 000
0 001
0 010
0 011
0 100
0 101
0 110
0 111

1 000
1 001
1 010
1 011
1 100
1 101
1 110
1 111

In terms of the teaching note, I mentioned the other day that knowing that a 32 bit system has a limit of 4GB should be common knowledge - well maybe not for the average Joe walking down the street, but certainly for the average IB CS Joe. It's right there. As is the example that 4-bit color represents 2 ^ 4 different colors.

Don't be thrown off by the text and it's combinations of colors representing color intensity of each RGB value. The thing is with that example, that it's more realistically assuming different Red Green and Blue values. So if ***each*** of those is represented by a 4-bit binary number, you would indeed have 2 ^ 4 x 2 ^ 4 x 2 ^ 4 combinations. And in fact, what you're looking at in Photoshop etc. is 8 bits used for each of the RG and B values (for monitor only display), or each of the CMYK (Cyan Magenta, Yellow and BlacK) values if in a printing environment. So the calculation is 2 ^ 8 x 2 ^ 8 x 2 ^ 8 (RGB), i.e. 2 ^ 24 different colors, or 2 ^ 8 x 2 ^ 8 x 2 ^ 8 x 2 ^ 8 (CMYK), i.e. 2 ^ 32 - which we know is about 4 billion different colors.

Refer back to my "How Computers Work..." document if you need extra clarification and/or confirmation of any of this binary stuff.