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

From testwiki
Jump to navigation Jump to search

Template:CPTPageNavigationP2


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.

monochrome image of a smiley face
monochrome image of a smiley face

Template:Dbox Template:Dbox


Template:CPTExercise Template:CPTQuestion Template:CPTAnswer Template:CPTQuestion Template:CPTAnswer Template:CPTQuestion Template:CPTAnswer Template:CPTQuestion Template:CPTAnswer Template:CPTQuestion Template:CPTAnswer Template:CPTQuestionTabHow many different patterns can be made from 4 bits?Template:CPTQuestionTabEnd Template:CPTAnswerTab 24 = 16 different patterns or combinations can be createdTemplate:CPTAnswerTabEnd Template:Robox/Close Template:BookCat

Minimum and Maximum Number vs. Number of Different Values

Template:CPTSpecification Know that in unsigned binary the minimum and maximum values for a given number of bits, n, are 0 and 2n -1 respectively. Template:Robox/Close

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).

Template:CPTSpecification Know that the 2n different values can be represented with n bits. Template:Robox/Close

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:

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

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.

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.

2 bits 3 bits
00

01

10

11

000

001

010

011

100

101

110

111

Min = 0 Min = 0
Max = 22-1 = 3 Max = 23-1 = 7
22 = 4 23=8
4 combinations 8 combinations


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

4 Template:CPTQuestionTabEnd Template:CPTAnswerTab Maximum : 2n1=241=161=15

Range : 2n=24=16 Template:CPTAnswerTabEnd Template:CPTQuestion Template:CPTAnswerTab Maximum : 2n1=251=321=31

Range : 2n=25=32 Template:CPTAnswerTabEnd Template:CPTQuestion Template:CPTAnswerTab Maximum : 2n1=281=2561=255

Range : 2n=28=256 Template:CPTAnswerTabEnd Template:CPTQuestion Template:CPTAnswerTab Maximum : 2n1=2101=10241=1023

Range : 2n=210=1024 Template:CPTAnswerTabEnd Template:CPTQuestion Template:CPTAnswerTab highest address : 2n1=261=641=63

Different number of addresses : 2n=26=64

This is a very popular exam question! Template:CPTAnswerTabEnd Template:Robox/Close