Chapter 15. Data Representation

Table of Contents

15.. What Everyone Should Know About Data Representation
Practice
15.. Representing Information
Practice
15.. Numeric Limitations of Computers
Practice
15.. Fixed Point Number Systems
Practice
15.. Modular Number Systems
Practice
15.. Binary Data Representation
Practice
15.. Metric and Binary Quantities
Practice
15.. The Arabic Numeral System
Practice
15.. Number Bases
Converting Other Bases to Decimal
Converting Decimal to Other Bases
Practice
15.. Binary Fixed Point
Limitations of Binary
Practice
15.. Binary/Octal/Hexadecimal Conversions
Practice
15.. Unsigned Binary Integers
Introduction
Range
Arithmetic
Practice
15.. Signed Integers
15.. Sign-Magnitude
Format
Negation
Conversions
Addition and Subtraction
Range
Comparison
Practice
15.. One's complement
Format
Negation
Conversions
Addition and Subtraction
Range
Comparison
Practice
15.. Two's Complement
Format
Negation
Another Way to Look at Two's Complement
Addition and Subtraction
Range
Comparison
Overflow Detection
Extension and Reduction
Practice
15.. Biased Notation
Format
Negation
Addition and Subtraction
Range
Comparison
Practice
15.. Hex and Octal with Signed Numbers
Practice
15.. Floating Point
The Basics
Floating Point and Abstraction
A Simple Floating Point Format
Overflow and Underflow
Cost of Floating Point
IEEE Floating Point Formats
Practice
15.. Character Storage
ASCII
ISO
Unicode
Practice

What Everyone Should Know About Data Representation

Computer science students typically spend at least one or two semesters studying computer architecture (hardware design) and machine/assembly language. Most will never become hardware designers, or assembly language programmers, but understanding how data are represented in computer hardware makes all of us better programmers.

Knowing the limitations of computer number systems is necessary in order to write programs that produce correct and precise output and also in writing the most efficient programs possible.

This chapter provides a very brief overview of these limitations. We will cover the standard number systems used by modern computers alongside some historical and hypothetical systems to help put them in context.

Practice

Note

Be sure to thoroughly review the instructions in Section 2, “Practice Problem Instructions” before doing the practice problems below.
  1. What are two advantages of understanding computer data representation if we are not doing hardware design?