Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Administrative Matters for Design and Architecture of Computer Systems | CS 161, Assignments of Computer Science

Material Type: Assignment; Professor: Hsieh; Class: DESIGN & ARCHTCTR OF COMP SYSTMS; Subject: Computer Science; University: University of California-Riverside; Term: Fall 2007;

Typology: Assignments

2009/2010

Uploaded on 03/28/2010

koofers-user-5pv
koofers-user-5pv šŸ‡ŗšŸ‡ø

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS161: Design and Architecture of Computer Systems October 22, 2007
1
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
Administrative Matters
•Homework #3
–due Monday, 10/22
–Please read chapter 4 ahead of the lecture
•Midterm #1
–Wednesday 10/24
–Cumulative
• Chapter 1-4
• Homework 1-3
• Quiz 1-2
•Office Hour
–Tue 1-3PM (extra)
–Wed 12-1PM (moved)
–Tue 8-9AM (Ben)
–Wed 9-10AM (Edward)
2
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
Quick correction on homework3 solution
•4.10
–For C3, CPI for I1 is (.5*2+.25*3+.25*5)=3 and I2 has CPI
(.5*1+.25*2+.25*2)=1.5
–Using C3, I2 has 6/3= 2 billion instructions / second
–Using C3, I1 has 3/1.5= 2 billion instructions / second
3
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
4
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
Pentium bug
•Floating point division
•FDIV bug
–Lookup table to guess quotient based on divisor and di vidend
–Five elements were thought as ā€œdon’t careā€
• Optimized away (return 0 instead of 2)
–They were wrong!!!
• Some error show up in 12-52 bits
• Or, 4
th
to 14
th
digit in decimal
5
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
Pentium-gate
•July, 1994
–Intel discover the bug
–Would cost $100,000’s to fix
–Months to verify
–New chip will ship January 1995
–3-5 million ā€œbadā€ chip will ship
•September, 1994
–Thomas Nicely discover the bug, and posted on internet
•November 7, 1994
–Electronic Engineering Times front page
•November 22, 1994
–Intel call it a ā€œglitchā€,
ā€“ā€œerrors in the ninth digit...even most engineers and financial analysts
require accuracy only to the fourthā€
ā€“ā€œAffect only several dozen people in the world, we only heard of oneā€
ā€“ā€œOnly theoretical mathematician should be concernedā€
–Customer were told to describe their application to Intel, then Intel w ill
decide whether or not a new chip will be issued
6
ļ›™2004 Morgan Kaufmann Publishers
COMPUTER
SCIENCE & ENGINEERING
Pentium-gate
•December 5, 1994
–Intel claimed
ā€“ā€œhappen once in 27,000 years for typical spreadsheet userā€
ā€“ā€œ1000 divide/day 1/billion error rate, 9 million days = 27000 yrsā€
–Number assume to be randomly distributed
•December 12, 1994
–IBM claimed
ā€“ā€œ15 minutes calculation/day, 5000 divide/second, 4.2 million divide/day,
1/100milion error rate
ā€“ā€œhappen once every 24 daysā€
–Immediately stop all shipment of IBM PC’s
•December 21, 1994
–Intel apologized
–Will correct affected processor anytime, no question asked
–Recall costs $500 million
–Intel employees did not get a Christmas bonus
pf3
pf4

Partial preview of the text

Download Administrative Matters for Design and Architecture of Computer Systems | CS 161 and more Assignments Computer Science in PDF only on Docsity!

ļ›™2004 Morgan Kaufmann Publishers 1

SCIENCE & ENGINEERING^ COMPUTER

Administrative Matters

  • Homework #
    • due Monday, 10/
    • Please read chapter 4 ahead of the lecture
  • Midterm #
    • Wednesday 10/
    • Cumulative
      • Chapter 1-
      • Homework 1-
      • Quiz 1-
  • Office Hour
    • Tue 1-3PM (extra)
    • Wed 12-1PM (moved)
    • Tue 8-9AM (Ben)
    • Wed 9-10AM (Edward)

ļ›™2004 Morgan Kaufmann Publishers 2

SCIENCE & ENGINEERING^ COMPUTER

