• ¿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 89 páginas
Examen

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

Document preview thumbnail
Vista previa 4 fuera de 89 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

, Computer Systems: A Programmer’s Perspective
k k k k




Instructor’s Solution Manual 1
k k k




Randal E. Bryant k k



David R. O’Hallaron
k k k




December 4, 2003 k k




Copyright c 2003, R. E. Bryant, D. R. O’Hallaron. All rights reserved.
1
k k k k k k k k k k k

,Chapter 1 k




Solutions to Homework Problems k k k




Thetext uses twodifferent kinds of exercises:
k k k k k k k




Practice Problems. These are problems that are incorporated directly into the text, with explanatory
k k k k k k k k k k k k k



solutions at the end of each chapter. Our intention is that students will work on these problems as they read
k k k k k k k k k k k k k k k k k k k k



the book. Each one highlights some particular concept.
k k k k k k k k




Homework Problems. These are found at the end of each chapter. They vary in complexity from
k k k k k k k k k k k k k k k



simple drills to multi-week labs and are designed for instructors to give as assignments or to use as
k k k k k k k k k k k k k k k k k k



recitation examples.
k k




Thisdocument gives thesolutions tothehomework problems.
k k k k k k k k




1.1 Chapter 1: A Tour of Computer Systems k k k k k k




1.2 Chapter 2: Representing and Manipulating Informationk k k k k




Problem2.40 Solution: k k




Thisexerciseshouldbe astraightforward variation onthe existing code.
k k k k k k k k k k




k code/data/show-ans.c

1 void show_short(shortint x)
k k k



2 {
3 show_bytes((byte_pointer)&x,sizeof(shortint)); k k k



4 k }
5
6 void show_long(longint x)
k k k


7 {
8 show_bytes((byte_pointer)&x,sizeof(long)); k k



9 k }


1

, 2 CHAPTER 1. SOLUTIONS TO HOMEWORK PROBLEMS

10
11 voidshow_double(doublex) k k


12 {
13 show_bytes((byte_pointer)&x,sizeof(double)); k k


14 k }

k code/data/show-ans.c

Problem2.41 Solution: k k




Thereare many ways to solve this problem. Thebasic idea is to create some multibyte datumwith different values
k k k k k k k k k k k k k k k k k k k



for the most and least-significant bytes. We then read byte 0 and determine which byte it is.
k k k k k k k k k k k k k k k k k




In the following solution is to create an intwith value 1. We then access its first byte and convert it to an
k k k k k k k k k k k k k k k k k k k k k k



int. This byte will equal 0 on a big-endian machine and 1 on a little-endian machine.
k k k k k k k k k k k k k k k




k code/data/show-ans.c

1 int is_little_endian(void)
k


2 {
3 /* MSB = 0, LSB = 1 */ k k k k k k k


4 int x = 1; k k k



5
6 /* Return MSB when big-endian, LSB when little-endian*/
k k k k k k k k


7 return (int) (* (char *) &x); k k k k k



8 k }

k code/data/show-ans.c

Problem2.42 Solution: k k




This is a simple exercise in masking and bit manipulation. It is important to mention that ˜0xFFis a way to
k k k k k k k k k k k k k k k k k k k k



generate a mask that selects all but the least significant byte that works for any word size.
k k k k k k k k k k k k k k k k k




(x & 0xFF) | (y & ˜0xFF)
k k k k k k




Problem2.43 Solution: k k




Theseexercises require thinking about the logical operation !in a nontraditional way. Normally we think of it
k k k k k k k k k k k k k k k k k



as logical negation. More generally, it detects whether there is any nonzero bit in a word.
k k k k k k k k k k k k k k k k




A. !!x

B. !!˜x

C. !!(x & 0xFF) k k




D. !!(˜x & 0xFF) k k




Problem2.44 Solution: k k

Libro relacionado
 image
Editorial: 2015 ISBN: 9780134123837 Edición: Desconocido

Información del documento

Subido en
2 de abril de 2026
Número de páginas
89
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$20.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.
Stuviahero01
3.9
(47)
Vendido
271
Seguidores
9
Artículos
7369
Última venta
2 días 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