Simulation auf Höchstleistungsrechnern

Ähnliche Dokumente
Supercomputer - Eine einfache Einführung

Grundlagen der Technischen Informatik Wintersemester 12/13 J. Kaiser, IVS-EOS

Exercise (Part II) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

CABLE TESTER. Manual DN-14003

Exercise (Part XI) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

Mock Exam Behavioral Finance

AS Path-Prepending in the Internet And Its Impact on Routing Decisions

Binäre Gleitkommazahlen

XSC. Reimar Bauer, Rebecca Breu. Dezember Forschungszentrum Jülich. Weihnachtsfeier, 10. Dezember

Number of Maximal Partial Clones

Introduction to Python. Introduction. First Steps in Python. pseudo random numbers. May 2016

Geometrie und Bedeutung: Kap 5

TSM 5.2 Experiences Lothar Wollschläger Zentralinstitut für Angewandte Mathematik Forschungszentrum Jülich

miditech 4merge 4-fach MIDI Merger mit :

Übungsstunde: Informatik 1 D-MAVT

Algorithms & Datastructures Midterm Test 1

Einkommensaufbau mit FFI:

Listening Comprehension: Talking about language learning

Aufbau eines IT-Servicekataloges am Fallbeispiel einer Schweizer Bank

Englisch-Grundwortschatz

Orientierungsveranstaltungen 2009 Informatikstudien der Universität Wien

Lösungen: zu 1. a.) b.) c.)

There are 10 weeks this summer vacation the weeks beginning: June 23, June 30, July 7, July 14, July 21, Jul 28, Aug 4, Aug 11, Aug 18, Aug 25

WAS IST DER KOMPARATIV: = The comparative

Magic Figures. We note that in the example magic square the numbers 1 9 are used. All three rows (columns) have equal sum, called the magic number.

Cycling and (or?) Trams

D-BAUG Informatik I. Exercise session: week 1 HS 2018

TW Struktura / TW ArchiMed

Wie man heute die Liebe fürs Leben findet

Rough copy for the art project >hardware/software< of the imbenge-dreamhouse artist Nele Ströbel.

Daten haben wir reichlich! The unbelievable Machine Company 1

Informatik für Mathematiker und Physiker Woche 2. David Sommer

Ein Stern in dunkler Nacht Die schoensten Weihnachtsgeschichten. Click here if your download doesn"t start automatically

Preisliste für The Unscrambler X

Softwareupdate-Anleitung // AC Porty L Netzteileinschub

Data Structures and Algorithm Design

Critical Chain and Scrum

Programmieren in Haskell Einführung

Algebraische Spezifikation von Software und Hardware II

Ein kleiner Einblick in die Welt der Supercomputer. Christian Krohn

Problem: Keine Integers in JavaCard. ToDo: Rechnen mit Bytes und Shorts

Übung 3: VHDL Darstellungen (Blockdiagramme)

Musterlösung 2. Mikroprozessor & Eingebettete Systeme 1

Unit 1. Motivation and Basics of Classical Logic. Fuzzy Logic I 6

Killy Literaturlexikon: Autoren Und Werke Des Deutschsprachigen Kulturraumes 2., Vollstandig Uberarbeitete Auflage (German Edition)

Numerische Datentypen. Simon Weidmann

Level 1 German, 2012

Ein- und Zweifamilienhäuser Family homes

Exercise (Part V) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

Tuning des Weblogic /Oracle Fusion Middleware 11g. Jan-Peter Timmermann Principal Consultant PITSS

Power-Efficient Server Utilization in Compute Clouds

