A-level Computing/AQA/Paper 2/Fundamentals of data representation/Bits and bytes





Bits and Bytes
The language that a computer understands is very simple, so simple that it only has 2 different numbers: 1 and 0. This number system is called Binary. This is because 1 represents high voltage and 0 to represent low voltage.

A 1 or 0 is called a Bit which is short for BInary DigiT. This is the fundamental unit of information.

Everything you see on a computer, images, sounds, games, text, videos, spreadsheets, websites etc. Whatever it is, it will be stored as a string of ones and zeroes.

How many different patterns can be made from 4 bits? 24 = 16 different patterns or combinations can be created

Minimum and Maximum Number vs. Number of Different Values
Know that in unsigned binary the minimum and maximum values for a given number of bits, n, are 0 and 2n -1 respectively.

A common question that you'll need to know the answer to, and one that many people get wrong, is a question about the minimum and maximum denary value you can store in a set number of binary digits.

If I were to have 3 binary digits, the minimum value I could store would be 0002 = 0. Whereas, the maximum value that I could store would be 1112, this equates to 4 + 2 + 1 = 710. So for 3 binary digits the range of numbers I can store is 0 (minimum) to 7 (maximum).

Know that the 2n different values can be represented with n bits.

A similar, but different question, is how many different binary patterns (and therefore values) can you represent with a set number of binary digits. If I were to be asked how many binary patterns can be represented from 3 binary digits, then we have 8 options: We could count these all out and write down: "There are 8 different values 3 binary digits can take". But this isn't very clever, what is you wanted to find out the range and maximum values for 34 bits, you can't be expected to write them all out.
 * 1) 000
 * 2) 001
 * 3) 010
 * 4) 011
 * 5) 100
 * 6) 101
 * 7) 110
 * 8) 111

We are looking for a rule to save us the job and stop us making mistakes. Can you work out a rule in terms of $$n$$ for:

Maximum denary value of $$n$$ binary digits: Number of different values/binary patterns for $$n$$ binary digits:

Example
2 bits can be configured in 22 = 4 different ways. 3 bits can be configured in 23 = 8 different ways.

Give both the maximum value and number of different values for the following n binary digits:

4

Maximum : $$2^n - 1 = 2^4 - 1 = 16 - 1 = 15$$

Range : $$2^n = 2^4 = 16$$

Maximum : $$2^n - 1 = 2^5 - 1 = 32 - 1 = 31$$

Range : $$2^n = 2^5 = 32$$

Maximum : $$2^n - 1 = 2^{8} - 1 = 256 - 1 = 255$$

Range : $$2^n = 2^{8} = 256$$

Maximum : $$2^n - 1 = 2^{10} - 1 = 1024 - 1 = 1023$$

Range : $$2^n = 2^{10} = 1024$$

highest address : $$2^n - 1 = 2^6 - 1 = 64 - 1 = 63$$

Different number of addresses : $$2^n = 2^6= 64$$

This is a very popular exam question!