Chapter 2Number Systems and Codes

This chapter describes the basics of number systems, codes, and error detection/correction. Note that adequate coverage of Number Systems and Codes is included in this chapter. This will provide sufficient background to understand the concepts described in the chapters that follow.

2.1 Number Systems

A computer, like all digital systems, utilizes two states to represent information. These two states are given the symbols 0, and 1. It is important to remember that these 0's and 1's are symbols for the two states and have no inherent numerical meanings of their own. These two digits are called binary digits (bits) and can be used to represent numbers of any magnitude. Digital systems including the microcontroller carry out all arithmetic and logic operations internally using binary numbers. Because binary numbers are long, a more compact form using some other number system is preferable to represent them. The computer user finds it convenient to work with this compact form. Hence, it is important to understand the various number systems used with computers. These are described in the following sections.

2.1.1 General Number Representation

In general, N can be written as a string of digits whose integer parts(dp-1,dp-2, ......,d1,d0) and fractional parts (d−1 “ d-q) are separated by the radix or decimal point (•). In this format, the number N is represented as

2.1

If a number has no fractional portion, then the number is called an integer number ...

Get Fundamentals of Digital Logic and Microcontrollers, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.