Computers and computer systems
Computers and computer systems

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Computers and computer systems

4 Representing data and instructions inside a computer

4.1 Switches

I have just indicated that a processor is made up of millions of electronic components manufactured as one very complex circuit. The majority of these components act as switches that can exist in one of only two states, either on or off. The states of certain switches tell the processor what instructions to carry out. Also when a processor is running a program it is altering the state of other switches, switching them on and off many, many times a second.

To represent more easily what is happening to the states of these switches, the ‘off state is often referred to as 0, and the ‘on’ state as 1.

Imagine eight switches in the following states:


The states of these switches can be written down concisely as the 8-digit code 10001110, where the digit on the extreme left represents the state of the leftmost switch and so on through to the digit on the extreme right representing the state of the rightmost switch.

If, for example, the state of these switches at any time represented an instruction for a processor to execute, then 10001110 would cause one particular instruction to be executed and 10100001 another. (These instructions can also be represented in shorthand, so a list of instructions doesn't have to be tediously written down as many 1s and 0s.)

The code 10001110 is made up of 8 digits. In computing terminology, because each digit can only take one of two values (either 1 or 0), each digit is referred to as a ‘binary digit’. This is almost always abbreviated to bit. Therefore I can say 10001110 is an 8-bit code. As the code is in binary it is termed a binary code, so 10001110 is an 8-bit binary code.

Three switches in the following states would represent the 3-bit binary code 100:


Activity 4 (Exploratory)

Write down as many 2-bit binary codes as you can think of.


There are four possible 2-bit binary codes: 00, 01, 10 and 11.

This representation using 1s and 0s is very convenient. It makes it possible to write down what conditions exist inside the processor without having to deal with the complexities of the voltages and currents that exist to make the switches enter their on and off states. (If you could peer inside a processor you would not see 1s and 0s written down!)

Using binary codes is a very easy way to describe the state of the switches inside the processor, and allows people to represent what the electronic circuits that make up the processor are doing without having to understand how such circuits operate.


Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371