13.07.2015 Views

Übungen zur Vorlesung Grundlagen der Rechnerarchitektur

Übungen zur Vorlesung Grundlagen der Rechnerarchitektur

Übungen zur Vorlesung Grundlagen der Rechnerarchitektur

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

oughly 5 percent over the 92 million tons the industry shipped in 2011. Shipments of 97 milliontons are only equivalent to our shipments in 1995, and represent only 90% of our five-year prerecessionaverage shipments of 108 million tons.Domestic capacity utilization rose to 79 percent in the first quarter, a 6 percent improvementfrom the previous quarter. Total finished steel import market share year-to-date is at 23 percent,and imports are increasing at a faster rate than our domestic steel market is recovering. The mostrecent Department of Commerce Steel Import Monitoring and Analysis data for the month ofApril recorded another sharp rise in finished imports to the highest level since October of 2008.We are very concerned about this trend and sensitive to policy changes that could makeproduction here more expensive and less internationally competitive.Steel & EnergyThe production of steel is inherently energy intensive, and the industry consumes substantialamounts of electricity, natural gas, and coal and coke to make our products. In 2010 ourdomestic industry consumed 45.7 billion kWh of electricity. Energy is typically 20% or more ofthe cost of making steel and, as such, energy efficiency is key to our industry’s competitiveness.AISI members are doing everything they can to increase energy efficiency, and we are leadingthe way by effectively setting the bar for steel industry efficiency worldwide. AISI membershave made substantial gains in reducing their energy usage, as well as their environmentalfootprint, over the last two decades. The domestic steel industry has voluntarily reduced itsenergy intensity by 27% since 1990, while reducing its greenhouse gas (GHG) emissions by 33%over the same time period. In fact, data presented by the U.S. Department of Energy at a recentmeeting of Global Superior Energy Partnership’s Steel Task Group showed that the steelindustry in the U.S. has the lowest energy intensity and second-lowest CO 2 emissions intensity ofany major steel producing country.While we approach the practical limits for efficiency using today’s processes and continue topursue incremental gains, AISI members are not resting on their laurels. We recognized in 2003that in or<strong>der</strong> to make any further significant improvement in energy use, new breakthroughtechnologies would be needed. It was at that time the industry began investing, often inpartnership with DOE, in the CO 2 Breakthrough Program, a suite of research projects designed todevelop new ironmaking technologies that emit little or no CO 2 while conserving energy. Wehave developed two key technologies to achieve those goals since that time, and they are nowready for pilot scale testing. The research is being done at MIT and University of Utah and bothprojects are the subject of proposals currently un<strong>der</strong> consi<strong>der</strong>ation for DOE cost-sharing. Thissuccessful partnership with DOE, along with the continued support of Congress, will acceleratethe development and deployment of critical technologies such as these.Concerns with S. 2146A national CES imposes its direct requirements on the utility sector, not on its customers, but itis the customers that will bear the costs associated with compliance. Our principal concern isthat this will inevitably raise the costs of electricity to large industrial customers like steel, while2


<strong>Übungen</strong> zu <strong>Grundlagen</strong> <strong>der</strong> <strong>Rechnerarchitektur</strong> SS2013 – Übungsblatt 4 3Aufgabe 3(5 Punkte)Das Produkt zweier natürlicher Zahlen a0 · a1 lässt sich rekursiv wie folgt berechnen:a0 · 0 = 0 ; a0 · a1 = a0 · (a1 − 1) + a0Das Programm rekmul.asm berechnet das Produkt zweier natürlicher Zahlen rekursiv. Essteht auf <strong>der</strong> Webseite <strong>der</strong> Übung zum Download <strong>zur</strong> Verfügung.1 .data2 prompt1: .asciiz "enter value:"3 prompt2: .asciiz "result is:"4 lf: .asciiz "\n"5 .text6 .globl main7 main:8 li $v0, 4 # print string service9 la $a0, prompt1 # write("enter value:")10 syscall11 li $v0, 5 # read integer12 syscall13 add $s0, $zero, $v014 li $v0, 4 # print string service15 la $a0, prompt1 # write("enter value:")16 syscall17 li $v0, 5 # read integer18 syscall19 add $a1, $zero, $v020 add $a0, $zero, $s021 jal rekmul # Jump to Subroutine# Return from Subroutine here!22 add $s0, $zero, $v0 # Save return value in $s023 li $v0, 4 # print string service24 la $a0, prompt2 # write("result is:")25 syscall26 li $v0, 1 # print integer service27 add $a0, $zero, $s0 # write ($s0)28 syscall29 li $v0, 4 # print string service30 la $a0, lf # write line feed31 syscall32 li $v0, 10 # Exit program33 syscall34 rekmul:35 addi $sp,$sp, -436 sw $ra, 4($sp)37 beq $a1, $zero, null # if a1=0 then goto null38 addi $a1, $a1, -1 # calculate a1-139 jal rekmul # v0=rekmul(a0,a1-1)40 add $v0, $v0, $a0 # v0=rekmul(a0,a1-1) + a041 j return # jump to return


