• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 119 páginas
Examen

Solutions Manual – Computer Systems: A Programmer’s Perspective (3rd Edition)

Document preview thumbnail
Vista previa 4 fuera de 119 páginas

INSTANT PDF DOWNLOAD — Complete Solutions Manual for Computer Systems: A Programmer’s Perspective (3rd Edition) by Bryant & O’Hallaron. Covers all 12 chapters with detailed, step-by-step solutions for data representation, machine-level programming, memory hierarchy, linking, and concurrency. Perfect for computer science and software engineering students mastering systems-level programming and computer architecture fundamentals. Computer Systems, Programmer’s Perspective, Bryant, O’Hallaron, Machine Code, Assembly Language, Memory Hierarchy, Computer Architecture, C Programming, Data Representation, Systems Programming, Concurrency, Threads, Caches, Linkers, Operating Systems, Software Engineering, CSAPP, Computer Science, Solutions Manual, PDF Download, Verified Answers

Vista previa del contenido

ALL 12 CHAPTERS COVERED




SOLUTIONS MANUAL

, 1

NOTICE: This document is only for use by instructors teaching courses based on the book Computer
Systems: A Programmer’s Perspective. Please observe the following safeguards:

• Use appropriate security to prevent unauthorized access to either electronic or print version of this
information.

• Do not restribute this information, and especially do not post any part of this material on any web
page or other electronic forum.

,Chapter 1

Solutions to Homework Problems

This document contains solutions for the international version of the Second Edition of the book (we call
this “Version B”). A separate document contains solutions for the North American version (Version A).
The text uses two different kinds of exercises:

• Practice Problems. These are problems that are incorporated directly into the text, with explanatory
solutions at the end of each chapter. Our intention is that students will work on these problems as they
read the book. Each one highlights some particular concept.

• Homework Problems. These are found at the end of each chapter. They vary in complexity from
simple drills to multi-week labs and are designed for instructors to give as assignments or to use as
recitation examples.

This document gives the solutions to the homework problems.


1.1 Chapter 1: A Tour of Computer Systems

There are no homework problems in this chapter.


1.2 Chapter 2: Representing and Manipulating Information

Problem 2.57 Solution:
This exercise should be a straightforward variation on the existing code.
code/data/show-ans.c

1 void show_short(short x) {
2 show_bytes((byte_pointer) &x, sizeof(short));
3 }
4


3

, 4 CHAPTER 1. SOLUTIONS TO HOMEWORK PROBLEMS

5 void show_long(long x) {
6 show_bytes((byte_pointer) &x, sizeof(long));
7 }
8
9 void show_double(double x) {
10 show_bytes((byte_pointer) &x, sizeof(double));
11 }

code/data/show-ans.c

Problem 2.58 Solution:
There are many ways to solve this problem. The basic idea is to create some multibyte datum with different
values for the most and least-significant bytes. We then read byte 0 and determine which byte it is.
The following solution creates an int with value 1. We then access its first byte and convert it to an int.
This byte will equal 0 on a big-endian machine and 1 on a little-endian machine.
code/data/show-ans.c

1 int is_big_endian(void) {
2 /* MSB = 0, LSB = 1 */
3 int x = 1;
4 /* MSB (0) when big-endian, LSB (1) when little-endian */
5 char byte = *(char *) &x;
6 return !byte;
7 }

code/data/show-ans.c

Problem 2.59 Solution:
This is a simple exercise in masking and bit manipulation. It is important to mention that ˜0xFF is a way
to generate a mask that selects all but the least significant byte that works for any word size.
(x & ˜0xFF) | (y & 0xFF)

Problem 2.60 Solution:
Byte extraction and insertion code is useful in many contexts. Being able to write this sort of code is an
important skill to foster.
code/data/rbyte-ans.c

1 unsigned put_byte (unsigned x, unsigned char b, int i) {
2 int itimes8 = i << 3;
3 unsigned mask = 0xFF << itimes8;
4
5 return (x & ˜mask) | (b << itimes8);
6 }

code/data/rbyte-ans.c

Información del documento

Subido en
9 de octubre de 2025
Número de páginas
119
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$18.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
TestBanksStuvia
3.9
(344)
Vendido
3334
Seguidores
1212
Artículos
2249
Última venta
4 horas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes