Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Chapter 6: Appendix A, 3. (page 500)

A.3 Is it ever safe for a user program to use registers \(k0 or \)k1?

Short Answer

Expert verified

No, it's not safer for a user to use register $k0 or $k1.

Step by step solution

01

MIPS

The MIPS processor's assembly language is simply known as MIPS assembly language. MIPS is an acronym for Microprocessor without Interlocked Pipeline Stages. Learning the MIPS assembly language is quite beneficial. Knowing how to code in this language allows you to gain a better knowledge of how these systems work on a more fundamental level.MIPS features a total of 64 registers, including 32 general-purpose registers and 32 floating-point registers. The dollar symbol ($) appears on all registers. $f0, $f1,..., $f31 are the names of the floating-point registers. The general-purpose registers are given below and include both names and numbers. It is usually advisable to utilize the register names while programming in the MIPS assembler.

02

Usage of registers $k0 and $k1

$k0 and $k1 are used as aliases for registers $26 and $27.

The k registers are set aside for use by the operating system kernel. They can change at any time since interrupt handlers use them. The interrupt handler is allowed to use without having to save or restore its values. The OS can use it for whatever it wants. They Can be useful as scratch registers that can be used without any obligations of corrupting the user-space state. This allows just enough leeway to start saving registers, as well as making returning from the interrupt handler possible. The $K0 and $K1 cannot be used for the user program, This is because exceptions occur asynchronously with a program, and these registers $k0 and $k1 are the only safe registers reserved for the exception handler. As $k0 and $k1 are solely used as exception handling registers, using them in a normal user program will not be safe.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Assume that X consists of 3 bits : x2, x1, x0. Write four logic functions that are true if and only if

  • X contains only one 0
  • X contains an even number of 0s
  • X when interpreted as an unsigned binary number is less than 4
  • X when interpreted as a signed (two’s complement) number is negative.

Rewrite the code for fact to use fewer instructions.

A.1 [5] Section A.5 described how memory is partitioned on most MIPS systems. Propose another way of dividing memory that meets the same goals.

Perhaps the most likely case of adding many numbers at once in a computer would be when trying to multiply more quickly by using any adders to add many numbers in a single clock cycle. Compared to the multiply algorithm in Chapter 3, a carry save scheme with many adders could multiply more than 10 times faster. This exercise estimates the cost and speed of a combinational multiplier to multiply two positive 16-bit numbers. Assume that you have 16 intermediate terms M15, M14, …, M0, called partial products, that contain the multiplicand ANDed with multiplier bits m15, m14, …, m0. The idea is to use carry save adders to reduce the noperands into 2n/3 in parallel groups of three, and do this repeatedly until you get two large numbers to add together with a traditional adder.

First, show the block organization of the 16-bit carry save adders to add these 16 terms, as shown on the right in Figure B.14.1. Then calculate the delays to add these 16 numbers. Compare this time to the iterative multiplication scheme in Chapter 3 but only assume 16 iterations using a 16-bit adder that has full carry lookahead whose speed was calculated in Exercise B.29.

First, write down a list of the daily activities that you typically do on a weekday. For instance, you might get out of bed, take a shower, get dressed, eat breakfast, dry your hair, and brush your teeth. Make sure to break down your list so you have a minimum of 10 activities.

6.1.1 Now consider which of these activities is already exploiting some form of parallelism (e.g., brushing multiple teeth at the same time, versus one at a time, carrying one book at a time to school, versus loading them all into your backpack and then carry them “in parallel”). For each of your activities, discuss if they are already working in parallel, but if not, why they are not.

6.1.2 Next, consider which of the activities could be carried out concurrently (e.g., eating breakfast and listening to the news ). For each of your activities, describe which other activity could be paired with this activity.

6.1.3 For 6.1.2, what could we change about current systems (e.g., showers, clothes, TVs, cars) so that we could perform more tasks in parallel?

6.1.4 Estimate how much shorter time it would take to carry out these activities if you tried to carry out as many tasks in parallel as possible.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free