Analogue and Digital
If you use a dimmer switch, the electric current to the bulb changes gradually and continuously so that the bulb gradually lights up or goes out. There are lots of stages between fully on and fully off. If you use an ordinary light switch, the current does not change gradually and so the bulb is either fully on or fully off. There are only two states - on or off - with nothing in between. Try them out - click the dimmer switch or light switch to turn the bulbs on or off. The dimmer is an example of an analogue system - there is a continuous range of values. The light switch is an example of a digital sysyem - there are definite, discrete steps from one value to the next. In the light bulb example, there are only two steps but there could be more. Computers are digital devices containing millions of transistors or switches. These can be either on or off (there are two states) and all data and instructions stored and processed by a computer are represented by these two states.
If there are only two alternatives - on and off - how can complex data be represented in a computer?It would be like trying to communicate if we had only two letters in the alphabet! How many different words could you make out of only two letters? Computers use the binary system which is a numerical system that uses only two digits represented by 0 and 1. The binary digit 0 represents the off state of a switch and 1 represents the on state. The name 'binary digit' is usually shortened to the word bit. Click the light switch to change the binary digit.
On and Off
0
1  0  1  1
0  1  1  0
1 1 0  0
0  1  1  1
0  0  0  0
1  1  0  1
0  0  0  1
0  0  1  0
1  1  1  0
0  0  1  1
1 0 0  0
1  1  1  1
In order to represent items of data, computers use a combination of bits. If you combine more bits, then you will have more alternatives and be able to represent more items of data. If you use a 2 bit combination there are 4 alternatives which is 22 or 2 to the power 2. In this example there are 4 bits and so there should be 16 combinations - 24. Use the switches to turn the bulbs on and off to find all 16 combinations. When you get a new combination it will appear in the area below.
1  0  0  1
0  1  0  0
1  0  1  0
Groups of bits
0  1  0  1
23
Start
1
Bits, Bytes and Binary
22
Computers store and process data and  instructions in the form of numbers.
27
21
64
26
Computers use groups of digits to store larger numbers.A group of 8 digits (or bits) is called a Byte. The numerical value of a bit depends on its position in the byte.
20
32
25
Here is a byte...
Place Values
16
The numerical value of these bits depends upon their place values...
Byte
8
Here's the values of  all these 'two to the powers of' in our decimal system...
As computers use only two digits - 0 and 1 - they use the binary system.Humans use the decimal system which has 10 digits - 0 to 9.
Decimal
Proceed
4
Therefore, in our decimal system the byte above has the numerical value of…                    128 + 64     +     16      +       4      +       1                                 = 213   
128
24
Pause
2
Now one for you to try
Enter the two digits into the boxes below and then press the submit button.After five unsuccessful attempts, you will be ble to see the correct answer.
11011101
Submit
Well done! That is correct.
Show
What is the value of the following byte...
Convert the following decimal number into a byte.
One more...
Enter the bits into the boxes below and then press the submit button.After five unsuccessful attempts, you will be able to see the correct answer.
169