100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Computer Systems: A Programmer's Perspective Chapter 2

Rating
-
Sold
6
Pages
9
Uploaded on
11-09-2020
Written in
2020/2021

This is a summary of Computer Systems: A Programmer's Perspective Chapter 2 by Randal E. Bryant and David R. O’Hallaron.

Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Study
Course

Document information

Summarized whole book?
No
Which chapters are summarized?
Hoofdstuk 2
Uploaded on
September 11, 2020
File latest updated on
September 20, 2020
Number of pages
9
Written in
2020/2021
Type
Summary

Subjects

Content preview

Computer Systems: a Programmer’s
Perspective
Randal E. Bryant en David R. O’Hallaron


Chapter 2 – Representing and Manipulating
Information
In the real world, base-10 is used in decimal notation and is based on the ten fingers we have. Base-2
(binary, so 0 or 1) works better for machines that store and process information. In computer
systems there are three important representations of numbers:
 Unsigned encodings
are based on traditional binary notation and represents numbers greater than or equal to 0.
 Two-complement encodings
are the most common way to represent signed integer (numbers that may be either positive or
negative).
 Floating-point encodings
are a base-2 version of scientific notation for representing real numbers.

Computer representations use a limited number of bits to encode a number, which is why some
operations can overflow when results are too large to be represented. This is why some
computations won't return the expected result. With floating-point arithmetic, the product of
positive numbers will always be positive and numbers that are too large will yield the special value
+∞.
Integer representations can encode a comparatively small range of values, but do so precisely, while
floating-point representations can encode a wide range of values, but only approximately

2.1 - Information Storage
So, we've learned that machine-level programs views memory as a very large array of bytes, known
as the virtual memory. Every byte in the memory has a unique identifying number, called the
address. The set of all possible addresses is referred to as the virtual address space. This virtual space
is just a conceptual image: the actual implementation uses a combination of DRAM (see chapter 1),
flash memory, disk storage, special hardware and OS software to provide the program with a
monolithic byte array.

The compiler and run-time system divide this memory space into multiple parts to store the different
program objects, for instance program data, instructions and control information. There are multiple
mechanisms that allocate and manage the software for various parts of the program, all in the virtual
address space. A C compiler associates a data type program objects. However, the actual machine-
level program treats every program object as a block of bytes and the program itself as a sequence of
bites.

2.1.1 - Hexadecimal Notation
Hexadecimal numbers are written in base-16 and consist of the number 1 to 9 and the letters A to F.
A byte in hexadecimal notation can range from 00 16 to FF16. Hexadecimal number can be recognized
by the '0x' notation in front of them.




1

, 2.1.2 - Data Sizes
Every computer has a word size, that indicates the standard size of pointer data. This word size
determines the maximum size of the virtual address. A machine with a w-bit word size has a virtual
addresses that can range from 0 to 2w - 1. The program can access up to 2w bytes. Past years there
has been a shift from 32-bit word sizes to 64 bit word sizes, because the virtual address space is
larger with 64 bit word size (32: 4 GB, 64: 16 exabytes (EB)). Programs that are compiled for 32 bit
machines can also be run on most 64 bit machines by using 'gcc -m32 file.c'. 64 bit programs can only
be run on 64 bit machines.

There are multiple data formats with different lengths and different ways of encoding data, as seen
below.




Integer data can either be signed (able to present negative, zero and positive values) or unsigned
(only positive values and zero). Data type char represents a single byte can store a single character or
an integer. The data types short, int and long have different sizes and store integers. The data types
float and double have different sizes and store floating-point number. Most of the data types encode
signed values. Char is a bit weird in this: char can be both signed as unsigned, so pay attention to
that!

2.1.3 - Addressing and Byte Ordering
Programs that span multiple bytes have an address. The bytes of the program are stored in a specific
order. Mukti-byte objects are stored in a contiguous sequence of bytes, where the address of the
smallest byte is the address of the whole sequence. For example, int x is 4 bytes and has address
0x100. The 4 bytes of the whole int would be stored in locations 0x100, 0x101, 0x102 en 0x103. Every
location can store 1 byte.

There are two ways in which a multi-byte object can be stored:


2

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
cilevanmarken Universiteit van Amsterdam
Follow You need to be logged in order to follow users or courses
Sold
190
Member since
6 year
Number of followers
166
Documents
11
Last sold
7 months ago

3.9

44 reviews

5
15
4
15
3
10
2
1
1
3

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions