www.tomklein.myrapname.com

A logical storage bank is made up of bits which can each be assigned a value of 1 or 0.

Image by Tom Klein

Physical vs. Logical Data


(For BUS 150 Students)
by Tom Klein

It is generally understood that computers think in binary terms, using ones and zeros by toggling tiny electronic circuits from an on state to an off state, and vice versa. But what confuses many people is why computers think that way in the first place - and how they are able to use two simple binary values to represent not only our decimal system, but all the letters of our alphabet, as well as other alphabets, and even images, sound, and video.

To better understand this connection between the computer's binary world and our world of decimal math, symbolic language, and rich data, it is a helpful start to think of computer hardware as something that stores and manipulates what is called physical data, which is the on and off states of tiny switches built into the computer itself. From there you may think of computer software as something that organizes and provides meaning to the physical data by forming an abstract layer known as logical data. Logical data is the basis for mathematical values, symbolic representation of characters, and program code; and this is used to build operating systems, applications, databases, data files, music files, image files, video files, and more.

Physical Data - Fields of Electronic Switches

Physical storage consists of massive fields of tiny electronic switches, each one with the potential of being turned on or off. These switches (also called transistors) are located on integrated chips in various areas of a computer. The switches on processing chips are used to calculate numbers, compare values, and control the state of other switches on other chips throughout the computer.

Memory chips contain billions of switches that can store massive amounts of on and off states. Think of memory as a huge corn field, but instead of corn growing, imagine that the field is filled with row upon row of switches. Then imagine when a switch is turned on, it turns white; and when a switch is turned off it turns black. Now imagine that you can control the state of each switch to form patterns. You may have seen this sort of trick at sporting event half-time shows where each person holds up a different card, and together it forms a picture when viewed from far away.

Logical Data - Making Patterns in the Fields

The patterns you can form with a massive field of on and off switches is the basis of a computer's logical data. We use logic to subdivide the field into small parcels, and this gives the field a format. We then work within those parcels to designate certain patterns that represent data values. For computer logic, it was decided that the switches are called bits, that the on state of a bit is considered to have a value of 1, and that the off state is considered to have a value of 0. In this way, a large field of bits can be used as a giant storage bank of ones and zeros. Such a storage bank is then given a logical format where every 8 bits is grouped together to form a byte. Thus values in a memory bank can be manipulated by flipping values of individual bits (to either 0 or 1) within the construct of a byte. Because each bit can be either a 0 or 1, and because there are 8 bits in a byte, each byte can have one of 256 unique patterns of zeros and ones. For example a byte can be 00000000, 00000001, 00000010, 00000011, 00000100, all the way up to 11111111.

Each pattern of zeros and ones within a byte can be assigned a symbolic representation of an alphanumeric value according to one of many standards. One of the earliest standards is ASCII (American Standard Code for Information Exchange). In ASCII, for example, 01000001 is the capital letter A, and 01000010 is the capital letter B. What this means is that when you type the capital letter A on your keyboard, the computer will manipulate eight bits (or one byte) in its memory bank to store that value as 01000001. Here are some of the possible ASCII values that a byte can have:

Binary Value Symbolic Character Value
00110000 0
00110001 1
00110010 2
00110011 3
00110100 4
00110101 5
00110110 6
00110111 7
00111000 8
00111001 9
00111010 :
00111011 ;
00111100 <
00111101 =
00111110 >
00111111 ?
01000000 @
01000001 A
01000010 B
01000011 C
01000100 D
01000101 E
01000110 F
01000111 G
01001000 H
01001001 I
01001010 J
01001011 K
01001100 L
01001101 M
01001110 N
01001111 O
01010000 P
01010001 Q
01010010 R
01010011 S
01010100 T
01010101 U
01010110 V
01010111 W
01011000 X
01011001 Y
01011010 Z
01100001 a
01100010 b
01100011 c
01100100 d
01100101 e
01100110 f
01100111 g
01101000 h
01101001 i
01101010 j
01101011 k
01101100 l
01101101 m
01101110 n
01101111 o
01110000 p
01110001 q
01110010 r
01110011 s
01110100 t
01110101 u
01110110 v
01110111 w
01111000 x
01111001 y
01111010 z

You might notice that there are separate values for upper case and lower case letters. An upper case "A", for example, is not the same as a lower case "a" even though we tend to think of them as essentially equal. Also notice that the only difference between the upper case letters and their lower case counterparts is one bit - the third bit to be exact. The third bit is set to 0 for all the upper case letters, and 1 for all the lower case letters. This is by design so that the computer merely has to flip one bit to convert the case of any letter.

Symbolic Representation vs. Mathematical Value

Notice that the ASCII character "1" is assigned the byte value of 00110001. Anyone who understands binary math may be confused because the actual decimal value of 00110001 is 41. So is 00110001 equal to 41? or "1"? The answer is that both interpretations are correct, and both are used depending upon the context. When we are calculating numbers, then 00110001 will be used to store the decimal value 41. But when we are storing text, then 00110001 will be used to store the alphanumeric character called "1".

Also notice that the last four bits of each numeric character corresponds with it's binary value. This too is by design. For example, if the result of a binary calculation is 00000010, we know that it is the decimal value 2. But to display this value to a human, we need to convert it to its corresponding ASCII value. To do this with the value 2 or with any other single decimal digit, we simply replace the first 4 bits with 0011. Thus the binary value of 2 is 00000010, and it can instantly become the character "2" which is 00110010.