Quick correction on homework3 solution

  • For C3, CPI for I1 is (.52+.253+.255)=3 and I2 has CPI (.51+.252+.252)=1.
  • Using C3, I2 has 6/3= 2 billion instructions / second
  • Using C3, I1 has 3/1.5= 2 billion instructions / second

ļ›™2004 Morgan Kaufmann Publishers 3

SCIENCE & ENGINEERING^ COMPUTER

ļ›™2004 Morgan Kaufmann Publishers 4

SCIENCE & ENGINEERING^ COMPUTER

Pentium bug

  • Floating point division
  • FDIV bug
    • Lookup table to guess quotient based on divisor and dividend
    • Five elements were thought as ā€œdon’t careā€
      • Optimized away (return 0 instead of 2)
    • They were wrong!!!
      • Some error show up in 12-52 bits
      • Or, 4th^ to 14th^ digit in decimal

Pentium-gate

  • July, 1994
    • Intel discover the bug
    • Would cost $100,000’s to fix
    • Months to verify
    • New chip will ship January 1995
    • 3-5 million ā€œbadā€ chip will ship
  • September, 1994
    • Thomas Nicely discover the bug, and posted on internet
  • November 7, 1994
    • Electronic Engineering Times front page
  • November 22, 1994
    • Intel call it a ā€œglitchā€,
    • ā€œerrors in the ninth digit...even most engineers and financial analysts require accuracy only to the fourthā€
    • ā€œAffect only several dozen people in the world, we only heard of oneā€
    • ā€œOnly theoretical mathematician should be concernedā€
    • Customer were told to describe their application to Intel, then Intel will decide whether or not a new chip will be issued

Pentium-gate

  • December 5, 1994
    • Intel claimed
    • ā€œhappen once in 27,000 years for typical spreadsheet userā€
    • ā€œ1000 divide/day 1/billion error rate, 9 million days = 27000 yrsā€
    • Number assume to be randomly distributed
  • December 12, 1994
    • IBM claimed
    • ā€œ15 minutes calculation/day, 5000 divide/second, 4.2 million divide/day, 1/100milion error rate
    • ā€œhappen once every 24 daysā€
    • Immediately stop all shipment of IBM PC’s
  • December 21, 1994
    • Intel apologized
    • Will correct affected processor anytime, no question asked
    • Recall costs $500 million
    • Intel employees did not get a Christmas bonus

ļ›™2004 Morgan Kaufmann Publishers 7

SCIENCE & ENGINEERING^ COMPUTER

Real life questions

  • How much cheaper will it be if Intel just decide to fix it in July
    • $100,000 vs. $500 million
  • What’s the damage to Intel’s reputation?
  • Does Intel has a corporate responsibility to disclose bugs?
  • Does Intel has a corporate responsibility to fix bugs?
    • If nobody is hurt by it?
  • Also, how can you tell if your calculator made a mistake?

ļ›™2004 Morgan Kaufmann Publishers 8

SCIENCE & ENGINEERING^ COMPUTER

Chapter Three Summary

  • Computer arithmetic is constrained by limited precision
  • Bit patterns have no inherent meaning but standards do exist
    • two’s complement
    • IEEE 754 floating point
  • Computer instructions determine ā€œmeaningā€ of the bit patterns
  • Performance and accuracy are important so there are many complexities in real machines
  • Algorithm choice is important and may lead to hardware optimizations for both space and time (e.g., multiplication)

ļ›™2004 Morgan Kaufmann Publishers 9

SCIENCE & ENGINEERING^ COMPUTER

Chapter 4

Assessing and Understanding Performance

(continue)

ļ›™2004 Morgan Kaufmann Publishers 10

SCIENCE & ENGINEERING^ COMPUTER

Example

  • Our favorite program runs in 10 seconds on computer A, which has a 400 Mhz. clock. We are trying to build a new machine B, that will run this program in 6 seconds. Assume B require 1.2 times as many clock cycles as machine A for the same program. What clock rate should we target?

cycle

seconds program

cycles program

seconds = Ɨ

For program A: 10 seconds = CyclesA Ɨ 1/ 400MHz For program B: 6 seconds = CyclesB Ɨ 1/clock rateB CyclesB = 1.2 CyclesA

Clock rateB = CyclesB/ =1.2 CycleA/

