## Data Representations Applet

What can you do with thirty-two bits? Computers use strings of bits to represent all the different types of data that they have to work with, so the answer must be that you can do a lot of different things. A given string of 32 bits can represent all kinds of things, depending on the context in which it is used. That is, the same bits can encode different things, depending on how they are interpreted.

This page contains an applet that lets you see different interpretations of the same 32-bit binary number. The applet lets you type in a data value. You can select the type of data you want to enter by clicking on one of the five radio buttons. Just type your data into the input box at the top of the applet, and press return. You can also click on the 8-by-4 grid of "big pixels" at the center of the applet. The various data representations are described below.

This applet was originally written by David Eck for use with his introductory computer science textbook The Most Complex Machine. However, it can also be used on its own.

For a list of other applets and for lab worksheets that use the applets, see the index page.

Sorry! Your browser doesn't do Java!

### Data Types

The Data Representation Applet shows six different interpretations for the same string of thirty-two bits. The six interpretations are: a binary number, an integer, a hexadecimal number, a real number, a string of four characters and an eight-by-four grid of pixels. Here is a short explanation of each of the six data displays.

Binary
This is the most direct display of the 32 bit binary number, showing a zero or one to represent each individual bit.
Base-ten Integer
A binary number can be interpreted as a normal positive integer (0, 1, 2, 3, 4,...) written in the "base ten". With 32 bits, you can represent 232 different numbers. Usually, you want to use both positive and negative numbers. The scheme for representing negative numbers is a bit strange. It is explained in Subsection 2.2.3 of The Most Complex Machine. Using 32 bits, the integers from -2147483648 to 2147483647 can be represented.