Lecture 01
1
Copyright 2014 Pearson Education, Inc. Computer Security: Principles and Practice, 3/e, by William Stallings and Lawrie Brown
Objectives
Introduce computing and engineering problem solving, including:
A brief history
Historical Perspective
What is a computer?
Historical Perspective
Charles Babbage,
(1792-1871, above)
designed the
Analytical Engine
(left) to process
decimal numbers.
Historical Perspective
Charles Babbage, Esq. 1792-1871
English mathematician
Historical Perspective
Analytical Engine:
Luigi F. Menabrea, French engineer and mathematician, described
Babbages vision of a machine capable of solving any problem using:
Inputs
Outputs
Babbage, Esq
Historical Perspective
Augusta Ada Byron 1815-1852
Wrote the English translation of Menabreas Sketch of the Analytical
Engine
Envisioned the multidisciplinary potential of the Analytical Engine
Wrote detailed instructions for performing numerical computations using
the Analytical Engine
Historical Perspective
Digital Computers
ABC (Atanasoff Berry Computer)
Developed at Iowa State University between 1939 and 1942 by John
Atanasoff and Clifford Berry.
Weighed 700 pounds.
Executed one instruction every 15 seconds.
ENIAC (Electronic Numerical Integrator And Calculator)
Developed by research team lead by John Mauchly and J. Presper
Eckert during the early 1940s
Consisted of 18,000 vacuum tubes and 1500 relays
Weight: 30 tons, 6000 switches, many jumper cables
Consumed: 140 kilowatts of power
Executed hundreds of instructions every second
8
Historical Perspective
ENIAC vs. Intel Pentium 4
Todays
processors
execute trillions
of operations per
second and
weigh ounces.
ENIAC executes hundreds of operations per second (30 tons)
9
11
15
16
17
18
19
20
22
23
24
25
26
Linking Errors
Missing pieces prevent the final assembly of an executable
program
Run-time Errors
Occur when program is executing
May or may not be reported
27
28
29
30
31
The linker combines machine code with library code into an executable
program
32
33
34
35
Finite-Precision Numbers
With computers, its quite different!
On most computers, amount of memory available for storing a number is
fixed at the time that the computer is designed
With a certain amount of effort, programmer can represent numbers two,
or three or even many times larger than this fixed amount
Challenge: fixed amount of memory
Finite nature of the computer forces us to deal only with numbers that can
be represented in a fixed number of digits finite-precision numbers
Example: set of positive integers representable by three decimal digits
(no decimal or sign)
Set has exactly 1000 members: 000, 001, 002, , 999
Since computers have finite memories (then it must perform arithmetic on
finite-precision numbers), the results of certain calculations will be just
plain wrong (from a mathematical perspective)
Algebra of finite-precision numbers is different from normal algebra
36
Finite-Precision Numbers
Associative Law Example
Associative law (can group numbers in any way without changing the
answer)
a + (b - c) = (a + b) c
for a = 700, b = 400, c = 300
Left side: 800
right side: overflow
associative law does not hold (overflow in the infinite arithmetic of threedigit integers)
37
Finite-Precision Numbers
Distributive Law Example
Distribution law (distribute pieces as you separate or break it into parts)
a (b c) = a b a c
for a = 5, b = 210, c = 195
Left side: 5 x 15=75
right side: overflow
a b causes an overflow: 5 x 210 = 1050
distributive law does not hold (overflow in the infinite arithmetic of threedigit integers)
Conclusion: Are computers suitable for doing arithmetic? Yes
38
0101000111001110
010
1100110000111010
110
0100011101001001
111
0101110001001000
Right most bit (RMB) is referred to as the least significant bit (LSB).
Left most bit (LMB) is referred to as the most significant bit (MSB).
Value stored at address 000 is 00001010110111012 = 278110
what does it represent?
41
44
45
47
48
1002 = ?8
37168 = ?2
1101001112 = ?10
3A1B16 = ?2
49
50
Both methods produce the same result and you should use whichever
method you are most comfortable with
51
STEP 3: Subtract the largest place value from the decimal number. Then, place a
1 under the place value
STEP 4: Repeat step 3 until all of the place values are processed: 485 256 = 229
256
128
64
32
16
8
4
2
1
52
1
128
1
64
32
16
64
32
16
64
1
32
16
64
1
32
1
16
64
1
32
1
16
0
64
1
32
1
16
0
8
0
4
1
2
0
1
1
53
54
55
= 242
= 121
= 60
= 30
= 15
=7
=3
=1
=X
rem 1
rem 0
rem 1
rem 0
rem 0
rem 1
rem 1
rem 1
rem 1
111100101
57
58
60
=745
Since we are dividing by 8 in the repeated division, you may end up
with remainders of anywhere from 0 to 7
61
83
512
82
64
81
8
80
1
62
7 x 512
5 x 64
0x 8
1x 1
= 3584
= 320
=
0
= + 1
3905
63
64
65
163
162
161
160
4096
256
16
3
66
10 x 4096
11 x 256
8 x 16
7 x 1
= 40960
= 2816
=
128
= + 7
43911
67
68
69
70
71
Character
_________
Code
_____
HEX
____
0100 0010
42
0110 0010
62
&
0010 0110
26
0000 1000
[BACKSPACE]
72
integer
floating
point
73
74
Ones Complement
Has a sign bit with 0 used for plus and 1 for minus.
75
-2n-1 to 2n-1 -1
102
1
124
101 100
2
4
x100 + x10 + x1
base
rightmost place
answer
124
22
1
110
x4
21
1
+ x2 +
20
0
base
rightmost place
x1
answer
6
78
176
82
81
80
base
rightmost place
answer
x64 + x8 +
x1
126
B29
162
161
160
x256 + x16 +
x1
base
rightmost place
answer
2857
79
80
21
20
x4 + x2 + x1
81
22
21
20
10
x8 + x4 + x2 + x1
82
81
80
184
x64+ x8 + x1
83
163
162
161
160
4394
84
85
86
24
23
22
21
20
2-1
16
16
28.62510
2-2
0.5
0
2-3
0.125
0
= 11100.1012
87
88
89
90
91
65
0
64
ASCII A
92
0
66
64
ASCII B
1
67
64
ASCII C
93
10000000
01111100
11111010
11001100
94
95
96
97
98
99
100
101
102
Example:
103
2.
I/O diagram
(x1,y1)
(x2,y2)
3.
Hand example
4.
5.
Processing
(program)
1.
2.
3.
4.
Testing
D (distance)
104
105
107
108
109
110
111
112