=1.2 (400M*10)/6 = 800MHz

  • A given program will require
    • some number of instructions (machine instructions)
    • some number of cycles
    • some number of seconds
  • We have a vocabulary that relates these quantities:
    • cycle time (seconds per cycle)
    • clock rate (cycles per second)
    • CPI (cycles per instruction) a floating point intensive application might have a higher CPI
    • MIPS (millions of instructions per second) this would be higher for a program using simple instructions
      • Meaningful if same assembly code

Now that we understand cycles Performance

  • Performance is determined by execution time
  • Do any of the other variables equal performance?
    • of cycles to execute program?

    • of instructions in program?

    • of cycles per second?

    • average # of cycles per instruction?
    • average # of instructions per second?
    • Why?
  • Common pitfall: thinking one of the variables is indicative of performance when it really isn’t.

ļ›™2004 Morgan Kaufmann Publishers 19

SCIENCE & ENGINEERING^ COMPUTER

Reporting Benchmark Result

  • How to weight different program?
    • According to frequency of occurrence
  • Arithmetic Mean
    • (if each benchmark ā€œoccursā€ equally frequently in real life)
    • Each program counts once
  • Weighted Arithmetic Mean
    • More frequent program counts more
  • Computer A (Program 1: 1 second; Program 2: 1000 seconds)
  • Computer B (Program 1: 10 seconds; Program 2: 100 seconds)
  • What if Program 1 occurs 10000 more frequent than Program 2?
  • Computer A (10000*1+1000)=
  • Computer B (10000*10+100)=
  • Now A is 100100/11000 = 9.1 times faster than B

ļ›™2004 Morgan Kaufmann Publishers 20

SCIENCE & ENGINEERING^ COMPUTER

Quick Questions

  • Suppose you are choosing between
  • an Apple,
  • a PC with Pentium IV,
  • a PC with AMD, and
  • a PC with Pentium Core 2 duo:
    • The fastest computer will be the one with the highest clock rate?
    • Since all PCs use the same Intel-compatible instruction set and execute the same number of instructions for a program, the fastest PC will be the one with the highest clock rate?
    • Since AMD uses different techniques than Intel to execute instructions, they may have different CPIs?
    • Only by looking at the results of benchmarks for tasks similar to your workload can you get an accurate picture of likely performance?

ļ›™2004 Morgan Kaufmann Publishers 21

SCIENCE & ENGINEERING^ COMPUTER

Quick Questions

  • Assume the following measurement for execution time:
  • (Computer A: Program 1: 2 seconds, Program 2: 5 seconds)
  • (Computer B: Program 1: 4 seconds, Program 2: 2 seconds)
    • A is faster than B for program 1?
    • A is faster than B for program 2?
    • A is faster than B for a workload with equal number of executions of program 1 and 2?
    • A is faster than B for a workload with twice as many executions of program 1 as of program 2?

ļ›™2004 Morgan Kaufmann Publishers 22

SCIENCE & ENGINEERING^ COMPUTER

Execution Time After Improvement = Execution Time Unaffected +( Execution Time Affected / Amount of Improvement )

  • Example: "Suppose a program runs in 100 seconds on a machine, with multiply responsible for 80 seconds of this time. How much do we have to improve the speed of multiplication if we want the program to run 4 times faster?
  • 20 times How about making it 5 times faster?
  • Not possible.
  • Principle: Make the common case fast

Amdahl's Law

TimeBefore

TimeAfter Execution time w/o E (Before)

Execution time w E (After)

Speedup (E) =

ļ›™2004 Morgan Kaufmann Publishers 23

SCIENCE & ENGINEERING^ COMPUTER

  • Performance is specific to a particular program/s
    • Total execution time is a consistent summary of performance
  • For a given architecture performance increases come from:
    • increases in clock rate
      • (without adversely affecting CPI)
    • improvements in processor organization that lower CPI
      • (without adversely affecting clock rate)
    • compiler enhancements that lower CPI and/or instruction count
    • Algorithm/Language choices that affect instruction count
      • (without adversely affecting CPI)
  • Amdahl’s: Can’t expect improvement in one aspect of a machine’s performance to have same effect in the total performance

Chapter 4 Summary