Computer numbers

From MobileRead

Revision as of 21:07, 5 June 2009 by DaleDe (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Computer numbers are the basic units manipulated in a digital computer. The computer uses a binary numbering system as shown below on the left compared to the decimal system we use today.

[edit] table

decimalbinary
00
11
210
311
4100
5101
6110
7111
81000
91001
 
hexadecimalbinary
00
11
210
311
4100
5101
6110
7111
81000
91001
A1010
B1011
C1100
D1101
E1110
F1111

[edit] Hexadecimal

Hexadecimal (also called base-16) numbers is a number system used to simplify the display and manipulation of numbers used in computers. As can be seen in the table it can take up to 4 binary digits to represent the symbols used in the decimal system. Working with binary digits can really be cumbersome so computer folks often work in hexadecimal. Hexadecimal is similar to decimal but adds 6 more characters to the number system (A, B, C, D, E, F) to fill out all the 16 combinations possible with 4 binary digits (bits). Two hexadecimal numbers can represent 8 bits, called a byte, that can count from 0 to 255 in decimal.

It is up to the program and computer to understand what a byte represents. It could be a binary number or a character or even interpreted as a logical representation of data such as true or false. However, it can sometimes be confusing as to what numbering system is in use. Hexadecimal numbers include a small x at the beginning to indicate that the number is being shown in hexadecimal thus x10 is equal to a decimal 16.

[edit] Implications of binary

In decimal we use powers of ten thus we see progressions as 10, 100, 1000, 10000, etc. In binary we see powers of two thus the progression is 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, etc. This is why computer terminology for a thousand bytes is really 1024 instead of 1000.

It is easy to translate decimal integers into the equivalent binary but no so for fractions. There are many decimal fractions that have no exact binary equivalent. Binary fractions are actually division by 2 so fractions like 1/2, 1/4, 1/8 are easy to do but others are more difficult.

Personal tools
MobileRead Networks