Information Representation in a Computer
Explore how computers store and represent various forms of data using binary, including numbers, text, and images. Understand binary bits, ASCII and Unicode character encoding, and how images are mapped to binary values. This lesson builds fundamental knowledge essential for grasping data representation in computer systems and programming.
All the data in a computer, such as numbers, text, and images, is stored in binary. Binary is a number system. It has two digits: one and zero.
A binary digit is called a bit.
We will now explain how a computer stores different forms of data in binary.
Representing numbers in binary
A bit can have two values: zero or one. A bit is said to be on if it has a value of one, and it is said to be off if it has a value of zero. To represent a number greater than one, you can use a collection of bits.
In the illustration below, notice that each number is twice the number to its right.
Each number in the boxes above is represented by a bit. Suppose we have 1001 in binary. 1001 in binary means that the bit corresponding to 8 is on, the bits corresponding to 4 and 2 are off, and the bit corresponding to 1 is on. When you add all the numbers for which the bit value is 1, you get 9 in the decimal system!
In general, to find the decimal equivalent of a binary number, add all the numbers whose corresponding bits are one.
We can also convert numbers in the decimal system to binary. The illustration below explains how we can find the binary equivalent of twelve.
In general, to convert a number from decimal to binary, express it as a sum of powers of 2 (e.g. ...