Chapter 2 Performance and Number Systems
Chapter 2 Performance and Number Systems
Number Systems
Dr. Truong Dinh Huy
Last week
1
9/23/2024
Defining Performance
• Which airplane has the best performance?
2
9/23/2024
Relative Performance
• Define Performance = 1/Execution Time
• “X is n time faster than Y”
Performanc e X Performanc e Y
Execution time Y Execution time X n
3
9/23/2024
CPU Clocking
• Operation of digital hardware governed by a constant-
rate clock
Clock period
Clock (cycles)
Data transfer
and computation
Update state
CPU Time
CPU Time CPU Clock Cycles Clock Cycle Time
CPU Clock Cycles
Clock Rate
• Performance improved by
• Reducing number of clock cycles
• Increasing clock rate
• Hardware designer must often trade off clock rate against
cycle count
4
9/23/2024
5
9/23/2024
CPI Example
• Computer A: Cycle Time = 250ps, CPI = 2.0
• Computer B: Cycle Time = 500ps, CPI = 1.2
• Same program, Same ISA
• Which is faster, and by how much?
CPU Time Instruction Count CPI Cycle Time
A A A
I 2.0 250ps I 500ps A is faster…
CPU Time Instruction Count CPI Cycle Time
B B B
I 1.2 500ps I 600ps
CPU Time
B I 600ps 1.2
…by this much
CPU Time I 500ps
A
Quiz
The results of a program running on an AMD Barcelona has an
instruction count of 2.389E12, an execution time of 750 s.
a) Find the CPI if the clock cycle time is 0.33333 ns
b) Find the increase in CPU time if the number of instructions of the program is
increased by 10% and the CPI is increased by 5%.
c) Suppose that we are developing a new version of the AMD Barcelona processor
with a 4 GHz clock rate. We also develop a new ISA in such a way that the
number of instructions has been reduced by 15%. The execution time is
reduced to 700 s. Find the new CPI.
d) Determine the clock rate required to give a further 10% reduction in CPU time
while maintaining the number of instructions and with the CPI unchanged.
6
9/23/2024
n
Clock Cycles (CPIi Instruction Count i )
i1
Relative frequency
CPI Example
• Alternative compiled code sequences using
instructions in classes A, B, C
Class A B C
CPI for class 1 2 3
IC in sequence 1 2 1 2
IC in sequence 2 4 1 1
7
9/23/2024
Performance Summary
Program Performance
8
9/23/2024
Quiz
A given application written in Java runs 15 seconds on a
desktop processor. A new Java compiler is released that
requires only 0.6 as many instructions as the old compiler.
Unfortunately, it increases the CPI by 1.1. How fast can we
expect the application to run using this new compiler? Pick
the right answer from the three choices below:
Power Trends
• In CMOS IC technology
×30 5V → 1V ×1000
9
9/23/2024
Reducing Power
• Suppose a new CPU has
• 85% of capacitive load of old CPU
• 15% voltage and 15% frequency reduction
Uniprocessor Performance
10
9/23/2024
Multiprocessors
• Multicore microprocessors
• More than one processor per chip
• Requires explicitly parallel programming
• Compare with instruction level parallelism
• Hardware executes multiple instructions at once
• Hidden from the programmer
• Hard to do
• Programming for performance
• Load balancing
• Optimizing communication and synchronization
Concluding Remarks
• Cost/performance is improving
• Due to underlying technology development
• Hierarchical layers of abstraction
• In both hardware and software
• Instruction set architecture
• The hardware/software interface
• Execution time: the best performance measure
• Power is a limiting factor
• Use parallelism to improve performance
11
9/23/2024
Number Systems
24
12
9/23/2024
Binary Signals
• It means two-states
• 1 and 0
• true and false
• on and off
• A single “on/off”, “true/false”, “1/0” is called a bit
• Example: Toggle switch
• Digital Systems
• Information is represented in binary form
• They manipulate discrete information
• Examples
• Digital telephones, digital television, and digital cameras
• The most commonly used one is DIGITAL COMPUTERS
25
Analog Signal
26
13
9/23/2024
Binary Signal
27
Byte
• Computer memory is organized into groups of eight
bits
• Each eight bit group is called a byte
28
14
9/23/2024
Decimal Fractions
• The same principle holds for decimal fractions, but negative
powers of 10 are used. Thus, the decimal fraction 0.256
stands for 2 tenths plus 5 hundredths plus 6 thousandths:
0.256 = (2 * 10-1) + (5 * 10-2) + (6 * 10-3)
• A number with both an integer and fractional part has digits
raised to both positive and negative powers of 10:
442.256 = (4 * 102) + (4 + 101) + (2 * 100) + (2 * 10-1) + (5 * 10-2)
+ (6 * 10-3)
• Most significant digit
• The leftmost digit (carries the highest value)
• Least significant digit
• The rightmost digit
15
9/23/2024
Table 9.1
Positional Interpretation of a Decimal Number
4 7 2 2 5 6
100s 10s 1s tenths hundredths thousandths
102 101 100 10–1 10–2 10–3
position 2 position 1 position 0 position –1 position –2 position –3
16
9/23/2024
17
9/23/2024
0.62 2 = 1.24 1
0.24 2 = 0.48 0
0.48 2 = 0.96 0
0.96 2 = 1.92 1
Product Integer Part 0.012
0.25 2 = 0.5 0 0.92 2 = 1.84 1
Base 16
• Binary digits are grouped into sets of four bits, called a nibble
• Each possible combination of four binary digits is given a
symbol, as follows:
18
9/23/2024
Table 9.3 8
9
1000
1001
8
9
10 1010 A
Decimal, Binary,
11 1011 B
12 1100 C
and Hexadecimal 13
14
1101
1110
D
E
15 1111 F
16 0001 0000 10
17 0001 0001 11
18 0001 0010 12
31 0001 1111 1F
100 0110 0100 64
255 1111 1111 FF
256
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved. 0001 0000 0000 100
19
9/23/2024
Base 16 is useful
Not only used for
representing integers but
also as a concise notation
for representing any Reasons for using
sequence of binary digits hexadecimal notation
are:
In most computers,
It is extremely easy to
binary data occupy some
It is more compact than convert between binary
multiple of 4 bits, and
binary notation and hexadecimal
hence some multiple of a
notation
single hexadecimal digit
20
9/23/2024
21
9/23/2024
Quiz
• Convert these numbers from base 10 to base 2 and 16:
• 2510 = 1916 =110012
• 409710 = 100116 =10000000000012
• 18.7510 = 12.C16 =10010.112
• 75.6810 = 4B.AE147AE147AE147AE14816 =1001011.101011100001010012
• Convert these numbers from base 16 to base 10:
• A1216 =257810
• AB.CD16 =171.8007812510
Next week
• Please do all homework
22