Hardware Reference
In-Depth Information
1.2 Number System Issue
Computers were initially designed as a number crunching machine. Due to the on-and-off
nature of electricity, numbers were represented in binary base from the beginning of the elec-
tronic computer age. However, we are more used to the decimal number system due to the fact
that it has been used for thousands of years. Therefore, entering numbers to be processed by the
computer and outputting numbers to be viewed by the user would be done in decimal format.
Computers need to perform conversion between binary and decimal representations. The unit
used to represent the on or off state is referred to as a bit .
The number of bits used by a computer to represent a number is usually a multiple
of 8. The computation capacity of a computer is also often expressed using the number
of bits that it can operate on in one operation. For example, there are 8-bit, 16-bit, 32-bit,
and 64-bit computers. Computers need to deal with both signed and unsigned numbers.
Two's complement method is used to represent negative numbers. A number with its most
significant bit set to 1 is negative. Otherwise it is a nonnegative number. Using two's com-
plement representation allows the computer to use the same circuit to perform addition
and subtraction.
In the microprocessor and microcontroller development tool's environment, we often see
the mixed use of different number bases. Binary, decimal, octal, and hexadecimal have all been
used. The binary number system has 2 digits: 0 and 1. The octal number system uses 8 differ-
ent digits: 0 to 7. The decimal number system uses 10 different digits: 0 to 9. The hexadecimal
number system uses 16 different digits: 0 to 9 and A through F. Since these four different num-
ber systems share some common digits, ambiguity is unavoidable. To clarify the ambiguity, a
prefix is added to each number to indicate its base. The prefixes used in the Freescale microcon-
trollers are listed in Table 1.1. Microprocessors and microcontrollers from other vendors may
use a different method to differentiate number bases.
A brief introduction to the conversion among different number bases is given in Appendix B.
Base
Prefix
Example
%10001010
@123467
12345678
$392
Binary
Octal
Decimal
Hexadecimal
(shorthand hex)
%
@
$
Table 1.1 Prefixes for number bases
1.3 Computer Hardware Organization
A computer consists of hardware and software. The hardware of a computer consists of the
processor, input devices, output devices, and memory.
Processor. The processor is responsible for performing all of the computational
operations and the coordination of the usage of resources of a computer. A
computer system may consist of one or multiple processors. A processor may
perform general-purpose computations or special-purpose computations, such as
graphics rendering, printing, or network processing.
 
Search WWH ::




Custom Search