p^db=`oj===pìééçêíáåñçêã~íáçå=

Field-Circuit Coupling for Mechatronic Systems: Some Trends and Techniques

Contents. Interaction Flow / Process Flow. Structure Maps. Reference Zone. Wireframes / Mock-Up

Mensch-Maschine-Interaktion 2 Übung 1

IDS Lizenzierung für IDS und HDR. Primärserver IDS Lizenz HDR Lizenz

Cycling. and / or Trams

DAS ERSTE MAL UND IMMER WIEDER. ERWEITERTE SONDERAUSGABE BY LISA MOOS

Newest Generation of the BS2 Corrosion/Warning and Measurement System

Symbio system requirements. Version 5.1

Wintersemester Maschinenbau und Kunststofftechnik. Informatik. Tobias Wolf Seite 1 von 18

Algorithms for graph visualization

Gern beraten wir auch Sie. Sprechen Sie uns an!


Repräsentation von Daten Binärcodierung von rationalen Zahlen und Zeichen

a) Da die Zahlen im IEEE-32Bit-Format dargestellt werden sollen, ist der Bias = 127.

2 Darstellung von Zahlen und Zeichen

DYNAMISCHE GEOMETRIE

(Prüfungs-)Aufgaben zum Thema Scheduling

Unit 4. The Extension Principle. Fuzzy Logic I 123

Die "Badstuben" im Fuggerhaus zu Augsburg

Universität Karlsruhe (TH)

Computational Models

VITEO OUTDOORS SLIM WOOD. Essen/Dining

Martin Luther. Click here if your download doesn"t start automatically

RECHNUNGSWESEN. KOSTENBEWUßTE UND ERGEBNISORIENTIERTE BETRIEBSFüHRUNG. BY MARTIN GERMROTH

Weather forecast in Accra

PONS DIE DREI??? FRAGEZEICHEN, ARCTIC ADVENTURE: ENGLISCH LERNEN MIT JUSTUS, PETER UND BOB

MULTI PHYSICS SIMULATION IN MANUFACTURING

Binäre Division. Binäre Division (Forts.)

Fachübersetzen - Ein Lehrbuch für Theorie und Praxis

Pilot Project Biogas-powered Micro-gas-turbine

Die einfachste Diät der Welt: Das Plus-Minus- Prinzip (GU Reihe Einzeltitel)

Informationssysteme Gleitkommazahlen nach dem IEEE-Standard 754. Berechnung von Gleitkommazahlen aus Dezimalzahlen. HSLU T&A Informatik HS10

Rev. Proc Information

Englisch. Schreiben. 18. September 2015 HTL. Standardisierte kompetenzorientierte schriftliche Reife- und Diplomprüfung. Name: Klasse/Jahrgang:

Funktion der Mindestreserve im Bezug auf die Schlüsselzinssätze der EZB (German Edition)

Einführung in die Informatik I

Kapitel 1. Zahlendarstellung. Prof. Dr. Dirk W. Hoffmann. Hochschule Karlsruhe w University of Applied Sciences w Fakultät für Informatik

Reparaturen kompakt - Küche + Bad: Waschbecken, Fliesen, Spüle, Armaturen, Dunstabzugshaube... (German Edition)

Prof. Dr. Oliver Haase Karl Martin Kern Achim Bitzer. Programmiertechnik Zahlensysteme und Datendarstellung

DIBELS TM. German Translations of Administration Directions

EVANGELISCHES GESANGBUCH: AUSGABE FUR DIE EVANGELISCH-LUTHERISCHE LANDESKIRCHE SACHSEN. BLAU (GERMAN EDITION) FROM EVANGELISCHE VERLAGSAN

Introduction to Python. Introduction. First Steps in Python. pseudo random numbers. May 2018

Level 2 German, 2015

Serviceinformation Nr. 05/10

CALCULATING KPI QUANTITY-INDEPENDENT ROUTE TIME

Unternehmensweite IT Architekturen

Where are we now? The administration building M 3. Voransicht

EEX Kundeninformation

Transkript:

: : : : : : : : : : : : : : : : : : : : : : Simulation auf Höchstleistungsrechnern Bastian Koller (IHR/HLRS), Axel Tenschert (HLRS) History

: : : : : : : : : : : : : : : : : : : : : : What is a supercomputer? History

: : : : : : : : : : : : : : : : : : : : : : Definition What is a supercomputer? A supercomputer is a computer that costs more than xx million $US A supercomputer is ranked top in TOP500 www.top500.org A supercomputer is ranked top in IDC TOP500 www.idc.com/hpc A supercomputer is defined simply as the most powerful class of computers at any point in time. (Cray Inc.) General: A supercomputer is any computer that is among the fastest systems in the world History

: : : : : : : : : : : : : : : : : : : : : : LINPACK LINPACK as numerical library to solve linear algebra Written in Fortran Superseded by LAPACK LINPACK benchmarks as measure of floating point computing power of a system Negative: It seems that some architectures deliver better results than others with the LINPACK benchmark MDGRAPE-3 ~1 PFLOP but not in the list (as LINPACK cannot run on this machine) How meaningful are such benchmarks? History

: : : : : : : : : : : : : : : : : : : : : : Some Example LINPACK-Benchmarks Name Titan - Cray XK7 Sequoia - BlueGene/Q Location History Oak Ridge National Laboratory, TN, USA Livermore National Laboratory, USA TOP 500 Position LINPACK Rmax in TFlop/s 1. ca. 17590.0 2. ca. 16324.8 K computer RIKEN (AICS), Kobe, Japan 3. ca. 10510.0 Mira - BlueGene/Q JUQUEEN - BlueGene/Q SuperMUC - idataplex DX360M4 Stampede - PowerEdge C8220 Argonne Leadership Computing Facility, Argonne, USA Forschungszentrum Juelich (FZJ), D Leibniz Rechenzentrum, Muenchen, D Texas Advanced Computing Center/Univ. of Texas, Austin, USA http://top500.org/, November 2012 4. ca. 8162.4 5. ca. 4141.2 6. ca. 2897.0 7. ca. 2660.3

: : : : : : : : : : : : : : : : : : : : : : HLRS Univ. Stuttgart, Example LINPACK-Benchmarks HERMIT - Cray XE6, High Performance Computing Center Stuttgart (HLRS), Stuttgart, D, 831.4 TFlop/s November 2012, Platz 27, Juni 2012, Platz 24 November 2011, Platz 12: 14. 11. 11, HLRS runs fastest civil supercomputer in Europe - In the Top500 list of the fastest supercomputers published today the new HLRS computing system at HLRS is listed as the 12th fastest supercomputer in the world http://www.hlrs.de/news/ History

: : : : : : : : : : : : : : : : : : : : : : History of Supercomputing Bastian Koller (IHR/HLRS) History

: : : : : : : : : : : : : : : : : : : : : : A SHORT HISTORY SEE: HTTP://WWW.EPM.ORNL.GOV/SSI-EXPO/HISTEXT.HTML History

: : : : : : : : : : : : : : : : : : : : : : Primordial Soup of Computing 1939 Atanasoff-Berry Computer created at Iowa State (not programmable) 1941 Konrad Zuse Z3 first programmable computer 1943 Collossus - British vacuum tube computer 1944 Harvard Mark I 1946 ENIAC 1948 Manchester Mark I (first stored-program digital computer) History

: : : : : : : : : : : : : : : : : : : : : : History 1954 IBM 650 First mass produced computer History

: : : : : : : : : : : : : : : : : : : : : : History 1964 Lawrence Livermore Laboratory 1964 CDC 6600 10 MHz, 64K*60 bit (0.47 MB) 1969 CDC 7600 36 MHz, 512 K*60 bit (3.75 MB) History

: : : : : : : : : : : : : : : : : : : : : : History 1972 / Cray Vector Computing http://www.cray.com/company/h_systems.html Los Alamos National Laboratory 1976 Cray-1 160 MFLOPS, 8 MB, 80 MHz 1982 Cray X-MP 500 MFLOPS, 118 MHz 1985 Cray-2 1900 MFLOPS, 2048 MB, 244 MHz 1988 Cray Y-MP x*333 MFLOPS, 167 MHz History

: : : : : : : : : : : : : : : : : : : : : : History / Seymour Cray http://en.wikipedia.org/wiki/seymour_cray Born 1925 in Chippewa Falls, Wisconsin Died 1996 in Colorado Professional Experience: Engineering Research Associates, 1950-1957 Control Data Corp., 1957-1972 (CDC 6600, CDC 7600) Cray Research Inc., 1972-1989 (Cray-1, Cray-2, Cray-XMP, ) Cray Computer Corp., 1989-1995 (Cray-3) SRC Computers Inc., 1996 "He is the Thomas Edison of the supercomputing industry," --Larry L. Smarr When told that Steve Jobs bought a CRAY to help design the next Apple, Seymour Cray said, "Funny, I am using an Apple to simulate the CRAY-3." History

: : : : : : : : : : : : : : : : : : : : : : History / Parallel Computing 1985 Thinking Machines Corporation demonstrates first C-1 Connection Machine to DARPA (up to 64K Proc.) 1988 Intel delivers first ipsc/2 hypercubes 1991 Thinking Machines Corporation announces CM-5 1992 Kendall Square announces the KSR1 1992 MasPar delivers its MP2 (16K Procs.) 1993 Cray delivers first MPP Cray T3D 1993 IBM delivers first SP1 History

: : : : : : : : : : : : : : : : : : : : : : History 1991-1999 / Intel Paragon 1991 Delta Touchstone as a prototype for the Intel Paragon delivered to Caltech Based on i860 1996/7 Installation of a system with 4510 procs. at SNL Upgrade to 9632 over time finished by 1999 Fastest System in the world from June 1997 to November 2000 History

: : : : : : : : : : : : : : : : : : : : : : History 2002 / Earth Simulator 2002 NEC delivers the Earth Simulator System Based on the standard SX-6 system the Earth Simulator is outstanding in the number of CPUs and in the level of sustained performance When introduced the ES is 5 times faster than the second fastest system and is faster than the next 10 fastest systems put together The New York Times and CNN call it Computnik History

: : : : : : : : : : : : : : : : : : : : : : June 18, 2002 November 18, 2004 Japanese 'Computenik' Earth Simulator shatters US supercomputer hegemony. Hans Meuer: "The ES (Earth Simulator) is a significant step into the future of high end supercomputers: it is approximately 5 times faster than the current #1, ASCI White, if we take the best linpack performance as a yardstick. I do expect the ES to be faster than the sum of the first other 19 machines in the TOP20 of the forthcoming 19th TOP500 list. Thus the ES is a real challenge for the US ASCI program. The US labs are now falling significantly behind." (Primeur) Top 500 Timeline: http://top500.org/timeline/ History

: : : : : : : : : : : : : : : : : : : : : : History 2005 / IBM BlueGene 2005 IBM delivers the currently fastest supercomputer to LLNL The system is based on 131072 processors The peak performance is 367 TFLOP/s History

: : : : : : : : : : : : : : : : : : : : : : History 2008 / IBM Roadrunner 6.480 AMD Opteron 12.960 IBM Cell processors Peak Speed 1.7 PFLOP/s Sustained speed 1 PFLOP/s LANL Picture: http://commons.wikimedia.org/wiki/file:roadrunner_supercomputer_hires.jpg History

: : : : : : : : : : : : : : : : : : : : : : HLRS Flagship System 2011 2011 (Cray XE6 Hermit ) AMD Interlagos @ 2.3GHz 16 Cores 113.000 Cores 1 PF/s Peak Performance 250-300 TF/S Sustained Performance 126 TB Main Memory 2.7 PB Disk Space History

: : : : : : : : : : : : : : : : : : : : : : Graph 500 Lists best platforms specially designed for 3D physics simulations. The Graph 500 steering committee establishes a set of large-scale benchmarks for these applications. 1 2 Rank Machine DOE/NNSA/LLNL Sequoia - Lawrence Livermore National Laboratory (65536 nodes, 1048576 cores) DOE/SC/Argonne National Laboratory Mira - Argonne National Laboratory (32768 nodes, 524288 cores) 3 JUQUEEN - Forschungszentrum Juelich (FZJ) (16384 nodes, 262144 cores) 4 K computer - RIKEN Advanced Institute for Computational Science (AICS) (65536 nodes, 524288 cores) History

: : : : : : : : : : : : : : : : : : : : : : Green 500 (November 2012) Provides rankings of the most energy-efficient supercomputers in the world. The most eco-efficient supercomputers aggregate many low-power processors and use energy-efficient accelerators. Green500 Rank MFLOPS/W Site Computer 1 2,499.44 National Institute for Computational Sciences/University of Tennessee Beacon - Appro GreenBlade GB824M, Xeon E5-2670 8C 2.600GHz, Infiniband FDR, Intel Xeon Phi 5110P Total Power (kw) 44.89 2 2,351.10 King Abdulaziz City for Science and Technology SANAM - Adtech ESC4000/FDR G2, Xeon E5-2650 8C 2.000GHz, Infiniband FDR, AMD FirePro S10000 179.15 3 2,142.77 DOE/SC/Oak Ridge National Laboratory Titan - Cray XK7, Opteron 6274 16C 2.200GHz, Cray Gemini interconnect, NVIDIA K20x 8,209.00 History

: : : : : : : : : : : : : : : : : : : : : : Cheap supercomputing PS3 Cluster Copyright: www.wired.com, 2007 Cluster of 8 PS3 supporting research on gravitational waves gravity grid Figured out to be best fitting for this problem space Supported by the openness of the PS3 (this has changed) Linux as OS Cell processor delivers needed power History

: : : : : : : : : : : : : : : : : : : : : : PS3 Cluster 1 Cell Processor ~ 25 Nodes on BlueGene/L Cost benefits: 1 Run on Supercomputer ~ 5000 $ 8 PS3 ~ 2700 $ History

: : : : : : : : : : : : : : : : : : : : : : Example: Condor - US Airforce - PS3 - Cluster US Airforce constructed a supercomputer on base of the PS3 High performance whilst investments are relatively low 1760 PS3 Linux based Currently approx 500 TeraFLOPs Used in combination with normal graphic cards Processing of radar, video pictures History

: : : : : : : : : : : : : : : : : : : : : : SPEED & WHATELSE History

: : : : : : : : : : : : : : : : : : : : : : TOP500 List List of fastest computers worldwide Based on the Linpack-Benchmark Maintained by: Hans Meuer, University of Mannheim, Germany Erich Strohmaier, San Diego Supercomputing Center, CA Jack Dongarra, University of Tennessee, Horst D. Simon, National Energy Research Scientific Computing Center, CA History

: : : : : : : : : : : : : : : : : : : : : : History

: : : : : : : : : : : : : : : : : : : : : : History

: : : : : : : : : : : : : : : : : : : : : : TOP 500 Efficiency History

: : : : : : : : : : : : : : : : : : : : : : TOP 500 Energy-Efficiency History

: : : : : : : : : : : : : : : : : : : : : : TOP500 Performance Development History

: : : : : : : : : : : : : : : : : : : : : : TOP500 List Performance Projection History

: : : : : : : : : : : : : : : : : : : : : : TOP500 Countries History

: : : : : : : : : : : : : : : : : : : : : : TOP500 Companies History

: : : : : : : : : : : : : : : : : : : : : : TOP500 Processor Families History

: : : : : : : : : : : : : : : : : : : : : : TOP500 List Operating Sys. History

: : : : : : : : : : : : : : : : : : : : : : PARALLELISM History

1.2.1 Hardware / Prozessor : : : : : : : : : : : : : : : : : : : : : : Moore s law Data: Intel Corporation History

1.2.1 Hardware / Prozessor : : : : : : : : : : : : : : : : : : : : : : Moore s law Data: Intel Corporation History

1.2.1 Hardware / Prozessor : : : : : : : : : : : : : : : : : : : : : : Moore s law Data: Intel Corporation History

1.2.1 Hardware / Prozessor : : : : : : : : : : : : : : : : : : : : : : Featuregröße History Data: Intel Corporation

: : : : : : : : : : : : : : : : : : : : : : Power Consumption Data: Intel Corporation History

: : : : : : : : : : : : : : : : : : : : : : TOP500 Parallelism History

: : : : : : : : : : : : : : : : : : : : : : Numbers Bastian Koller (IHR/HLRS), Axel Tenschert (HLRS)

: : : : : : : : : : : : : : : : : : : : : : Representation of numbers in a computer How can numbers be represented? binary: computer only know 0 and 1 (or Yes and No, or. switch closed and switch open ) -> binary system smallest unit is either 0 or 1 ( 1 Bit ). Memory is split in packages of 8 bits each 1 Byte Coding needed Numbers 47

: : : : : : : : : : : : : : : : : : : : : : Recap: Numbers Type of Numbers - examples Integer 0, 3, 2987, -876, 10, -18765 Decimals 0,00000009, 3.14159, -273.16, 115680000000 Floating Points 0.9*10-7, 0.314159*101, -0.27316*103, 0.11568*1012 Numbers

: : : : : : : : : : : : : : : : : : : : : : Numbers Comparison to the decimal system: Use of 0.9 Numbers > 9 are represented as words combined of 0-9, each digit has a dedicated value: 1 = 10 0 10 = 10 1 100 = 10 2 n-th digit is 10 n Binary System: the same with 0 and 1 (with basis 2) 1, 2, 4, 8, 16, 32, 64, 128, etc Numbers 49

: : : : : : : : : : : : : : : : : : : : : : Numbers Influence of the memory: Smallest unit: 8 bits ( one byte ): x xi 2 i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Numbers 7 i = 0 = 1 = 2 + 4 + 16 = 22 = 128 + 64 = 192 = 255 is the biggest representable number with 8 bit 50

: : : : : : : : : : : : : : : : : : : : : : Bytes 1 Byte = 8 Bits Allows coding of 256 different states (0 255) 1 0 1 0 0 1 0 1 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 128 64 32 16 8 4 2 1 Numbers

: : : : : : : : : : : : : : : : : : : : : : Practice: Addition Decimal System 1492 + 1789 1 1 1 carry over 3281 Do the same in the binary system 42 + 56 Numbers 52

: : : : : : : : : : : : : : : : : : : : : : Practice Addition - Solution 1 1 1 carry over 0 0 1 0 1 0 1 0 = 2 + 8 + 32 = 42 0 0 1 1 1 0 0 0 = 8 + 16 + 32 = 56 0 1 1 0 0 0 1 0 = 2 + 32 + 64 = 98 Numbers 53

: : : : : : : : : : : : : : : : : : : : : : Multiplication of binary numbers Works the same way as traditionally done in school: Example : 0100 * 1110 0000 0100 0100 0100 0111000 Numbers 54

: : : : : : : : : : : : : : : : : : : : : : Multiplication Question: 0100 * 1110 = 0111000 Which numbers are multiplied? What is the result? Numbers 55

: : : : : : : : : : : : : : : : : : : : : : Multiplication 0100 * 1110 = 4 * 14 0000 0100 0100 0100 0111000 = 56 Numbers 56

: : : : : : : : : : : : : : : : : : : : : : Division Numbers 57

: : : : : : : : : : : : : : : : : : : : : : Division Similar to the traditional way. 111111 : 111 (63:7 =?) Result: 1001 0111111 : 0111 Leading Zero 0111 0001 0011 0111 Numbers 58

: : : : : : : : : : : : : : : : : : : : : : Exercises Action Required Also legen wir mal los. Wdh. Binärzahlen Rechnen mit Binärzahlen Und die Subtraktion? Numbers

: : : : : : : : : : : : : : : : : : : : : : Representation of Negative Numbers Interpretation of the leading bit Possibility: 7 bit for the number, 1 bit for the sign 1 x x x x x x x For negative numbers Leads to 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 =(-)0 =(+)0 Addition could be problematic with this representation Two s complement : Leading bit iss (2 n ) 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 = -(2 7 ) = -128 = -128 + 64 = -64 = -128+64+32+16+8+4+2+1 = -1 allows for representation of -128,, -1, 0, 1,, 127 60

: : : : : : : : : : : : : : : : : : : : : : Negative Zahlen: Zweierkomplement Erzeugung des Zweierkomplements einer gegebenen Zahl: alle Bits kippen, 1 dazuzählen, ggf. das vorne übergefallene Bit vergessen 0 0 0 0 0 1 0 1 = 4 + 1 = 5 Bits kippen: 1 1 1 1 1 0 1 0 Und 1 dazuzählen: 1 1 1 1 1 0 1 1 = -128+64+32+16+8+2+1= -5 Man hat auch nur noch eine 0: 0 0 0 0 0 0 0 0 = 0 Bits kippen: 1 1 1 1 1 1 1 1 Und 1 dazuzählen: 0 0 0 0 0 0 0 0 = 0 61

: : : : : : : : : : : : : : : : : : : : : : Rechnen mit dem Zweierkomplement Weiterer Vorteil dieser Darstellung: Man benötigt nur einen Algorithmus für Addition und Subtraktion gemeinsam 0 0 0 0 0 1 0 1 = 5 + 1 1 1 1 1 0 1 1 = -5 0 0 0 0 0 0 0 0 62

: : : : : : : : : : : : : : : : : : : : : : Ganze Zahlen III Entsprechend kann man mit 16 Bit Zahlen von -2 15,, -1, 0, 1, 2 15-1 darstellen. 32 Bits genügen für -2 31,, -1, 0, 1, 2 31-1 Mit 64 Bits kann man Zahlen von -2 63,, -1, 0, 1, 2 63-1 das kann man jetzt beliebig weiterführen... und braucht beliebig viel Speicher: 10 55 bräuchte 166 Bits. Was ist 00110100 01111101 01010100 00111001 11110000 01101101 11010001 11100011? Fragen Sie ihren Taschenrechner, was 2 63 ist. 63

: : : : : : : : : : : : : : : : : : : : : : Große und Reelle Zahlen Darstellung durch Exponent e und Mantisse m zur Basis 10 ( m*10 e ) Beispiel: 3,14172 * 10³ Reelle Zahlen werden also durch zwei Ganze Zahlen dargestellt (m,e) Beispiel: m = 314172, e = 3 Generell wird das Komma nach der ersten Zahl der Mantisse gesetzt (Beispiel: 3,14172) Probleme bei Binärzahlen? (Negative Zahlen) 16.05.2013 Java Übung 64

: : : : : : : : : : : : : : : : : : : : : : Große und Reelle Zahlen Mehrere Möglichkeiten der Darstellung von Reellen Zahlen: Klassisch: Anstelle von negativen Zahlen Vorzeichenbit (Bei angenommener 1 vor dem Komma) (Standard bei Assemblercode, IEEE 754) Explizite Angabe der Position des Kommas durch zusätzliche Zahl Implizite Annahme des Kommas nach dem ersten Bit (Problematisch mit negativen Zahlen) was man noch gerne alles machen will (und nicht unbedingt sinnvoll ist) 16.05.2013 65 Java Übung

: : : : : : : : : : : : : : : : : : : : : : Der IEEE 754 Standard Vorzeichenbit s 8 Exponenten-Bits (Bias-Wert 127 ist davon abzuziehen 23 Mantissen-Bits stellen die 23 Nachkommastellen einer 24-Stelligen Binärzahl dar Die erste Stelle vor dem Dualpunkt ist immer eine 1 und wird nicht gespeichert Beispiel: 7 = 0 10000001 11000000000000000000000 = 1.11 * 2 2 16.05.2013 Java Übung 66

: : : : : : : : : : : : : : : : : : : : : : Zusammenfassung: Elementare Datentypen Ganzzahlige Datentypen: vorzeichenbehaftete, ganze Zahlen byte 8-Bit Zahlen von -128 bis +127 short 16-Bit Zahlen von -32768 bis +32767 int 32-Bit Zahlen von ca. -2 10 9 bis ca. 2 10 9 long 64-Bit Zahlen von ca. -9 10 18 bis ca. 9 10 18 Gleitkommazahlen nach IEEE-754 Standard float Zahlen mit 32 Bit Genauigkeit double Zahlen mit 64 Bit Genauigkeit Zeichentyp char 16-Bit Unicode Zeichen Bool scher Typ boolean 1 Bit Wahrheitswert (true oder false) 16.05.2013 Java Übung 67

: : : : : : : : : : : : : : : : : : : : : : Types and Sizes Type Size boolean 1 Byte char 2 Bytes byte 1 Byte short 2 Bytes int 4 Bytes long 8 Bytes float 4 Bytes double 8 Bytes History

: : : : : : : : : : : : : : : : : : : : : : Floats/Doubles Representation of Integers in bits is simple As soon as it is not an Integer, it gets complicated In both cases, the first bit can be used to define the algebraic sign (+1 = 0 or -1 = 1), e.g.: 0 1111111111111111111111111111111 1 0000000000000000000000000000000 float and double consist additionally of: Mantissa (float: bit 2-9; double: bit 2-13) Exponent (other bits) History

: : : : : : : : : : : : : : : : : : : : : : Floats algebraic sign * 2 ^ exponent * mantissa Float (4 byte): S E E E E E E E E M M M M M M M M M M M M M M M M M M M M M M M History

: : : : : : : : : : : : : : : : : : : : : : Inexactness Calculations with doubles may lead to non-exact results double dresult = 0.; for (int i = 0; i < 1000; ++i) { dresult += 0.3; } Expected Result: 300 Result: 300.00000000000563 History

: : : : : : : : : : : : : : : : : : : : : : Double multiplications double dresult = 1.; for (int i = 0; i < 20; ++i) { dresult *= 0.000016; } for (int i = 0; i < 20; ++i) { dresult /= 0.2; dresult /= 0.00008; } History

: : : : : : : : : : : : : : : : : : : : : : Michael Haupt History

: : : : : : : : : : : : : : : : : : : : : : Floating Point Operations Floating Point Number = number representing real numbers Numbers are approximations Floating Point Numbers are required by computers: Used for calculations Handling overflow of values History