<strong>Übungen</strong> zu <strong>Grundlagen</strong> <strong>der</strong> <strong>Rechnerarchitektur</strong> SS2013 – Übungsblatt 4 5Aufgabe 4(10 Punkte)Schreiben Sie ein MIPS Programm, das eine Integer-Zahl n (>=0) einliest. Anschließendsoll eine rekursive Subroutine implementiert werden, die wie folgt arbeitet:function pow2 (int n) {IF (n < 0) {return -1} // FehlerIF (n = 0) {return 1}ELSE { return (pow2(n-1)*2) }}Beachten Sie bei <strong>der</strong> Bearbeitung dieser Aufgabe die Konventionen (Procedure Call Conventions)von MIPS, die in <strong>der</strong> <strong>Vorlesung</strong> (03 MiPS-Assembler (VL10)) vorgestellt wurden.Sie können sich bei Ihrer Lösung an dem Beispielprogramm fakultaet.asm orientieren.(Hinweis: eine Fehlerbehandlung für den Fall n < 0 wird hier nicht verlangt (return -1)! )siehe 2erpotenz.asmAufgabe 5(4 Punkte)Wie unterscheiden sich Interrupts von Exceptions? Nennen Sie je ein Beispiel.Exceptions sind interne Ereignisse. Sie treten auf, wenn z.B. Fehler beim Ausführen einerInstruction auftreten. Werden standardmäßig mit einer Fehlermeldung behandelt. Exceptionstreten synchron zum Programmablauf ein und stehen im direkten Zusammenhang mitbestimmten Befehlen.Interrupts sind externe Ereignisse (z.B. Meldungen von I/O-Devices). Interrupts tretenasynchron zum Programmablauf ein und haben keine direkte Abhängigkeit zu bestimmtenBefehlen.Exception-Handling wird beim MIPS-Prozessor von Coprozessor0 übernommenBeispiele:Interrupts: Keyboard-, TimerinterruptExceptions: Address Error, Arithmetic OverflowAufgabe 6(4 Punkte)Nähere Informationen zu einer Exception finden sich bei MIPS Prozessoren im Cause-Register. Welche Bedeutung haben die dortigen Fel<strong>der</strong> Exception Code bzw. Pending Interrupts?Exception Code: Welche Art von Exception ist aufgetreten?Pending Interrupts: Anstehende (nicht behandelte) Interrupts.


<strong>Übungen</strong> zu <strong>Grundlagen</strong> <strong>der</strong> <strong>Rechnerarchitektur</strong> SS2013 – Übungsblatt 4 6Aufgabe 7(2 Punkte)Erläutern Sie mit wenigen Worten was unter einem “atomaren“ Zugriff auf eine Variableverstanden wird!Eine nicht-unterbrechbare Anweisung o<strong>der</strong> eine Abfolge von Anweisungen die nicht unterbrechbarsind.Auf eine atomare Variable hat nur ein Prozess bzw. ein Programm zu einer Zeit einen exklusivenZugriff.Aufgabe 8(3 Punkte)Erläutern Sie mit wenigen Worten den Zusammenhang zwischen (bzw. die Funktion von)Programm-Counter (PC), Instruction Memory und Register-File beim MIPS-Prozessor.Programm-Counter (PC): Zeiger auf die Adresse <strong>der</strong> nächsten auszuführenden Instruktion<strong>der</strong> CPU (damit <strong>der</strong> Speicher schon mit dem Bereitstellen <strong>der</strong> nächsten Instruktion beginnenkann)Instruction Memory: Speicher mit <strong>der</strong> nächsten abzuarbeitenden Instruktion. Wenn <strong>der</strong> PCals Eingabe anliegt, steht im nächsten Taktzyklus die 32-Bit lange Instruktion auf den „Instruction“Leitungen bereit und kann „dekodiert“ werden bzw. ausgeführt werden.Register-File: kleine Menge von Speicherzellen (32 Bit) in <strong>der</strong> CPU, die mit hoher Geschwindigkeitangesprochen werden können (im Vgl. zu an<strong>der</strong>em Speicher)(beim MIPS32 → 32 * 32 Bit Register)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!