12.2 Bytes of data
You will recall from Section 6.2 that a binary digit, or bit, can have one of two values: either a 0 or a 1. In a computer, bits are assembled into groups of eight, and a group of eight bits is known as a byte. The abbreviation used for a byte is B, so 512 bytes would be written as 512 B. Although this course will use 'b' for bit and 'B' for byte, you should be aware that not everyone makes this clear distinction.
A byte of data can represent many different things in a computer. For example, a byte can represent a text character, like the letter 'a', or a number, or a space or a punctuation mark. Just to give you an idea of what this means, the phrase 'storage technology' would require 18 bytes of storage space (there are 18 characters: 17 letters and one space).
Activity 9 (self-assessment)
How many bytes would be needed to store the following phrase? information and communication technologies
11 + 3 + 13 + 12 for the letters in the words + 3 for the spaces=42 bytes.
The capacity of computer RAM is measured in bytes. A computer may. for example, have 512 megabytes of RAM. From our discussion in Section 6.2, you might expect this to be 512 million bytes. Unfortunately, things are not quite so simple. For memory and file sizes, a megabyte is 1 048 576 bytes, not 1 000 000 bytes! Similarly, a kilobyte is 1024 bytes, not 1000, and gigabyte means 1 073 741 824 bytes, not 1 000 000 000. These numbers are all 'powers of 2', which means 2 multiplied by itself a number of times. Probably no one would choose to define memory and file sizes in this way if they were starting over again today, but there are historical reasons why sizes were originally defined in this way.
As Table 2 shows, an upper-case K should be used for 'kilo' when it means 1024. This is in contrast with the lower-case k you met earlier in relation to data rates, where 'kilo' meant 1000 (see Table 1). Unfortunately not everyone sticks to this rule, and there is no such distinction made for the two versions of 'mega' and 'giga'. For these prefixes upper-case M and G are always used.
Table 2 Prefixes for file and memory sizes
|Prefix||In figures this is:||This is approximately:||Symbol|
|mega||1 048 576||A million||M|
|giga||1 073 741 824||A billion (a thousand million)||G|
Activity 10 (self-assessment)
If a kilobyte is 1024 bytes of data, how many bits of data does this represent?
There are 8 bits in a byte, and 'kilo' here means 1024. So a kilobyte is 1024×8=8192 bits.