Intro to the Binary Number System

advertisement
Basing a Career on Base Two
Doris Kochanek is the chief of Visual Effects and Graphic Services at the National Film Board of Canada in Montreal. While this may appear to be an
unlikely position for a computer scientist, it fits in well with her eclectic background. Doris was born in Germany in 1957, but came to Canada at age 17 to
attend Pearson College in Victoria, British Columbia. Pursuing a broad range of interests, she graduated with the unorthodox major of mathematics, plastic
arts, physics, and filmmaking. In 1976, she joined the Department of Fine Arts at the University of Victoria, specializing in serigraphy (silk-screen printing).
She also started taking courses in computer science "just for the fun of it, as a form of left-brain exercise." While completing her B.F.A (bachelor of fine arts)
degree in 1979, Doris started using computer plots as a basis for silkscreens and became interested in the emerging field of computer graphics. After that,
Doris says "I decided to acquire a more solid technical foundation in computer science and, in 1982, I graduated with a master of mathematics in computer
science from the University of Waterloo. I also started to work at the National Film Board (NFB) of Canada as an animator-programmer." In 1985, Doris
became a founding member of the NFB's new Centre d’Animatique, a state-of-the-art research and production facility for computer animation. There she
developed computer animation and graphics software, managed a team of four researchers, and contributed in a technical and creative role to many projects,
including several films. In 1992, she assumed her current position as chief of Visual Effects and Graphic Services, managing 28 people working in animation
photography, optical effects, film titles, graphic design, printing, and, most recently, digital imaging. She is now spearheading the transition from traditional
animation and optical effects to computer graphics and digital imaging--a
ASCII Chartechnical revolution that is now happening throughout the film industry. Doris
Code acter
comments, "Computer graphics interested me from its early days because it
32
48
0
64 @ 80
P
96
` 112 p
represents a fascinating intersection of art and technology. Although 15 years
ago I could have imagined the explosive growth of this industry, it has been a
33
!
49
1
65
A
81
Q
97
a 113 q
real thrill being a part of it."
34
"
50
2
66
B
82
R
98
b 114 r
Learning about Computers Bit by Bit
A computer is a machine that contains millions of ON/OFF switches,
called BITs, each of which can have one of two values: ON or OFF. A
computer’s native language, called “machine language”, uses these
bits symbolically to represent the digits 0 (when the bit is in the OFF
position) and 1 (when the bit is in the ON position). This is a perfect
match with the BINARY (base-two) number system, which has only
two digits: 0 and 1. Bits in a computer are organized into groups of
eight. These groups are called BYTEs – each representing an 8-digit
BINARY number – analogous to the letters of an alphabet. Bytes can
in turn be strung together to form larger meaningful units, much like
the 26 letters can be combined to form many thousands of words.
35
36
37
38
39
40
41
42
43
44
45
46
47
#
$
%
&
'
(
)
*
+
,
.
/
51
52
53
54
55
56
57
58
59
60
61
62
63
3
67
4
68
5
69
6
70
7
71
8
72
9
73
:
74
;
75
<
76
=
77
>
78
?
79
Table 1.
C
83
S
99
D
84
T 100
E
85
U 101
F
86
V 102
G
87 W 103
H
88
X 104
I
89
Y 105
J
90
Z 106
K
91
[ 107
L
92
\
108
M 93
] 109
N
94
^ 110
O
95
_ 111
The ASCII Table
c
d
e
f
g
h
i
j
k
l
m
n
o
115
116
117
118
119
120
121
122
123
124
125
126
127
s
t
u
v
w
x
y
z
{
|
}
~
One application of 8-digit binary numbers is the American Standard
Code for Information Interchange (ASCII, pronounced "A-skee").
ASCII is a code in which English keyboard characters – the letters (AZ and a-z), digits (0-9), punctuation, the space character, and special
symbols (such as #, $ or %) – are represented as numbers in the range 32 to 126. See Table 1 above. Computer programs use ASCII to convert
text characters into 8-bit binary codes for the computer. One widespread use of this is to allow people to write, save and print text documents
using PCs, or to compose e-mail messages. For example, the Microsoft Word document that this page was printed from saves text in ASCII
format. [NOTE: the ASCII values 0-31 are so-called control codes, reserved for special use; as such they are not used to code for text
characters.]
Translating Binary Numbers to Decimal Numbers. To understand how binary numbers works, look at Table 2 below.
128
64
32
16
8
4
2
1
Binary
6
5
4
3
2
1
0
2 = 128 2 = 64 2 = 32 2 = 16 2 = 8 2 = 4 2 = 2 2 = 1 Number
7
Decimal Number
(Base 10)
1
1
20 = 1
1=1
1
0
10
21 + 0 = 2
2+0=2
0
1
1
11
21 + 20 = 3
2+1=3
0
1
0
0
100
22 + 0 + 0 = 4
4+0+0=4
0
0
1
0
1
101
22 + 0 + 20 = 5
4+0+1=5
1
0
1
0
0
1010100
0 + 26 + 0 + 24 + 0 + 22 + 0 + 0 = 84
0 + 64 + 0 + 16 + 0 + 4 + 0 + 0 = 84
Row 1
0
0
0
0
0
0
0
Row 2
0
0
0
0
0
0
Row 3
0
0
0
0
0
Row 4
0
0
0
0
Row 5
0
0
0
Row 6
0
1
0
Table 2. Binary numbers translated into equivalent decimal numbers
LOOK AT ROW 2 in Table 2. The binary
number 10 (pronounced one-zero) has a 0 in
the 1st column, a 1 in the 2nd column, and 0s in
the other columns. Therefore, it represents
the decimal number 2, calculated as follows:
1(2) + 0(1) = 2 + 0 = 2.
The columns represent POWERS OF 2.
THE 1ST COLUMN (starting on the right)
represents the 0th power of the base system:
In binary, the base is 2.
In decimal the base is 10.
20 = 1 in binary (and 100 = 1 in decimal).
CONSIDER THIS:
In decimal: 111 = 1(100) + 1(10) + 1(1).
In binary: 111 = 1(4) + 1(2) + 1(1) = 7.
THE 2nd COLUMN represents the 1st power
of the base system:
21 = 2 in binary (BUT 101 = 10 in decimal.)
LOOK AT ROW 6 in Table 2, which
represents the decimal number 84. Notice that
LOOK AT ROW 3 in Table 2 above. The
in binary as 1010100. It has a 1 in
binary number 11 (pronounced one-one) has a it is written
th
st
nd
the
7
column
(the 64ths column), a 1 in the
1 in the 1 column, a 1 in the 2 column, and
th
5 column (the 16ths column) and a 1 in the
0s in the remaining columns. Therefore, it
rd
represents the decimal number 3, calculated as 3 column (the 4ths column). 1(64) + 1(16)
+ 1(4) = 64 + 16 + 4 = 84. Look up the
follows: 1(2) + 1(1) = 2 + 1 = 3.
ASCII code 84 in Table 1 (on the first page)
and notice that it codes for the capital letter T.
THE 3rd COLUMN represents the 2nd power
of the base system:
22 = 4 in binary (BUT 102 = 100 in decimal.)
AS YOU MOVE TO THE LEFT, each
column's VALUE doubles. The 1st column is
1, the next column is 2, then 4, then 8, etc.
Download